def refresh_apis():
    """
    Refresh common API tokens
    :return: None
    :rtype: None
    """
    TraktAPI().try_refresh_token()
    real_debrid.RealDebrid().try_refresh_token()
    TVDBAPI().try_refresh_token()
Beispiel #2
0
 def tvdbShowListWorker(self, trakt_object):
     item = database.get(TVDBAPI().seriesIDToListItem, 24, copy.deepcopy(trakt_object))
     self.itemList.append(item)
Beispiel #3
0
 def tvdbEpisodeWorker(self, trakt_object, showArgs):
     item = database.get(TVDBAPI().episodeIDToListItem, 24, copy.deepcopy(trakt_object), copy.deepcopy(showArgs))
     self.itemList.append(item)
Beispiel #4
0
 def tvdbSeasonListWorker(self, trakt_object, showArgs):
     season = database.get(TVDBAPI().seasonIDToListItem, 24, copy.deepcopy(trakt_object), copy.deepcopy(showArgs))
     self.itemList.append(season)
    def __init__(
        self,
        tmdb_api=None,
        tvdb_api=None,
        fanarttv_api=None,
        trakt_api=None,
        omdb_api=None,
    ):
        self.tmdb_api = tmdb_api if tmdb_api else TMDBAPI()
        self.tvdb_api = tvdb_api if tvdb_api else TVDBAPI()
        self.fanarttv_api = fanarttv_api if fanarttv_api else FanartTv()
        self.trakt_api = trakt_api if trakt_api else TraktAPI()
        self.omdb_api = omdb_api if omdb_api else OmdbApi()

        self.lang_code = g.get_language_code()
        self.lang_full_code = g.get_language_code(True)
        self.lang_region_code = self.lang_full_code.split("-")[:1]
        self.allowed_artwork_languages = {None, "en", self.lang_code}
        self.movies_poster_limit = g.get_int_setting("movies.poster_limit", 1)
        self.movies_fanart_limit = g.get_int_setting("movies.fanart_limit", 1)
        self.movies_keyart_limit = g.get_int_setting("movies.keyart_limit", 1)
        self.movies_characterart_limit = g.get_int_setting(
            "movies.characterart_limit", 1)
        self.movies_banner = g.get_bool_setting("movies.banner", "true")
        self.movies_clearlogo = g.get_bool_setting("movies.clearlogo", "true")
        self.movies_landscape = g.get_bool_setting("movies.landscape", "true")
        self.movies_clearart = g.get_bool_setting("movies.clearart", "true")
        self.movies_discart = g.get_bool_setting("movies.discart", "true")

        self.tvshows_poster_limit = g.get_int_setting("tvshows.poster_limit",
                                                      1)
        self.tvshows_fanart_limit = g.get_int_setting("tvshows.fanart_limit",
                                                      1)
        self.tvshows_keyart_limit = g.get_int_setting("tvshows.keyart_limit",
                                                      1)
        self.tvshows_characterart_limit = g.get_int_setting(
            "tvshows.characterart_limit", 1)
        self.tvshows_banner = g.get_bool_setting("tvshows.banner", "true")
        self.tvshows_clearlogo = g.get_bool_setting("tvshows.clearlogo",
                                                    "true")
        self.tvshows_landscape = g.get_bool_setting("tvshows.landscape",
                                                    "true")
        self.tvshows_clearart = g.get_bool_setting("tvshows.clearart", "true")
        self.season_poster = g.get_bool_setting("season.poster", "true")
        self.season_banner = g.get_bool_setting("season.banner", "true")
        self.season_landscape = g.get_bool_setting("season.landscape", "true")
        self.season_fanart = g.get_bool_setting("season.fanart", "true")
        self.episode_fanart = g.get_bool_setting("episode.fanart", "true")
        self.tvshows_preferred_art_source = g.get_int_setting(
            "tvshows.preferedsource", 1)
        self.movies_preferred_art_source = g.get_int_setting(
            "movies.preferedsource", 1)
        self.metadata_location = g.get_int_setting("general.metalocation", 1)
        self.preferred_artwork_size = g.get_int_setting(
            "artwork.preferredsize", 1)
        self.show_original_title = g.get_bool_setting(
            "general.meta.showoriginaltitle", False)

        self.genres = {
            "action": g.get_language_string(30534),
            "adventure": g.get_language_string(30535),
            "animation": g.get_language_string(30536),
            "anime": g.get_language_string(30537),
            "biography": g.get_language_string(30538),
            "children": g.get_language_string(30539),
            "comedy": g.get_language_string(30540),
            "crime": g.get_language_string(30541),
            "documentary": g.get_language_string(30542),
            "drama": g.get_language_string(30543),
            "family": g.get_language_string(30544),
            "fantasy": g.get_language_string(30545),
            "game-show": g.get_language_string(30546),
            "history": g.get_language_string(30547),
            "holiday": g.get_language_string(30548),
            "home-and-garden": g.get_language_string(30549),
            "horror": g.get_language_string(30550),
            "mini-series": g.get_language_string(30551),
            "music": g.get_language_string(30552),
            "musical": g.get_language_string(30553),
            "mystery": g.get_language_string(30554),
            "news": g.get_language_string(30555),
            "none": g.get_language_string(30556),
            "reality": g.get_language_string(30557),
            "romance": g.get_language_string(30558),
            "science-fiction": g.get_language_string(30559),
            "sci-fi": g.get_language_string(30559),
            "short": g.get_language_string(30560),
            "soap": g.get_language_string(30561),
            "special-interest": g.get_language_string(30562),
            "sporting-event": g.get_language_string(30563),
            "superhero": g.get_language_string(30564),
            "suspense": g.get_language_string(30565),
            "talk-show": g.get_language_string(30566),
            "talkshow": g.get_language_string(30566),
            "thriller": g.get_language_string(30567),
            "tv-movie": g.get_language_string(30568),
            "war": g.get_language_string(30569),
            "western": g.get_language_string(30570),
        }

        self.meta_hash = tools.md5_hash([
            self.lang_code,
            self.movies_poster_limit,
            self.movies_fanart_limit,
            self.movies_keyart_limit,
            self.movies_characterart_limit,
            self.movies_banner,
            self.movies_clearlogo,
            self.movies_landscape,
            self.movies_clearart,
            self.movies_discart,
            self.tvshows_poster_limit,
            self.tvshows_fanart_limit,
            self.tvshows_keyart_limit,
            self.tvshows_characterart_limit,
            self.tvshows_banner,
            self.tvshows_clearlogo,
            self.tvshows_landscape,
            self.tvshows_clearart,
            self.season_poster,
            self.season_banner,
            self.season_landscape,
            self.season_fanart,
            self.episode_fanart,
            self.tvshows_preferred_art_source,
            self.tvshows_preferred_art_source,
            self.metadata_location,
            self.fanarttv_api.fanart_support,
            self.preferred_artwork_size,
            self.show_original_title,
        ])