mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
Fixes issue #332 with is_sample problem.
This commit is contained in:
parent
26ccefbae6
commit
2391f4a5de
4 changed files with 28 additions and 28 deletions
|
@ -428,14 +428,13 @@ def get_dirnames(section, subsections=None):
|
|||
return list(set(dirNames))
|
||||
|
||||
|
||||
def delete(dirName):
|
||||
def rmDir(dirName):
|
||||
logger.info("Deleting %s" % (dirName))
|
||||
try:
|
||||
shutil.rmtree(dirName, True)
|
||||
except:
|
||||
logger.error("Unable to delete folder %s" % (dirName))
|
||||
|
||||
|
||||
def cleanup_directories(inputCategory, processCategories, result, directory):
|
||||
if inputCategory in processCategories and result == 0 and os.path.isdir(directory):
|
||||
num_files_new = int(0)
|
||||
|
@ -612,6 +611,10 @@ def listMediaFiles(path, ignoreSample=True):
|
|||
elif isMediaFile(curFile):
|
||||
# Optionally ignore sample files
|
||||
if ignoreSample and is_sample(fullCurFile, nzbtomedia.MINSAMPLESIZE, nzbtomedia.SAMPLEIDS):
|
||||
try:
|
||||
os.unlink(fullCurFile)
|
||||
logger.debug('Sample file %s has been removed.' % (curFile))
|
||||
except:continue
|
||||
continue
|
||||
|
||||
files.append(fullCurFile)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue