mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-03 05:25:28 +00:00
Fixed anidb refinement for sonarr specials (#2590)
This commit is contained in:
parent
b304f6f1ef
commit
2658638f38
1 changed files with 16 additions and 0 deletions
|
@ -84,6 +84,22 @@ class AniDBClient(object):
|
||||||
for index, anime_info in enumerate(animes):
|
for index, anime_info in enumerate(animes):
|
||||||
anime, episode_offset = anime_info
|
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:
|
if episode > episode_offset:
|
||||||
anidb_id = int(anime.attrib.get('anidbid'))
|
anidb_id = int(anime.attrib.get('anidbid'))
|
||||||
offset = episode_offset
|
offset = episode_offset
|
||||||
|
|
Loading…
Reference in a new issue