mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Added in untracked files for guessit.
Fixed issue #332, we confirm if str or list and take action depending on result.
This commit is contained in:
parent
6a0158d801
commit
0fac36b4fc
42 changed files with 4188 additions and 14 deletions
|
@ -581,19 +581,18 @@ def clean_nzbname(nzbname):
|
|||
nzbname = re.sub("^\[.*\]", "", nzbname)
|
||||
return nzbname.strip()
|
||||
|
||||
def isMediaFile(filename):
|
||||
def isMediaFile(mediafile):
|
||||
fileName, fileExt = os.path.splitext(mediafile)
|
||||
|
||||
# ignore MAC OS's retarded "resource fork" files
|
||||
if filename.startswith('._'):
|
||||
if fileName.startswith('._'):
|
||||
return False
|
||||
|
||||
sepFile = filename.rpartition(".")
|
||||
|
||||
if re.search('extras?$', sepFile[0], re.I):
|
||||
logger.info("Ignoring extras file: %s " % (filename))
|
||||
if re.search('extras?$', fileName, re.I):
|
||||
logger.info("Ignoring extras file: %s " % (mediafile))
|
||||
return False
|
||||
|
||||
if sepFile[2].lower() in [i.replace(".","") for i in
|
||||
(nzbtomedia.MEDIACONTAINER + nzbtomedia.AUDIOCONTAINER + nzbtomedia.COMPRESSEDCONTAINER)]:
|
||||
if fileExt.lower() in nzbtomedia.EXTCONTAINER:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue