diff --git a/modules/Profile.py b/modules/Profile.py index 0ac31431d..009ae5805 100755 --- a/modules/Profile.py +++ b/modules/Profile.py @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, Callable, Optional from re import compile as re_compile, match, IGNORECASE @@ -173,13 +173,18 @@ def convert_extras(self, ) - def get_season_text(self, episode_info: EpisodeInfo) -> str: + def get_season_text(self, + episode_info: EpisodeInfo, + default: Optional[Callable[[EpisodeInfo], str]] = None, + ) -> str: """ Gets the season text for the given season number, after applying this profile's rules about season text. Args: episode_info: Episode info to get the season text of. + default: Default function to call for getting season text + of if no customizations are present. Returns: The season text for the given entry as defined by this @@ -193,11 +198,11 @@ def get_season_text(self, episode_info: EpisodeInfo) -> str: # Generic season titles are Specials and Season {n} if not self.__use_custom_seasons: return self.__episode_map.get_generic_season_title( - episode_info=episode_info + episode_info=episode_info, default=default, ) # Custom season title, query EpisodeMap for title - return self.__episode_map.get_season_title(episode_info) + return self.__episode_map.get_season_title(episode_info,default=default) def get_episode_text(self, episode: 'Episode') -> str: diff --git a/modules/TitleCard.py b/modules/TitleCard.py index 2225db59a..704e52e9e 100755 --- a/modules/TitleCard.py +++ b/modules/TitleCard.py @@ -131,7 +131,10 @@ def __init__(self, 'source_file': episode.source, 'card_file': episode.destination, 'title_text': self.converted_title, - 'season_text': profile.get_season_text(self.episode.episode_info), + 'season_text': profile.get_season_text( + self.episode.episode_info, + getattr(self.episode.card_class, 'SEASON_TEXT_FORMATTER', None), + ), 'episode_text': profile.get_episode_text(self.episode), 'hide_season_text': profile.hide_season_title, 'blur': episode.blur, diff --git a/modules/ref/version b/modules/ref/version index f2e606dbb..ae98973fb 100755 --- a/modules/ref/version +++ b/modules/ref/version @@ -1 +1 @@ -v1.14.4-develop24 \ No newline at end of file +v1.14.4-develop25 \ No newline at end of file