Merge branch 'feature/AddIgnorePlexExtras' into dev

This commit is contained in:
JackDandy 2023-10-25 22:55:56 +01:00
commit d42232040f
2 changed files with 9 additions and 3 deletions

View file

@ -13,6 +13,7 @@
* Update thefuzz 0.19.0 (c2cd4f4) to 0.21.0 (0b49e4a) * Update thefuzz 0.19.0 (c2cd4f4) to 0.21.0 (0b49e4a)
* Update urllib3 2.0.5 (d9f85a7) to 2.0.7 (56f01e0) * Update urllib3 2.0.5 (d9f85a7) to 2.0.7 (56f01e0)
* Add support for Brotli compression * Add support for Brotli compression
* Add ignore Plex extras
### 3.30.4 (2023-10-12 11:50:00 UTC) ### 3.30.4 (2023-10-12 11:50:00 UTC)

View file

@ -158,7 +158,9 @@ def has_media_ext(filename):
return False return False
sep_file = filename.rpartition('.') sep_file = filename.rpartition('.')
return (None is re.search('extras?$', sep_file[0], re.I)) and (sep_file[2].lower() in mediaExtensions) return (None is re.search(
'(?:extras|-Behind\sThe\sScenes|-Deleted\sScenes|-Featurettes|-Interviews|-Scenes|-Shorts|-Trailers|-Other)?$',
sep_file[0], re.I)) and (sep_file[2].lower() in mediaExtensions)
def has_image_ext(filename): def has_image_ext(filename):
@ -352,8 +354,11 @@ def list_media_files(path):
if [direntry for direntry in scantree(path, include=[r'\.sickgearignore'], filter_kind=False, recurse=False)]: if [direntry for direntry in scantree(path, include=[r'\.sickgearignore'], filter_kind=False, recurse=False)]:
logger.debug('Skipping folder "%s" because it contains ".sickgearignore"' % path) logger.debug('Skipping folder "%s" because it contains ".sickgearignore"' % path)
else: else:
result = [direntry.path for direntry in scantree(path, exclude=['Extras'], filter_kind=False, result = [direntry.path for direntry in scantree(path, exclude=[
exclude_folders_with_files=['.sickgearignore']) 'Extras',
'Behind The Scenes', 'Deleted Scenes', 'Featurettes',
'Interviews', 'Scenes', 'Shorts', 'Trailers', 'Other'
], filter_kind=False, exclude_folders_with_files=['.sickgearignore'])
if has_media_ext(direntry.name)] if has_media_ext(direntry.name)]
return result return result