diff options
author | Vitiko <[email protected]> | 2022-11-19 16:38:37 -0400 |
---|---|---|
committer | Vitiko <[email protected]> | 2022-11-19 16:38:37 -0400 |
commit | 923bcb438298beef7cf4e620e6611a07c51ebcbc (patch) | |
tree | 6080b97bd0908e3c725648285d40c6f72c0faaf8 /libs | |
parent | 118eb09db03f54cd371983653530d2c2c26da83e (diff) | |
download | bazarr-923bcb438298beef7cf4e620e6611a07c51ebcbc.tar.gz bazarr-923bcb438298beef7cf4e620e6611a07c51ebcbc.zip |
Add 'other' attribute to Video classv1.1.3-beta.21
Diffstat (limited to 'libs')
-rw-r--r-- | libs/subliminal/video.py | 4 | ||||
-rw-r--r-- | libs/subliminal_patch/subtitle.py | 2 | ||||
-rw-r--r-- | libs/subliminal_patch/video.py | 37 |
3 files changed, 34 insertions, 9 deletions
diff --git a/libs/subliminal/video.py b/libs/subliminal/video.py index 546861249..1264d0b84 100644 --- a/libs/subliminal/video.py +++ b/libs/subliminal/video.py @@ -183,7 +183,7 @@ class Episode(Video): year=guess.get('year'), source=guess.get('source'), original_series='year' not in guess, release_group=guess.get('release_group'), resolution=guess.get('screen_size'), video_codec=guess.get('video_codec'), audio_codec=guess.get('audio_codec'), - streaming_service=guess.get("streaming_service"), + streaming_service=guess.get("streaming_service"), other=guess.get("other"), edition=guess.get("edition", guess.get("alternative_title"))) @classmethod @@ -233,7 +233,7 @@ class Movie(Video): alternative_titles.append(u"%s %s" % (guess['title'], guess['alternative_title'])) return cls(name, guess.get('title', 'Unknown Title'), source=guess.get('source'), release_group=guess.get('release_group'), - resolution=guess.get('screen_size'), video_codec=guess.get('video_codec'), + resolution=guess.get('screen_size'), video_codec=guess.get('video_codec'), other=guess.get("other"), audio_codec=guess.get('audio_codec'), year=guess.get('year'), alternative_titles=alternative_titles, streaming_service=guess.get("streaming_service"), edition=guess.get("edition")) diff --git a/libs/subliminal_patch/subtitle.py b/libs/subliminal_patch/subtitle.py index 158d399f5..e3f49e852 100644 --- a/libs/subliminal_patch/subtitle.py +++ b/libs/subliminal_patch/subtitle.py @@ -548,7 +548,7 @@ def guess_matches(video, guess, partial=False): if _has_match(video, guess, key): matches.add(key) - for key in ("streaming_service", "edition"): + for key in ("streaming_service", "edition", "other"): if _check_optional(video, guess, key): matches.add(key) diff --git a/libs/subliminal_patch/video.py b/libs/subliminal_patch/video.py index b58c452be..244e5ea36 100644 --- a/libs/subliminal_patch/video.py +++ b/libs/subliminal_patch/video.py @@ -15,12 +15,36 @@ class Video(Video_): audio_languages = None external_subtitle_languages = None - def __init__(self, name, source=None, release_group=None, resolution=None, video_codec=None, audio_codec=None, - imdb_id=None, hashes=None, size=None, subtitle_languages=None, audio_languages=None, - streaming_service=None, edition=None): - super(Video, self).__init__(name, source=source, release_group=release_group, resolution=resolution, - video_codec=video_codec, audio_codec=audio_codec, imdb_id=imdb_id, hashes=hashes, - size=size, subtitle_languages=subtitle_languages) + def __init__( + self, + name, + source=None, + release_group=None, + resolution=None, + video_codec=None, + audio_codec=None, + imdb_id=None, + hashes=None, + size=None, + subtitle_languages=None, + audio_languages=None, + streaming_service=None, + edition=None, + other=None, + **kwargs + ): + super(Video, self).__init__( + name, + source=source, + release_group=release_group, + resolution=resolution, + video_codec=video_codec, + audio_codec=audio_codec, + imdb_id=imdb_id, + hashes=hashes, + size=size, + subtitle_languages=subtitle_languages, + ) self.original_name = os.path.basename(name) self.plexapi_metadata = {} self.hints = {} @@ -29,3 +53,4 @@ class Video(Video_): self.streaming_service = streaming_service self.edition = edition self.original_path = name + self.other = other |