mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-31 03:50:06 -07:00
added list of sample ids. Fixes #256
This commit is contained in:
parent
fff690de79
commit
4e602956f6
6 changed files with 40 additions and 11 deletions
|
@ -100,6 +100,10 @@ def processEpisode(dirName, nzbName=None, failed=False, inputCategory=None):
|
|||
wait_for = int(config.get(section, "wait_for"))
|
||||
except (ConfigParser.NoOptionError, ValueError):
|
||||
wait_for = 5
|
||||
try:
|
||||
SampleIDs = (config.get("Extensions", "SampleIDs")).split(',')
|
||||
except (ConfigParser.NoOptionError, ValueError):
|
||||
SampleIDs = ['sample','-s.']
|
||||
|
||||
TimeOut = 60 * int(wait_for) # SickBeard needs to complete all moving and renaming before returning the log sequence via url.
|
||||
socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout.
|
||||
|
@ -126,7 +130,7 @@ def processEpisode(dirName, nzbName=None, failed=False, inputCategory=None):
|
|||
filePath = os.path.join(dirpath, file)
|
||||
fileExtension = os.path.splitext(file)[1]
|
||||
if fileExtension in mediaContainer: # If the file is a video file
|
||||
if is_sample(filePath, nzbName, minSampleSize):
|
||||
if is_sample(filePath, nzbName, minSampleSize, SampleIDs):
|
||||
Logger.debug("Removing sample file: %s", filePath)
|
||||
os.unlink(filePath) # remove samples
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue