diff --git a/addon.xml b/addon.xml index 9f407b0b..e1a6fdea 100644 --- a/addon.xml +++ b/addon.xml @@ -39,8 +39,8 @@ #44 Remove code caching, fixing Kodi 18 Music syncing for existing installs. - icon.png - fanart.png + resources/icon.png + resources/fanart.png diff --git a/kodi_icon.png b/kodi_icon.png deleted file mode 100644 index 99749229..00000000 Binary files a/kodi_icon.png and /dev/null differ diff --git a/fanart.png b/resources/fanart.png similarity index 100% rename from fanart.png rename to resources/fanart.png diff --git a/icon.png b/resources/icon.png similarity index 100% rename from icon.png rename to resources/icon.png diff --git a/resources/lib/entrypoint/default.py b/resources/lib/entrypoint/default.py index d79ebb07..339c160a 100644 --- a/resources/lib/entrypoint/default.py +++ b/resources/lib/entrypoint/default.py @@ -209,10 +209,12 @@ def directory(label, path, folder=True, artwork=None, fanart=None, context=None) def dir_listitem(label, path, artwork=None, fanart=None): + ''' Gets the icon paths for default node listings + ''' li = xbmcgui.ListItem(label, path=path) - li.setThumbnailImage(artwork or "special://home/addons/plugin.video.jellyfin/icon.png") - li.setArt({"fanart": fanart or "special://home/addons/plugin.video.jellyfin/fanart.png"}) - li.setArt({"landscape": artwork or fanart or "special://home/addons/plugin.video.jellyfin/fanart.png"}) + li.setThumbnailImage(artwork or "special://home/addons/plugin.video.jellyfin/resources/icon.png") + li.setArt({"fanart": fanart or "special://home/addons/plugin.video.jellyfin/resources/fanart.png"}) + li.setArt({"landscape": artwork or fanart or "special://home/addons/plugin.video.jellyfin/resources/fanart.png"}) return li diff --git a/resources/lib/helper/utils.py b/resources/lib/helper/utils.py index 18757878..1f57e74b 100644 --- a/resources/lib/helper/utils.py +++ b/resources/lib/helper/utils.py @@ -140,7 +140,7 @@ def dialog(dialog_type, *args, **kwargs): if "icon" in kwargs: kwargs['icon'] = kwargs['icon'].replace("{jellyfin}", - "special://home/addons/plugin.video.jellyfin/icon.png") + "special://home/addons/plugin.video.jellyfin/resources/icon.png") if "heading" in kwargs: kwargs['heading'] = kwargs['heading'].replace("{jellyfin}", _('addon_name')) diff --git a/resources/lib/monitor.py b/resources/lib/monitor.py index 9e6b9c39..2dd6dbdd 100644 --- a/resources/lib/monitor.py +++ b/resources/lib/monitor.py @@ -313,7 +313,6 @@ class Monitor(xbmc.Monitor): "Mute,Unmute,SetVolume," "Play,Playstate,PlayNext,PlayMediaSource" ), - 'IconUrl': "https://raw.githubusercontent.com/jellyfin/jellyfin-kodi/master/kodi_icon.png", }) session = server['api'].get_device(self.device_id) diff --git a/resources/lib/objects/actions.py b/resources/lib/objects/actions.py index de919d8c..a4c5d4b5 100644 --- a/resources/lib/objects/actions.py +++ b/resources/lib/objects/actions.py @@ -311,10 +311,16 @@ class Actions(object): obj['Artwork']['Thumb'] = obj['Artwork']['Thumb'] or "" if not intro and not obj['Type'] == 'Trailer': - obj['Artwork']['Primary'] = obj['Artwork']['Primary'] or "special://home/addons/plugin.video.jellyfin/icon.png" + obj['Artwork']['Primary'] = obj['Artwork']['Primary'] \ + or "special://home/addons/plugin.video.jellyfin/resources/icon.png" else: - obj['Artwork']['Primary'] = obj['Artwork']['Primary'] or obj['Artwork']['Thumb'] or (obj['Artwork']['Backdrop'][0] if len(obj['Artwork']['Backdrop']) else "special://home/addons/plugin.video.jellyfin/fanart.png") - obj['Artwork']['Primary'] += "&KodiTrailer=true" if obj['Type'] == 'Trailer' else "&KodiCinemaMode=true" + obj['Artwork']['Primary'] = obj['Artwork']['Primary'] \ + or obj['Artwork']['Thumb'] \ + or (obj['Artwork']['Backdrop'][0] \ + if len(obj['Artwork']['Backdrop']) \ + else "special://home/addons/plugin.video.jellyfin/resources/fanart.png") + obj['Artwork']['Primary'] += "&KodiTrailer=true" \ + if obj['Type'] == 'Trailer' else "&KodiCinemaMode=true" obj['Artwork']['Backdrop'] = [obj['Artwork']['Primary']] self.set_artwork(obj['Artwork'], listitem, obj['Type']) @@ -471,10 +477,12 @@ class Actions(object): obj['Runtime'] = round(float((obj['Runtime'] or 0) / 10000000.0), 6) obj['PlayCount'] = API.get_playcount(obj['Played'], obj['PlayCount']) or 0 obj['Overlay'] = 7 if obj['Played'] else 6 - obj['Artwork']['Primary'] = obj['Artwork']['Primary'] or "special://home/addons/plugin.video.jellyfin/icon.png" - obj['Artwork']['Thumb'] = obj['Artwork']['Thumb'] or "special://home/addons/plugin.video.jellyfin/fanart.png" - obj['Artwork']['Backdrop'] = obj['Artwork']['Backdrop'] or ["special://home/addons/plugin.video.jellyfin/fanart.png"] - + obj['Artwork']['Primary'] = obj['Artwork']['Primary'] \ + or "special://home/addons/plugin.video.jellyfin/resources/icon.png" + obj['Artwork']['Thumb'] = obj['Artwork']['Thumb'] \ + or "special://home/addons/plugin.video.jellyfin/resources/fanart.png" + obj['Artwork']['Backdrop'] = obj['Artwork']['Backdrop'] \ + or ["special://home/addons/plugin.video.jellyfin/resources/fanart.png"] metadata = { 'title': obj['Title'], diff --git a/resources/lib/views.py b/resources/lib/views.py index 9c2fc457..bacb90fe 100644 --- a/resources/lib/views.py +++ b/resources/lib/views.py @@ -363,7 +363,7 @@ class Views(object): else: element = etree.Element('node', {'order': str(index), 'type': "folder"}) - etree.SubElement(element, 'icon').text = "special://home/addons/plugin.video.jellyfin/icon.png" + etree.SubElement(element, 'icon').text = "special://home/addons/plugin.video.jellyfin/resources/icon.png" return element