Compare commits

..

3 commits

2 changed files with 8 additions and 1 deletions

View file

@ -68,8 +68,14 @@ if [ ! -d "$DIR" ]; then
exit 1 exit 1
fi fi
EXPECTED_FILES="$(find "$DIR" -type f \( -iname '*.mkv' -o -iname '*.mp4' -o -iname '*.avi' \) | wc -l | tr -d ' ')"
if [ -z "$EXPECTED_FILES" ] || [ "$EXPECTED_FILES" -lt 1 ] || [ "$EXPECTED_FILES" -gt 100 ]; then
log "FEHLER: ungueltige Anzahl Videodateien: ${EXPECTED_FILES:-0} - kein Move"
exit 1
fi
# Lease registrieren, solange der SAB-Job und sein Quellpfad noch sichtbar sind. # Lease registrieren, solange der SAB-Job und sein Quellpfad noch sichtbar sind.
START_PAYLOAD="$(json_payload action start category "$CATEGORY" directory "$DIR" release "$NZB_NAME" cleanName "$CLEAN_NAME")" START_PAYLOAD="$(json_payload action start category "$CATEGORY" directory "$DIR" release "$NZB_NAME" cleanName "$CLEAN_NAME" expectedFiles "$EXPECTED_FILES")"
START_RESPONSE="$(handoff "$START_PAYLOAD" 2>>"$LOGFILE")" || { START_RESPONSE="$(handoff "$START_PAYLOAD" 2>>"$LOGFILE")" || {
log "FEHLER: n8n-Handoff konnte nicht registriert werden - kein Move" log "FEHLER: n8n-Handoff konnte nicht registriert werden - kein Move"
exit 1 exit 1

View file

@ -76,6 +76,7 @@ try:
assert result.returncode == 0, (result.stdout, result.stderr) assert result.returncode == 0, (result.stdout, result.stderr)
assert not source.exists() and (target / "episode.mkv").exists() assert not source.exists() and (target / "episode.mkv").exists()
assert [a["action"] for a in actions] == ["start", "moved", "status", "status"] assert [a["action"] for a in actions] == ["start", "moved", "status", "status"]
assert actions[0]["expectedFiles"] == "1"
with tempfile.TemporaryDirectory() as td: with tempfile.TemporaryDirectory() as td:
actions.clear() actions.clear()