mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Halt post processing if lftp temporary files are detected
This commit is contained in:
parent
90146d33fa
commit
72b0b04045
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user