diff --git a/addon.xml b/addon.xml index 466c29e..d14becb 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/resources/lib/plugin_content.py b/resources/lib/plugin_content.py index 3fcc03c..9cc4cbf 100644 --- a/resources/lib/plugin_content.py +++ b/resources/lib/plugin_content.py @@ -232,19 +232,33 @@ class PluginContent: li = xbmcgui.ListItem(label, offscreen=True) li.setProperty("isPlayable", "true") - li.setInfo( - "music", - { - "title": title, - "genre": track["genre"], - "year": track["year"], - "tracknumber": track["track_number"], - "album": track["album"]["name"], - "artist": track["artist"], - "rating": track["rating"], - "duration": duration, - }, - ) + # Kodi 19 legacy code + # Unsure how to detect Kodi version so I'll leave this here for those stuck in the past + # li.setInfo( + # "music", + # { + # "title": title, + # "genre": track["genre"], + # "year": track["year"], + # "tracknumber": track["track_number"], + # "album": track["album"]["name"], + # "artist": track["artist"], + # "rating": track["rating"], + # "duration": duration, + # }, + # ) + + # Kodi 20+ Equivalent + limus: xbmc.InfoTagMusic = li.getMusicInfoTag() + limus.setTitle(title) + limus.setAlbum(track["album"]["name"]) + limus.setGenres([track["genre"]]) + limus.setYear(track["year"]) + limus.setTrack(track["track_number"]) + limus.setArtist(track["artist"]) + limus.setRating(track["rating"]) + limus.setDuration(duration) + li.setArt({"thumb": track["thumb"]}) li.setProperty("spotifytrackid", track["id"]) li.setContentLookup(False)