예제 #1
0
 def __init__(self, busy_spinner=True):
     self.kodi_db_movies = rpc.get_kodi_library('movie')
     self.kodi_db_tv = rpc.get_kodi_library('tv')
     self.p_dialog = xbmcgui.DialogProgressBG() if busy_spinner else None
     self.auto_update = ADDON.getSettingBool('auto_update')
     self._log = _LibraryLogger()
     self.tv = None
     self.hide_unaired = ADDON.getSettingBool('hide_unaired_episodes')
     # self.debug_logging = ADDON.getSettingBool('debug_logging')
     self.debug_logging = True
예제 #2
0
 def get_dbid(self, kodi_db=None):
     kodi_db = kodi_db or rpc.get_kodi_library('tv')
     self.dbid = kodi_db.get_info(info='dbid',
                                  imdb_id=self.imdb_id,
                                  tmdb_id=self.tmdb_id,
                                  tvdb_id=self.tvdb_id)
     return self.dbid
 def get_kodi_tvchild_details(self, tvshowid, season=None, episode=None, is_season=False):
     if not tvshowid or not season or (not episode and not is_season):
         return
     library = 'season' if is_season else 'episode'
     self.kodi_db_tv[tvshowid] = self.kodi_db_tv.get(tvshowid) or get_kodi_library(library, tvshowid)
     if not self.kodi_db_tv[tvshowid].database:
         return
     dbid = self.kodi_db_tv[tvshowid].get_info('dbid', season=season, episode=episode)
     if not dbid:
         return
     details = get_season_details(dbid) if is_season else get_episode_details(dbid)
     details['infoproperties']['tvshow.dbid'] = tvshowid
     return details
예제 #4
0
 def list_trakt_calendar(self, info, startdate, days, page=None, library=False, **kwargs):
     kodi_db = get_kodi_library('tv') if library else None
     items = self.trakt_api.get_calendar_episodes_list(
         try_int(startdate),
         try_int(days),
         kodi_db=kodi_db,
         user=False if library else True,
         page=page)
     self.kodi_db = kodi_db or self.get_kodi_database('tv')
     self.tmdb_cache_only = False
     self.library = 'video'
     self.container_content = 'episodes'
     self.plugin_category = get_calendar_name(startdate=try_int(startdate), days=try_int(days))
     return items
 def get_kodi_database(self, tmdb_type):
     if ADDON.getSettingBool('local_db'):
         return get_kodi_library(tmdb_type)