Ejemplo n.º 1
0
	def open_tvshow_info(self, prev_window=None, tmdb_id=None, dbid=None, tvdb_id=None, imdb_id=None, name=None):
		Utils.show_busy()
		dbid = int(dbid) if dbid and int(dbid) > 0 else None
		from resources.lib.TheMovieDB import get_show_tmdb_id, search_media, play_tv_trailer
		from resources.lib.DialogTVShowInfo import get_tvshow_window
		from resources.lib.local_db import get_imdb_id_from_db
		if tmdb_id:
			pass
		elif tvdb_id:
			tmdb_id = get_show_tmdb_id(tvdb_id)
		elif imdb_id:
			tmdb_id = get_show_tmdb_id(tvdb_id=imdb_id, source='imdb_id')
		elif dbid:
			tvdb_id = get_imdb_id_from_db(media_type='tvshow', dbid=dbid)
			if tvdb_id:
				tmdb_id = get_show_tmdb_id(tvdb_id)
		elif name:
			tmdb_id = search_media(media_name=name, year='', media_type='tv')
		tvshow_class = get_tvshow_window(DialogXML)
		if Utils.NETFLIX_VIEW == 'true':
			dialog = tvshow_class(u'script.extendedinfo-DialogVideoInfo-Netflix.xml', Utils.ADDON_PATH, tmdb_id=tmdb_id, dbid=dbid)
			if Utils.AUTOPLAY_TRAILER == 'true' and not xbmc.getCondVisibility('VideoPlayer.IsFullscreen') and not xbmc.Player().isPlayingAudio():
				play_tv_trailer(tmdb_id)
		else:
			if Utils.SKIN_DIR == 'skin.estuary':
				dialog = tvshow_class(u'script.extendedinfo-DialogVideoInfo-Estuary.xml', Utils.ADDON_PATH, tmdb_id=tmdb_id, dbid=dbid)
			elif Utils.SKIN_DIR == 'skin.aura' or 'skin.auramod':
				dialog = tvshow_class(u'script.extendedinfo-DialogVideoInfo-Aura.xml', Utils.ADDON_PATH, tmdb_id=tmdb_id, dbid=dbid)
			else:
				dialog = tvshow_class(u'script.extendedinfo-DialogVideoInfo.xml', Utils.ADDON_PATH, tmdb_id=tmdb_id, dbid=dbid)
		Utils.hide_busy()
		self.open_dialog(dialog, prev_window)
Ejemplo n.º 2
0
 def open_episode_info(self,
                       prev_window=None,
                       tvshow_id=None,
                       tvdb_id=None,
                       season=None,
                       episode=None,
                       tvshow=None,
                       dbid=None):
     Utils.show_busy()
     from resources.lib.TheMovieDB import get_tmdb_data, get_show_tmdb_id
     from resources.lib.DialogEpisodeInfo import get_episode_window
     if not tvshow_id:
         if tvdb_id:
             tvshow_id = get_show_tmdb_id(tvdb_id)
         else:
             response = get_tmdb_data(
                 'search/tv?query=%s&language=%s&' %
                 (Utils.url_quote(tvshow),
                  xbmcaddon.Addon().getSetting('LanguageID')), 30)
             if response['results']:
                 tvshow_id = str(response['results'][0]['id'])
             else:
                 tvshow = re.sub('\(.*?\)', '', tvshow)
                 response = get_tmdb_data(
                     'search/tv?query=%s&language=%s&' %
                     (Utils.url_quote(tvshow),
                      xbmcaddon.Addon().getSetting('LanguageID')), 30)
                 if response['results']:
                     tvshow_id = str(response['results'][0]['id'])
     ep_class = get_episode_window(DialogXML)
     if Utils.NETFLIX_VIEW == 'true':
         dialog = ep_class(
             u'script.extendedinfo-DialogVideoInfo-Netflix.xml',
             Utils.ADDON_PATH,
             tvshow_id=tvshow_id,
             season=season,
             episode=episode,
             dbid=dbid)
     else:
         if Utils.SKIN_DIR == 'skin.estuary':
             dialog = ep_class(
                 u'script.extendedinfo-DialogVideoInfo-Estuary.xml',
                 Utils.ADDON_PATH,
                 tvshow_id=tvshow_id,
                 season=season,
                 episode=episode,
                 dbid=dbid)
         elif Utils.SKIN_DIR == 'skin.aura' or 'skin.auramod':
             dialog = ep_class(
                 u'script.extendedinfo-DialogVideoInfo-Aura.xml',
                 Utils.ADDON_PATH,
                 tvshow_id=tvshow_id,
                 season=season,
                 episode=episode,
                 dbid=dbid)
         else:
             dialog = ep_class(u'script.extendedinfo-DialogVideoInfo.xml',
                               Utils.ADDON_PATH,
                               tvshow_id=tvshow_id,
                               season=season,
                               episode=episode,
                               dbid=dbid)
     Utils.hide_busy()
     self.open_dialog(dialog, prev_window)