diff --git a/TorrentToMedia.py b/TorrentToMedia.py index cca23a71..64d3b5a2 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -188,8 +188,9 @@ 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") nzbtomedia.resume_torrent(clientAgent, inputHash, inputID, result, inputName) else: - # update download status in our DB - nzbtomedia.update_downloadInfoStatus(inputName, 1) + if clientAgent != 'manual': + # update download status in our DB + nzbtomedia.update_downloadInfoStatus(inputName, 1) # cleanup our processing folders of any misc unwanted files and empty directories nzbtomedia.cleanProcDirs() diff --git a/nzbToMedia.py b/nzbToMedia.py index 04c7a90e..76ecd20b 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -328,8 +328,9 @@ def process(inputDirectory, inputName=None, status=0, clientAgent='manual', down result = -1 if result == 0: - # update download status in our DB - update_downloadInfoStatus(inputName, 1) + if clientAgent != 'manual': + # update download status in our DB + update_downloadInfoStatus(inputName, 1) # cleanup our processing folders of any misc unwanted files and empty directories cleanProcDirs() diff --git a/nzbtomedia/autoProcess/autoProcessTV.py b/nzbtomedia/autoProcess/autoProcessTV.py index b824101c..a0034e50 100644 --- a/nzbtomedia/autoProcess/autoProcessTV.py +++ b/nzbtomedia/autoProcess/autoProcessTV.py @@ -77,16 +77,7 @@ class autoProcessTV: inputName, dirName = convert_to_ascii(inputName, dirName) # Now check if tv files exist in destination. Eventually extraction may be done here if nzbExtractionBy == TorrentToMedia - video = 0 - 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. + if listMediaFiles(dirName): # Check that a video exists. if not, assume failed. flatten(dirName) # to make sure SickBeard can find the video (not in sub-folder) elif clientAgent == "manual": logger.warning("No media files found in directory %s to manually process." % (dirName), section) @@ -94,7 +85,7 @@ class autoProcessTV: else: logger.warning("No media files found in directory %s. Processing this as a failed download" % (dirName), section) status = 1 - failed = True + failed = 1 # configure SB params to pass fork_params['quiet'] = 1 diff --git a/nzbtomedia/nzbToMediaUtil.py b/nzbtomedia/nzbToMediaUtil.py index 82e66b74..fa50f2f3 100644 --- a/nzbtomedia/nzbToMediaUtil.py +++ b/nzbtomedia/nzbToMediaUtil.py @@ -132,7 +132,7 @@ def is_minSize(inputName, minSize): inputSize = getDirSize(os.path.dirname(inputName)) # Ignore files under a certain size - if inputSize < minSize * 1048576: + if inputSize > minSize * 1048576: return True 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) # 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) elif isMediaFile(curFile, media, audio, meta, archives):