mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 21:33:13 -07:00
count archive files for failed-torrent branch. fixes #314
This commit is contained in:
parent
8e754aa334
commit
c431e0e3da
1 changed files with 6 additions and 0 deletions
|
@ -30,6 +30,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
status = int(1) # 1 = failed | 0 = success
|
status = int(1) # 1 = failed | 0 = success
|
||||||
root = int(0)
|
root = int(0)
|
||||||
video = int(0)
|
video = int(0)
|
||||||
|
archive = int(0)
|
||||||
foundFile = int(0)
|
foundFile = int(0)
|
||||||
extracted_folder = []
|
extracted_folder = []
|
||||||
extractionSuccess = False
|
extractionSuccess = False
|
||||||
|
@ -166,9 +167,14 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
if fileExtension in mediaContainer: # If the file is a video file
|
if fileExtension in mediaContainer: # If the file is a video file
|
||||||
Logger.debug("MAIN: Found media file: %s", filePath)
|
Logger.debug("MAIN: Found media file: %s", filePath)
|
||||||
video += 1
|
video += 1
|
||||||
|
if fileExtension in compressedContainer: # If the file is an archive file
|
||||||
|
archive += 1
|
||||||
if video > int(0): # Check that media files exist
|
if video > int(0): # Check that media files exist
|
||||||
Logger.debug("MAIN: Found %s media files", str(video))
|
Logger.debug("MAIN: Found %s media files", str(video))
|
||||||
status = int(0)
|
status = int(0)
|
||||||
|
elif not (config().issubsection(inputCategory,["SickBeard"]) and config()["SickBeard"][inputCategory]["nzbExtractionBy"] == "Destination") and archive > int(0):
|
||||||
|
Logger.debug("MAIN: Found %s archive files to be extracted by SickBeard", str(archive))
|
||||||
|
status = int(0)
|
||||||
else:
|
else:
|
||||||
Logger.warning("MAIN: Found no media files in output.")
|
Logger.warning("MAIN: Found no media files in output.")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue