From e511817b67c1aaf530e9811278ff1b7b5c81ec50 Mon Sep 17 00:00:00 2001 From: Sean Fleming Date: Sat, 19 Jan 2013 16:23:54 +0000 Subject: [PATCH] From upstream: improved the post-processing script to better handle renamed rar-files --- .../9.0/bin/nzbget-postprocess.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh index df854d76..f219b4ff 100644 --- a/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh +++ b/nzbget-postprocessing-files/9.0/bin/nzbget-postprocess.sh @@ -377,6 +377,17 @@ if (ls *.rar >/dev/null 2>&1); then rmdir extracted fi +# If there were nothing to unrar and the download was not par-checked, +# we don't know if it's OK. To be sure we force par-check. +# In particular that helps with downloads containing renamed rar-files. +# The par-repair will rename files to correct names, then we can unpack. +if [ "$Unrared" -eq 0 -a "$NZBPP_PARSTATUS" -eq 0 ]; then + if (ls *.[pP][aA][rR]2 >/dev/null 2>&1); then + echo "[INFO] Post-Process: No rar-files found, requesting par-check" + exit $POSTPROCESS_PARCHECK_ALL + fi +fi + # If download contains only nzb-files move them into nzb-directory # for further download # Check if command "wc" exists