Skip to content

Commit b3c798c

Browse files
authored
Fixed assrt provider skipping season pack subtitles for episode searches
1 parent 27dc8a5 commit b3c798c

File tree

1 file changed

+11
-0
lines changed
  • custom_libs/subliminal_patch/providers

1 file changed

+11
-0
lines changed

custom_libs/subliminal_patch/providers/assrt.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ def get_matches(self, video):
149149
if cleaned != self.video_name:
150150
fallback_matches = guess_matches(video, guessit(cleaned))
151151
self.matches |= fallback_matches
152+
# Season pack handling: assrt often returns season packs (e.g.
153+
# "Rick.and.Morty.S06.1080p.BluRay.x264-STORiES") when searching for a
154+
# specific episode. guessit won't extract an episode number from such a
155+
# name, so the subtitle gets skipped by Bazarr's "doesn't match our
156+
# series/episode" filter even though _get_detail will pick the correct
157+
# episode file from the pack's filelist at download time.
158+
if (isinstance(video, Episode) and "series" in self.matches
159+
and "season" in self.matches and "episode" not in self.matches):
160+
guess = guessit(self.video_name) if self.video_name else {}
161+
if "episode" not in guess:
162+
self.matches.add("episode")
152163
return self.matches
153164

154165

0 commit comments

Comments
 (0)