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
|
return sepFile[0] + "." + newExt
|
||||||
|
|
||||||
|
|
||||||
def isBtsyncFile(filename):
|
def isSyncFile(filename):
|
||||||
sepFile = filename.rpartition(".")
|
extension = filename.rpartition(".")[2].lower()
|
||||||
|
if extension == '!sync' or extension == 'lftp-pget-status':
|
||||||
if sepFile[2].lower() == '!sync':
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
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)
|
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
|
# Don't post process if files are still being synced
|
||||||
if btsyncFiles:
|
if SyncFiles:
|
||||||
returnStr += logHelper(u"Found .!sync files, skipping post processing", logger.ERROR)
|
returnStr += logHelper(u"Found temporary sync files, skipping post processing", logger.ERROR)
|
||||||
return returnStr
|
return returnStr
|
||||||
|
|
||||||
returnStr += logHelper(u"PostProcessing Path: " + path, logger.DEBUG)
|
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):
|
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
|
# Don't post process if files are still being synced
|
||||||
if btsyncFiles:
|
if SyncFiles:
|
||||||
returnStr += logHelper(u"Found .!sync files, skipping post processing", logger.ERROR)
|
returnStr += logHelper(u"Found temporary sync files, skipping post processing", logger.ERROR)
|
||||||
return returnStr
|
return returnStr
|
||||||
|
|
||||||
rarFiles = filter(helpers.isRarFile, fileList)
|
rarFiles = filter(helpers.isRarFile, fileList)
|
||||||
|
Loading…
Reference in New Issue
Block a user