1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-13 03:22:22 -05:00

Halt post processing if lftp temporary files are detected

This commit is contained in:
Adam 2014-08-11 18:29:28 +08:00
parent 90146d33fa
commit 72b0b04045
2 changed files with 11 additions and 12 deletions

View File

@ -136,10 +136,9 @@ def replaceExtension(filename, newExt):
return sepFile[0] + "." + newExt
def isBtsyncFile(filename):
sepFile = filename.rpartition(".")
if sepFile[2].lower() == '!sync':
def isSyncFile(filename):
extension = filename.rpartition(".")[2].lower()
if extension == '!sync' or extension == 'lftp-pget-status':
return True
else:
return False

View File

@ -138,11 +138,11 @@ def processDir(dirName, nzbName=None, process_method=None, force=False, is_prior
path, dirs, files = get_path_dir_files(dirName, nzbName, type)
btsyncFiles = filter(helpers.isBtsyncFile, files)
SyncFiles = filter(helpers.isSyncFile, files)
# Don't post process if files are still being synced from btsync
if btsyncFiles:
returnStr += logHelper(u"Found .!sync files, skipping post processing", logger.ERROR)
# Don't post process if files are still being synced
if SyncFiles:
returnStr += logHelper(u"Found temporary sync files, skipping post processing", logger.ERROR)
return returnStr
returnStr += logHelper(u"PostProcessing Path: " + path, logger.DEBUG)
@ -186,11 +186,11 @@ def processDir(dirName, nzbName=None, process_method=None, force=False, is_prior
for processPath, processDir, fileList in ek.ek(os.walk, ek.ek(os.path.join, path, dir), topdown=False):
btsyncFiles = filter(helpers.isBtsyncFile, fileList)
SyncFiles = filter(helpers.isSyncFile, fileList)
# Don't post process if files are still being synced from btsync
if btsyncFiles:
returnStr += logHelper(u"Found .!sync files, skipping post processing", logger.ERROR)
# Don't post process if files are still being synced
if SyncFiles:
returnStr += logHelper(u"Found temporary sync files, skipping post processing", logger.ERROR)
return returnStr
rarFiles = filter(helpers.isRarFile, fileList)