mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Merge pull request #707 from adam111316/sync_files
Halt post processing if lftp temporary files are detected
This commit is contained in:
commit
9cffbfe6ee
2 changed files with 11 additions and 12 deletions
|
@ -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 a new issue