version bump, update deprecated functions that spam my log (lol)

This commit is contained in:
cere 2024-02-21 03:38:54 -05:00
parent c172a6d976
commit d51ec760e3
2 changed files with 28 additions and 14 deletions

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<addon id="plugin.audio.librespot" version="0.0.3" name="Librespot" provider-name="Cere">
<addon id="plugin.audio.librespot" version="0.1.0" name="Librespot" provider-name="Cere">
<requires>
<import addon="xbmc.python" version="3.0.0" />
<import addon="xbmc.addon" version="18.9.701" />

View File

@ -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)