Zachary Kotlarek 13 anni fa
parent
commit
580f941bd3
2 ha cambiato i file con 10 aggiunte e 3 eliminazioni
  1. 1 1
      findAllTorrents
  2. 9 2
      findTorrent.sh

+ 1 - 1
findAllTorrents

@@ -37,7 +37,7 @@ while read -d $'\0' SERIES ; do
 	fi
 
 	# Actual search, with timeout to ensure we don't get stuck
-	~/bin/video/timeout -t 300 ~/bin/video/findTorrent.sh "${SERIES}"
+	SILENT=1 ~/bin/video/timeout -t 300 ~/bin/video/findTorrent.sh "${SERIES}"
 
 	# Print the series name on error
 	if [ $? -ne 0 ]; then

+ 9 - 2
findTorrent.sh

@@ -50,12 +50,19 @@ if [ ! -d "${SEASON_DIR}" ]; then
 	usage
 fi
 
+# Enable DEBUG by default
+DEBUG=1
+if [ -n "${SILENT}" ]; then
+	DEBUG=0
+fi
+export DEBUG
+
 # Special handling for search-by-date folders
 if [ -r "${SERIES_DIR}/search_by_date" ]; then
 	SEARCH_STR=`cat "${SERIES_DIR}/search_by_date"`
-	DEBUG=1 ~/bin/video/findDate.sh "${SERIES}" "${SEARCH_STR}" 0 3 | download
+	~/bin/video/findDate.sh "${SERIES}" "${SEARCH_STR}" 0 3 | download
 	exit $?
 fi
 
 # Run the standard command, in debug mode
-DEBUG=1 ~/bin/video/findTorrent.pl "${SEASON_DIR}" | download
+~/bin/video/findTorrent.pl "${SEASON_DIR}" | download