Skip to content

Commit

Permalink
no log: Remove missleading anime logs
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-oki committed Aug 10, 2024
1 parent baae406 commit 8c68fba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions bazarr/subtitles/refiners/anidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ def mark_as_throttled():

def refine_from_anidb(path, video):
if not isinstance(video, Episode) or not video.series_tvdb_id:
logger.debug(f'Video is not an Anime TV series, skipping refinement for {video}')

return

if refined_providers.intersection(settings.general.enabled_providers) and video.series_anidb_id is None:
Expand Down
6 changes: 4 additions & 2 deletions bazarr/subtitles/refiners/anilist.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
logger = logging.getLogger(__name__)
refined_providers = {'jimaku'}


class AniListClient(object):
def __init__(self, session=None, timeout=10):
self.session = session or requests.Session()
Expand Down Expand Up @@ -47,16 +48,17 @@ def get_series_id(self, candidate_id_name, candidate_id_value):
logger.debug(f"Could not find corresponding AniList ID with '{mapped_tag}': {candidate_id_value}")
return None


def refine_from_anilist(path, video):
# Safety checks
if isinstance(video, Episode):
if not video.series_anidb_id:
logger.error(f"Will not refine '{video.series}' as it does not have an AniDB ID.")
return

if refined_providers.intersection(settings.general.enabled_providers) and video.anilist_id is None:
refine_anilist_ids(video)


def refine_anilist_ids(video):
anilist_client = AniListClient()

Expand All @@ -74,4 +76,4 @@ def refine_anilist_ids(video):
if not anilist_id:
return video

video.anilist_id = anilist_id
video.anilist_id = anilist_id

0 comments on commit 8c68fba

Please sign in to comment.