Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed anidb refinement for sonarr specials #2590

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions bazarr/subtitles/refiners/anidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,22 @@ def get_series_id(self, mappings, tvdb_series_season, tvdb_series_id, episode):
for index, anime_info in enumerate(animes):
anime, episode_offset = anime_info

mapping_list = anime.find('mapping-list')

# Handle mapping list for Specials
if mapping_list:
for mapping in mapping_list.findall("mapping"):
# Mapping values are usually like ;1-1;2-1;3-1;
for episode_ref in mapping.text.split(';'):
if not episode_ref:
continue

anidb_episode, tvdb_episode = map(int, episode_ref.split('-'))
if tvdb_episode == episode:
anidb_id = int(anime.attrib.get('anidbid'))

return anidb_id, anidb_episode

if episode > episode_offset:
anidb_id = int(anime.attrib.get('anidbid'))
offset = episode_offset
Expand Down