Skip to content

Commit

Permalink
Updates project structure to Kodi v17
Browse files Browse the repository at this point in the history
  • Loading branch information
graybush committed Sep 1, 2019
1 parent 31aa207 commit b355d74
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
4 changes: 2 additions & 2 deletions addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
#44 Remove code caching, fixing Kodi 18 Music syncing for existing installs.
</news>
<assets>
<icon>icon.png</icon>
<fanart>fanart.png</fanart>
<icon>resources/icon.png</icon>
<fanart>resources/fanart.png</fanart>
</assets>
</extension>
</addon>
File renamed without changes
File renamed without changes
File renamed without changes
8 changes: 5 additions & 3 deletions resources/lib/entrypoint/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion resources/lib/helper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand Down
22 changes: 15 additions & 7 deletions resources/lib/objects/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,16 @@ def listitem_video(self, obj, listitem, item, seektime=None, intro=False):
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'])
Expand Down Expand Up @@ -471,10 +477,12 @@ def listitem_channel(self, obj, listitem, item):
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'],
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def node_root(self, root, index):
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

Expand Down

0 comments on commit b355d74

Please sign in to comment.