Exemple #1
0
    def get_anime_trakt(self, anilist_id, db_correction=False):
        anime = trakt.TRAKTAPI().get_anime(anilist_id, db_correction)

        if not anime:
            anime = self.get_anime_simkl(anilist_id)

        return anime
Exemple #2
0
    def get_anime_init(self, anilist_id):
        show_meta = database.get_show(anilist_id)

        if not show_meta:
            from AniListBrowser import AniListBrowser
            show_meta = AniListBrowser().get_anilist(anilist_id)

        if not show_meta['meta_ids']:
            name = ast.literal_eval(show_meta['kodi_meta'])['name']
            trakt_id = trakt.TRAKTAPI().get_trakt_id(name)

            if not trakt_id:
                return self.get_anime_simkl(anilist_id)

            database.add_meta_ids(anilist_id, str(trakt_id))

        return self.get_anime_trakt(anilist_id)
Exemple #3
0
    def get_episodeList(self, show_id, pass_idx, rescrape=False):
        from ui import control

        episodes = database.get_episode_list(int(show_id))

        if episodes:
            items = trakt.TRAKTAPI()._process_trakt_episodes(
                show_id, '', episodes, '')
        else:
            items = simkl.SIMKLAPI().get_episodes(show_id)

        if rescrape:
            return items

        items = [i for i in items if self.is_aired(i['info'])]

        playlist = control.bulk_draw_items(items)[pass_idx:]

        for i in playlist:
            url = i[0]
            control.playList.add(url=url, listitem=i[1])
Exemple #4
0
 def get_trakt_episodes(self, show_id, season, page=1):
     return trakt.TRAKTAPI().get_trakt_episodes(show_id, season)
Exemple #5
0
 def search_trakt_shows(self, anilist_id):
     shows = trakt.TRAKTAPI().search_trakt_shows(anilist_id)
     return shows