Fixed a bug in the minSize function, was backwards so it never returned results when media files existed.

This commit is contained in:
echel0n 2014-04-22 21:26:44 -07:00
commit 817f310169
4 changed files with 10 additions and 17 deletions

View file

@ -188,6 +188,7 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
logger.error("A problem was reported in the autoProcess* script. If torrent was paused we will resume seeding") logger.error("A problem was reported in the autoProcess* script. If torrent was paused we will resume seeding")
nzbtomedia.resume_torrent(clientAgent, inputHash, inputID, result, inputName) nzbtomedia.resume_torrent(clientAgent, inputHash, inputID, result, inputName)
else: else:
if clientAgent != 'manual':
# update download status in our DB # update download status in our DB
nzbtomedia.update_downloadInfoStatus(inputName, 1) nzbtomedia.update_downloadInfoStatus(inputName, 1)

View file

@ -328,6 +328,7 @@ def process(inputDirectory, inputName=None, status=0, clientAgent='manual', down
result = -1 result = -1
if result == 0: if result == 0:
if clientAgent != 'manual':
# update download status in our DB # update download status in our DB
update_downloadInfoStatus(inputName, 1) update_downloadInfoStatus(inputName, 1)

View file

@ -77,16 +77,7 @@ class autoProcessTV:
inputName, dirName = convert_to_ascii(inputName, dirName) inputName, dirName = convert_to_ascii(inputName, dirName)
# Now check if tv files exist in destination. Eventually extraction may be done here if nzbExtractionBy == TorrentToMedia # Now check if tv files exist in destination. Eventually extraction may be done here if nzbExtractionBy == TorrentToMedia
video = 0 if listMediaFiles(dirName): # Check that a video exists. if not, assume failed.
for dirFile in listMediaFiles(dirName):
fullFileName = os.path.basename(dirFile)
fileName, fileExt = os.path.splitext(fullFileName)
if fileExt in nzbtomedia.MEDIACONTAINER:
logger.debug("Found media file: %s" % (fullFileName))
video += 1
if video > 0: # Check that a video exists. if not, assume failed.
flatten(dirName) # to make sure SickBeard can find the video (not in sub-folder) flatten(dirName) # to make sure SickBeard can find the video (not in sub-folder)
elif clientAgent == "manual": elif clientAgent == "manual":
logger.warning("No media files found in directory %s to manually process." % (dirName), section) logger.warning("No media files found in directory %s to manually process." % (dirName), section)
@ -94,7 +85,7 @@ class autoProcessTV:
else: else:
logger.warning("No media files found in directory %s. Processing this as a failed download" % (dirName), section) logger.warning("No media files found in directory %s. Processing this as a failed download" % (dirName), section)
status = 1 status = 1
failed = True failed = 1
# configure SB params to pass # configure SB params to pass
fork_params['quiet'] = 1 fork_params['quiet'] = 1

View file

@ -132,7 +132,7 @@ def is_minSize(inputName, minSize):
inputSize = getDirSize(os.path.dirname(inputName)) inputSize = getDirSize(os.path.dirname(inputName))
# Ignore files under a certain size # Ignore files under a certain size
if inputSize < minSize * 1048576: if inputSize > minSize * 1048576:
return True return True
def is_sample(inputName): def is_sample(inputName):
@ -611,7 +611,7 @@ def listMediaFiles(path, minSize=0, delete_ignored=0, media=True, audio=True, me
fullCurFile = joinPath(path, curFile) fullCurFile = joinPath(path, curFile)
# if it's a folder do it recursively # if it's a folder do it recursively
if os.path.isdir(fullCurFile) and not curFile.startswith('.') and not curFile == 'Extras': if os.path.isdir(fullCurFile) and not curFile.startswith('.'):
files += listMediaFiles(fullCurFile, minSize, delete_ignored, media, audio, meta, archives) files += listMediaFiles(fullCurFile, minSize, delete_ignored, media, audio, meta, archives)
elif isMediaFile(curFile, media, audio, meta, archives): elif isMediaFile(curFile, media, audio, meta, archives):