mirror of
https://github.com/jellyfin/jellycon.git
synced 2025-02-22 23:03:06 +00:00
Remove commented blocks of code
This commit is contained in:
parent
1949e8a9b7
commit
8ece4ae651
@ -70,9 +70,6 @@ class ActionMenu(xbmcgui.WindowXMLDialog):
|
||||
self.listControl.addItems(self.action_items)
|
||||
self.setFocus(self.listControl)
|
||||
|
||||
# bg_image = self.getControl(3010)
|
||||
# bg_image.setHeight(50 * len(self.action_items) + 20)
|
||||
|
||||
def onFocus(self, control_id):
|
||||
pass
|
||||
|
||||
|
@ -41,8 +41,6 @@ class BitrateDialog(xbmcgui.WindowXMLDialog):
|
||||
|
||||
def onAction(self, action):
|
||||
|
||||
# log.debug("onAction: onAction: {0} {1}", action.getId(), self.slider_control.getInt())
|
||||
|
||||
bitrate_label_string = str(self.slider_control.getInt()) + " Kbs"
|
||||
self.bitrate_label.setLabel(bitrate_label_string)
|
||||
|
||||
|
@ -154,7 +154,6 @@ class CacheArtwork(threading.Thread):
|
||||
url = url.replace("image://", "")
|
||||
url = url[0:-1]
|
||||
if url.find("/") > -1 and url not in jellyfin_texture_urls or url.find("localhost:24276") > -1:
|
||||
# log.debug("adding unused texture url: {0}", url)
|
||||
unused_texture_ids.add(texture["textureid"])
|
||||
|
||||
total = len(unused_texture_ids)
|
||||
@ -243,7 +242,6 @@ class CacheArtwork(threading.Thread):
|
||||
|
||||
texture_urls = set()
|
||||
|
||||
# image_types = ["thumb", "poster", "banner", "clearlogo", "tvshow.poster", "tvshow.banner", "tvshow.landscape"]
|
||||
for item in results:
|
||||
art = get_art(item, server)
|
||||
for art_type in art:
|
||||
@ -306,7 +304,6 @@ class CacheArtwork(threading.Thread):
|
||||
|
||||
missing_texture_urls = set()
|
||||
|
||||
# image_types = ["thumb", "poster", "banner", "clearlogo", "tvshow.poster", "tvshow.banner", "tvshow.landscape"]
|
||||
for image_url in jellyfin_texture_urls:
|
||||
if image_url not in texture_urls and not image_url.endswith("&Tag=") and len(image_url) > 0:
|
||||
missing_texture_urls.add(image_url)
|
||||
@ -329,7 +326,6 @@ class CacheArtwork(threading.Thread):
|
||||
|
||||
count_done = 0
|
||||
for index, get_url in enumerate(missing_texture_urls, 1):
|
||||
# log.debug("texture_url: {0}", get_url)
|
||||
url = double_urlencode(get_url)
|
||||
kodi_texture_url = ("/image/image://%s" % url)
|
||||
log.debug("kodi_texture_url: {0}".format(kodi_texture_url))
|
||||
@ -345,8 +341,6 @@ class CacheArtwork(threading.Thread):
|
||||
count_done += 1
|
||||
log.debug("Get Image Result: {0}".format(data.status_code))
|
||||
|
||||
# if progress.iscanceled():
|
||||
# if "iscanceled" in dir(progress) and progress.iscanceled():
|
||||
if isinstance(progress, xbmcgui.DialogProgress) and progress.iscanceled():
|
||||
break
|
||||
|
||||
|
@ -173,11 +173,6 @@ def get_content(url, params):
|
||||
else:
|
||||
log.debug("No view id for view type:{0}".format(view_key))
|
||||
|
||||
# send display items event
|
||||
# display_items_notification = {"view_type": view_type}
|
||||
# log.debug("Sending display_items with data {0}", display_items_notification)
|
||||
# send_event_notification("display_items", display_items_notification)
|
||||
|
||||
if progress is not None:
|
||||
progress.update(100, string_load(30125))
|
||||
progress.close()
|
||||
|
@ -157,7 +157,6 @@ class DownloadUtils:
|
||||
|
||||
addon_settings = xbmcaddon.Addon()
|
||||
|
||||
# ["hevc", "h265", "h264", "mpeg4", "msmpeg4v3", "mpeg2video", "vc1"]
|
||||
filtered_codecs = []
|
||||
if addon_settings.getSetting("force_transcode_h265") == "true":
|
||||
filtered_codecs.append("hevc")
|
||||
@ -358,7 +357,6 @@ class DownloadUtils:
|
||||
item_id = item["Id"]
|
||||
item_type = item["Type"]
|
||||
image_tags = item["ImageTags"]
|
||||
# bg_item_tags = item["ParentBackdropImageTags"]
|
||||
|
||||
# All the image tags
|
||||
for tag_name in image_tags:
|
||||
@ -386,7 +384,6 @@ class DownloadUtils:
|
||||
item_id = data["SeriesId"]
|
||||
|
||||
image_tag = ""
|
||||
# "e3ab56fe27d389446754d0fb04910a34" # a place holder tag, needs to be in this format
|
||||
|
||||
# for episodes always use the parent BG
|
||||
if item_type == "Episode" and art_type == "Backdrop":
|
||||
@ -403,14 +400,12 @@ class DownloadUtils:
|
||||
bg_tags = data.get("BackdropImageTags", [])
|
||||
if bg_tags:
|
||||
image_tag = bg_tags[index]
|
||||
# log.debug("Background Image Tag: {0}", imageTag)
|
||||
elif parent is False:
|
||||
image_tags = data.get("ImageTags", [])
|
||||
if image_tags:
|
||||
image_tag_type = image_tags.get(art_type)
|
||||
if image_tag_type:
|
||||
image_tag = image_tag_type
|
||||
# log.debug("Image Tag: {0}", imageTag)
|
||||
elif parent is True:
|
||||
if (item_type == "Episode" or item_type == "Season") and art_type == 'Primary':
|
||||
tag_name = 'SeriesPrimaryImageTag'
|
||||
@ -423,11 +418,9 @@ class DownloadUtils:
|
||||
if parent_image_id is not None and parent_image_tag is not None:
|
||||
item_id = parent_image_id
|
||||
image_tag = parent_image_tag
|
||||
# log.debug("Parent Image Tag: {0}", imageTag)
|
||||
|
||||
# ParentTag not passed for Banner and Art
|
||||
if not image_tag and not ((art_type == 'Banner' or art_type == 'Art') and parent is True):
|
||||
# log.debug("No Image Tag for request:{0} item:{1} parent:{2}", art_type, item_type, parent)
|
||||
return ""
|
||||
|
||||
artwork = "%s/Items/%s/Images/%s/%s?Format=original&Tag=%s" % (server, item_id, art_type, index, image_tag)
|
||||
@ -435,19 +428,9 @@ class DownloadUtils:
|
||||
if self.use_https and not self.verify_cert:
|
||||
artwork += "|verifypeer=false"
|
||||
|
||||
# log.debug("getArtwork: request:{0} item:{1} parent:{2} link:{3}", art_type, item_type, parent, artwork)
|
||||
|
||||
'''
|
||||
# do not return non-existing images
|
||||
if ( (art_type != "Backdrop" and imageTag == "") |
|
||||
(art_type == "Backdrop" and data.get("BackdropImageTags") != None and len(data.get("BackdropImageTags")) == 0) |
|
||||
(art_type == "Backdrop" and data.get("BackdropImageTag") != None and len(data.get("BackdropImageTag")) == 0)
|
||||
):
|
||||
artwork = ''
|
||||
'''
|
||||
|
||||
return artwork
|
||||
|
||||
|
||||
def image_url(self, item_id, art_type, index, width, height, image_tag, server):
|
||||
|
||||
# test imageTag e3ab56fe27d389446754d0fb04910a34
|
||||
@ -577,7 +560,6 @@ class DownloadUtils:
|
||||
log.debug("User Id: {0}".format(userid))
|
||||
window.set_property("AccessToken", access_token)
|
||||
window.set_property("userid", userid)
|
||||
# WINDOW.setProperty("userimage", "")
|
||||
|
||||
self.post_capabilities()
|
||||
|
||||
|
@ -479,8 +479,6 @@ def show_menu(params):
|
||||
li.setProperty('menu_id', 'set_view')
|
||||
action_items.append(li)
|
||||
|
||||
# xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=False)
|
||||
|
||||
action_menu = ActionMenu("ActionMenu.xml", PLUGINPATH, "default", "720p")
|
||||
action_menu.setActionItems(action_items)
|
||||
action_menu.doModal()
|
||||
@ -493,9 +491,6 @@ def show_menu(params):
|
||||
|
||||
if selected_action == "play":
|
||||
log.debug("Play Item")
|
||||
# list_item = populate_listitem(params["item_id"])
|
||||
# result = xbmcgui.Dialog().info(list_item)
|
||||
# log.debug("xbmcgui.Dialog().info: {0}", result)
|
||||
play_action(params)
|
||||
|
||||
elif selected_action == "set_view":
|
||||
@ -671,7 +666,6 @@ def show_menu(params):
|
||||
if xbmc.getCondVisibility("Window.IsActive(home)"):
|
||||
built_in_command = 'ActivateWindow(Videos, ' + action_url + ', return)'
|
||||
else:
|
||||
# built_in_command = 'Container.Update(' + action_url + ', replace)'
|
||||
built_in_command = 'Container.Update(' + action_url + ')'
|
||||
|
||||
xbmc.executebuiltin(built_in_command)
|
||||
@ -752,7 +746,6 @@ def search_results_person(params):
|
||||
person_id = params.get("person_id")
|
||||
details_url = ('{server}/Users/{userid}/items' +
|
||||
'?PersonIds=' + person_id +
|
||||
# '&IncludeItemTypes=Movie' +
|
||||
'&Recursive=true' +
|
||||
'&Fields={field_filters}' +
|
||||
'&format=json')
|
||||
@ -781,8 +774,6 @@ def search_results_person(params):
|
||||
if content_type:
|
||||
xbmcplugin.setContent(handle, content_type)
|
||||
|
||||
# xbmcplugin.setContent(handle, detected_type)
|
||||
|
||||
if dir_items is not None:
|
||||
xbmcplugin.addDirectoryItems(handle, dir_items)
|
||||
|
||||
@ -884,8 +875,6 @@ def search_results(params):
|
||||
for item in person_items:
|
||||
person_id = item.get('Id')
|
||||
person_name = item.get('Name')
|
||||
# image_tags = item.get('ImageTags', {})
|
||||
# image_tag = image_tags.get('PrimaryImageTag', '')
|
||||
person_thumbnail = downloadUtils.get_artwork(item, "Primary", server=server)
|
||||
|
||||
action_url = sys.argv[0] + "?mode=NEW_SEARCH_PERSON&person_id=" + person_id
|
||||
@ -979,7 +968,6 @@ def play_action(params):
|
||||
play_info["audio_stream_index"] = audio_stream_index
|
||||
log.info("Sending jellycon_play_action : {0}".format(play_info))
|
||||
play_file(play_info)
|
||||
#send_event_notification("jellycon_play_action", play_info)
|
||||
|
||||
|
||||
def play_item_trailer(item_id):
|
||||
@ -1056,8 +1044,4 @@ def play_item_trailer(item_id):
|
||||
youtube_plugin = "RunPlugin(plugin://plugin.video.youtube/play/?video_id=%s)" % youtube_id
|
||||
log.debug("youtube_plugin: {0}".format(youtube_plugin))
|
||||
|
||||
# play_info = {}
|
||||
# play_info["url"] = youtube_plugin
|
||||
# log.info("Sending jellycon_play_trailer_action : {0}", play_info)
|
||||
# send_event_notification("jellycon_play_youtube_trailer_action", play_info)
|
||||
xbmc.executebuiltin(youtube_plugin)
|
||||
|
@ -35,16 +35,6 @@ def get_image_links(url):
|
||||
if server is None:
|
||||
return []
|
||||
|
||||
# url = re.sub("(?i)limit=[0-9]+", "limit=4", url)
|
||||
# url = url.replace("{ItemLimit}", "4")
|
||||
# url = re.sub("(?i)SortBy=[a-zA-Z]+", "SortBy=Random", url)
|
||||
|
||||
# if not re.search('limit=', url, re.IGNORECASE):
|
||||
# url += "&Limit=4"
|
||||
|
||||
# if not re.search('sortBy=', url, re.IGNORECASE):
|
||||
# url += "&SortBy=Random"
|
||||
|
||||
url = re.sub("(?i)EnableUserData=[a-z]+", "EnableUserData=False", url)
|
||||
url = re.sub("(?i)EnableImageTypes=[,a-z]+", "EnableImageTypes=Primary", url)
|
||||
url = url.replace("{field_filters}", "BasicSyncInfo")
|
||||
@ -109,8 +99,6 @@ def build_image(path):
|
||||
|
||||
host_name = url_bits.hostname
|
||||
port = url_bits.port
|
||||
# user_name = url_bits.username
|
||||
# user_password = url_bits.password
|
||||
url_path = url_bits.path
|
||||
url_query = url_bits.query
|
||||
|
||||
|
@ -256,7 +256,6 @@ def extract_item_info(item, gui_options):
|
||||
elif person_type == "Writing":
|
||||
item_details.writer = person["Name"]
|
||||
elif person_type == "Actor":
|
||||
# log.debug("Person: {0}", person)
|
||||
person_name = person.get("Name")
|
||||
person_role = person.get("Role")
|
||||
person_id = person.get("Id")
|
||||
@ -283,7 +282,6 @@ def extract_item_info(item, gui_options):
|
||||
|
||||
# production location
|
||||
prod_location = item.get("ProductionLocations", [])
|
||||
# log.debug("ProductionLocations : {0}", prod_location)
|
||||
if prod_location:
|
||||
item_details.production_location = prod_location[0]
|
||||
|
||||
@ -358,8 +356,6 @@ def extract_item_info(item, gui_options):
|
||||
|
||||
def add_gui_item(url, item_details, display_options, folder=True, default_sort=False):
|
||||
|
||||
# log.debug("item_details: {0}", item_details.__dict__)
|
||||
|
||||
if not item_details.name:
|
||||
return None
|
||||
|
||||
@ -449,8 +445,6 @@ def add_gui_item(url, item_details, display_options, folder=True, default_sort=F
|
||||
else:
|
||||
list_item = xbmcgui.ListItem(list_item_name, iconImage=thumb_path, thumbnailImage=thumb_path)
|
||||
|
||||
# log.debug("Setting thumbnail as: {0}", thumbPath)
|
||||
|
||||
item_properties = {}
|
||||
|
||||
# calculate percentage
|
||||
@ -568,7 +562,6 @@ def add_gui_item(url, item_details, display_options, folder=True, default_sort=F
|
||||
info_labels["trailer"] = "plugin://plugin.video.jellycon?mode=playTrailer&id=" + item_details.id
|
||||
|
||||
list_item.setInfo('video', info_labels)
|
||||
# log.debug("info_labels: {0}", info_labels)
|
||||
|
||||
if item_details.media_streams is not None:
|
||||
for stream in item_details.media_streams:
|
||||
@ -595,7 +588,6 @@ def add_gui_item(url, item_details, display_options, folder=True, default_sort=F
|
||||
item_properties["NumEpisodes"] = str(item_details.number_episodes)
|
||||
|
||||
list_item.setRating("imdb", item_details.community_rating, 0, True)
|
||||
# list_item.setRating("rt", item_details.critic_rating, 0, False)
|
||||
item_properties["TotalTime"] = str(item_details.duration)
|
||||
|
||||
else:
|
||||
@ -606,7 +598,6 @@ def add_gui_item(url, item_details, display_options, folder=True, default_sort=F
|
||||
info_labels["artist"] = item_details.song_artist
|
||||
info_labels["album"] = item_details.album_name
|
||||
|
||||
# log.debug("info_labels: {0}", info_labels)
|
||||
list_item.setInfo('music', info_labels)
|
||||
|
||||
list_item.setContentLookup(False)
|
||||
@ -616,7 +607,6 @@ def add_gui_item(url, item_details, display_options, folder=True, default_sort=F
|
||||
if item_details.baseline_itemname is not None:
|
||||
item_properties["suggested_from_watching"] = item_details.baseline_itemname
|
||||
|
||||
# log.debug("item_properties: {0}", item_properties)
|
||||
if kodi_version > 17:
|
||||
list_item.setProperties(item_properties)
|
||||
else:
|
||||
|
@ -26,17 +26,14 @@ class HomeWindow:
|
||||
def get_property(self, key):
|
||||
key = self.id_string % key
|
||||
value = self.window.getProperty(key)
|
||||
# log.debug('HomeWindow: getProperty |{0}| -> |{1}|', key, value)
|
||||
return value
|
||||
|
||||
def set_property(self, key, value):
|
||||
key = self.id_string % key
|
||||
# log.debug('HomeWindow: setProperty |{0}| -> |{1}|', key, value)
|
||||
self.window.setProperty(key, value)
|
||||
|
||||
def clear_property(self, key):
|
||||
key = self.id_string % key
|
||||
# log.debug('HomeWindow: clearProperty |{0}|', key)
|
||||
self.window.clearProperty(key)
|
||||
|
||||
|
||||
|
@ -23,11 +23,6 @@ class PictureViewer(xbmcgui.WindowXMLDialog):
|
||||
picture_control = self.getControl(3010)
|
||||
|
||||
picture_control.setImage(self.picture_url)
|
||||
# self.listControl.addItems(self.action_items)
|
||||
# self.setFocus(self.listControl)
|
||||
|
||||
# bg_image = self.getControl(3010)
|
||||
# bg_image.setHeight(50 * len(self.action_items) + 20)
|
||||
|
||||
def onFocus(self, controlId):
|
||||
pass
|
||||
|
@ -19,7 +19,6 @@ from .translation import string_load
|
||||
from .datamanager import DataManager, clear_old_cache_data
|
||||
from .item_functions import extract_item_info, add_gui_item
|
||||
from .clientinfo import ClientInformation
|
||||
#from .functions import delete
|
||||
from .cache_images import CacheArtwork
|
||||
from .picture_viewer import PictureViewer
|
||||
from .tracking import timer
|
||||
@ -155,7 +154,6 @@ def add_to_playlist(play_info):
|
||||
play_session_id = playback_info.get("PlaySessionId")
|
||||
|
||||
# select the media source to use
|
||||
# sources = item.get("MediaSources")
|
||||
sources = playback_info.get('MediaSources')
|
||||
|
||||
selected_media_source = sources[0]
|
||||
@ -371,22 +369,6 @@ def play_file(play_info):
|
||||
del resume_dialog
|
||||
log.debug("Resume Dialog Result: {0}".format(resume_result))
|
||||
|
||||
# check system settings for play action
|
||||
# if prompt is set ask to set it to auto resume
|
||||
# remove for now as the context dialog is now handeled in the monitor thread
|
||||
# params = {"setting": "myvideos.selectaction"}
|
||||
# setting_result = json_rpc('Settings.getSettingValue').execute(params)
|
||||
# log.debug("Current Setting (myvideos.selectaction): {0}", setting_result)
|
||||
# current_value = setting_result.get("result", None)
|
||||
# if current_value is not None:
|
||||
# current_value = current_value.get("value", -1)
|
||||
# if current_value not in (2,3):
|
||||
# return_value = xbmcgui.Dialog().yesno(string_load(30276), string_load(30277))
|
||||
# if return_value:
|
||||
# params = {"setting": "myvideos.selectaction", "value": 2}
|
||||
# json_rpc_result = json_rpc('Settings.setSettingValue').execute(params)
|
||||
# log.debug("Save Setting (myvideos.selectaction): {0}", json_rpc_result)
|
||||
|
||||
if resume_result == 1:
|
||||
seek_time = 0
|
||||
elif resume_result == -1:
|
||||
@ -528,7 +510,6 @@ def __build_label2_from(source):
|
||||
subtitles = [item for item in source.get('MediaStreams', {}) if item.get('Type') == "Subtitle"]
|
||||
|
||||
details = [str(convert_size(source.get('Size', 0)))]
|
||||
# details.append(source.get('Container', ''))
|
||||
for video in videos:
|
||||
details.append('{} {} {}bit'.format(video.get('DisplayTitle', ''),
|
||||
video.get('VideoRange', ''),
|
||||
@ -991,7 +972,6 @@ def prompt_for_stop_actions(item_id, data):
|
||||
return
|
||||
|
||||
# item percentage complete
|
||||
# percenatge_complete = int(((current_position * 10000000) / runtime) * 100)
|
||||
percenatge_complete = int((current_position / duration) * 100)
|
||||
log.debug("Episode Percentage Complete: {0}".format(percenatge_complete))
|
||||
|
||||
@ -1007,21 +987,14 @@ def prompt_for_stop_actions(item_id, data):
|
||||
percenatge_complete > prompt_delete_movie_percentage):
|
||||
prompt_to_delete = True
|
||||
|
||||
#if prompt_to_delete:
|
||||
# log.debug("Prompting for delete")
|
||||
# delete(item_id)
|
||||
|
||||
# prompt for next episode
|
||||
if (next_episode is not None and
|
||||
prompt_next_percentage < 100 and
|
||||
item_type == "Episode" and
|
||||
percenatge_complete > prompt_next_percentage):
|
||||
|
||||
# resp = True
|
||||
index = next_episode.get("IndexNumber", -1)
|
||||
if play_prompt:
|
||||
# series_name = next_episode.get("SeriesName")
|
||||
# next_epp_name = "Episode %02d - (%s)" % (index, next_episode.get("Name", "n/a"))
|
||||
|
||||
plugin_path = settings.getAddonInfo('path')
|
||||
plugin_path_real = xbmc.translatePath(os.path.join(plugin_path))
|
||||
@ -1033,25 +1006,6 @@ def prompt_for_stop_actions(item_id, data):
|
||||
if not play_next_dialog.get_play_called():
|
||||
xbmc.executebuiltin("Container.Refresh")
|
||||
|
||||
# resp = xbmcgui.Dialog().yesno(string_load(30283),
|
||||
# series_name,
|
||||
# next_epp_name,
|
||||
# autoclose=20000)
|
||||
"""
|
||||
if resp:
|
||||
next_item_id = next_episode.get("Id")
|
||||
log.debug("Playing Next Episode: {0}", next_item_id)
|
||||
|
||||
play_info = {}
|
||||
play_info["item_id"] = next_item_id
|
||||
play_info["auto_resume"] = "-1"
|
||||
play_info["force_transcode"] = False
|
||||
send_event_notification("jellycon_play_action", play_info)
|
||||
|
||||
else:
|
||||
xbmc.executebuiltin("Container.Refresh")
|
||||
"""
|
||||
|
||||
|
||||
def stop_all_playback(played_information):
|
||||
log.debug("stop_all_playback : {0}".format(played_information))
|
||||
@ -1111,14 +1065,6 @@ def get_playing_data():
|
||||
if server in playing_file:
|
||||
url_data = urlparse(playing_file)
|
||||
query = parse_qs(url_data.query)
|
||||
#if playing_file not in play_data_map:
|
||||
# infolabel_path_and_file = xbmc.getInfoLabel("Player.Filenameandpath")
|
||||
# log.debug("get_playing_data : Filenameandpath : {0}".format(infolabel_path_and_file))
|
||||
# if infolabel_path_and_file not in play_data_map:
|
||||
# log.debug("get_playing_data : play data not found")
|
||||
# return None
|
||||
# else:
|
||||
# playing_file = infolabel_path_and_file
|
||||
|
||||
return play_data_map.get(playing_file)
|
||||
|
||||
@ -1215,7 +1161,7 @@ class PlaybackService(xbmc.Monitor):
|
||||
self.monitor = monitor
|
||||
|
||||
def onNotification(self, sender, method, data):
|
||||
log.info('Received notification: {} - {} - {}'.format(sender, method, data))
|
||||
log.debug('Received notification: {} - {} - {}'.format(sender, method, data))
|
||||
if method == 'GUI.OnScreensaverActivated':
|
||||
self.screensaver_activated()
|
||||
return
|
||||
@ -1270,8 +1216,6 @@ class PlaybackService(xbmc.Monitor):
|
||||
log.debug("Screen Saver Activated : this is an JellyCon item so stop it")
|
||||
player.stop()
|
||||
|
||||
# xbmc.executebuiltin("Dialog.Close(selectdialog, true)")
|
||||
|
||||
clear_old_cache_data()
|
||||
|
||||
cache_images = settings.getSetting('cacheImagesOnScreenSaver') == 'true'
|
||||
|
@ -216,7 +216,6 @@ def get_art(item, server):
|
||||
|
||||
image_tags = item.get("ImageTags", {})
|
||||
if image_tags and image_tags.get("Primary"):
|
||||
# image_tag = image_tags["Primary"]
|
||||
art['thumb'] = downloadUtils.get_artwork(item, "Primary", server=server)
|
||||
|
||||
item_type = item["Type"]
|
||||
@ -225,7 +224,6 @@ def get_art(item, server):
|
||||
art['poster'] = downloadUtils.get_artwork(item, "Primary", server=server)
|
||||
elif item_type == "Episode":
|
||||
art['tvshow.poster'] = downloadUtils.get_artwork(item, "Primary", parent=True, server=server)
|
||||
# art['poster'] = downloadUtils.getArtwork(item, "Primary", parent=True, server=server)
|
||||
art['tvshow.clearart'] = downloadUtils.get_artwork(item, "Art", parent=True, server=server)
|
||||
art['clearart'] = downloadUtils.get_artwork(item, "Art", parent=True, server=server)
|
||||
art['tvshow.clearlogo'] = downloadUtils.get_artwork(item, "Logo", parent=True, server=server)
|
||||
|
@ -176,7 +176,6 @@ def check_for_new_content():
|
||||
items = result.get("Items", [])
|
||||
if len(items) > 0:
|
||||
item = items[0]
|
||||
# last_played_date = item.get("Etag", "")
|
||||
user_data = item.get("UserData", None)
|
||||
if user_data is not None:
|
||||
last_played_date = user_data.get("LastPlayedDate", "")
|
||||
@ -222,12 +221,6 @@ def get_widget_content_cast(handle, params):
|
||||
people = []
|
||||
|
||||
for person in people:
|
||||
# if (person.get("Type") == "Director"):
|
||||
# director = director + person.get("Name") + ' '
|
||||
# if (person.get("Type") == "Writing"):
|
||||
# writer = person.get("Name")
|
||||
# if (person.get("Type") == "Writer"):
|
||||
# writer = person.get("Name")
|
||||
if person.get("Type") == "Actor":
|
||||
person_name = person.get("Name")
|
||||
person_role = person.get("Role")
|
||||
@ -372,17 +365,11 @@ def get_widget_content(handle, params):
|
||||
log.debug("BaselineItemName : {0} - {1}".format(set_id, items.get("BaselineItemName")))
|
||||
items = items["Items"]
|
||||
rand = random.randint(0, len(items) - 1)
|
||||
# log.debug("random suggestions index : {0} {1}", rand, set_id)
|
||||
item = items[rand]
|
||||
if item["Type"] == "Movie" and item["Id"] not in ids and (not item["UserData"]["Played"] or not hide_watched):
|
||||
# log.debug("random suggestions adding : {0}", item["Id"])
|
||||
ids.append(item["Id"])
|
||||
# else:
|
||||
# log.debug("random suggestions not valid : {0} - {1} - {2}", item["Id"], item["Type"], item["UserData"]["Played"])
|
||||
del items[rand]
|
||||
# log.debug("items len {0}", len(items))
|
||||
if len(items) == 0:
|
||||
# log.debug("Removing Set {0}", set_id)
|
||||
del suggested_items[set_id]
|
||||
set_id += 1
|
||||
if set_id >= len(suggested_items):
|
||||
@ -405,8 +392,6 @@ def get_widget_content(handle, params):
|
||||
filtered_list.append(item)
|
||||
list_items = filtered_list
|
||||
|
||||
# list_items = populateWidgetItems(items_url, widget_type)
|
||||
|
||||
if detected_type is not None:
|
||||
# if the media type is not set then try to use the detected type
|
||||
log.debug("Detected content type: {0}".format(detected_type))
|
||||
|
Loading…
x
Reference in New Issue
Block a user