minor tweak again, no functionality change

This commit is contained in:
cere 2024-02-21 09:48:41 -05:00
parent 9eaa5cf3c1
commit ab7c5df035

View file

@ -218,22 +218,20 @@ class PluginContent:
def __get_track_item(
self, track: Dict[str, Any], append_artist_to_label: bool = False
) -> Tuple[str, xbmcgui.ListItem]:
duration = int(math.ceil(track["duration_ms"] / 1000))
label = self.__get_track_name(track, append_artist_to_label)
title = label if self.append_artist_to_title else track["name"]
# Local playback by using proxy on this machine.
url = f"http://localhost:{PROXY_PORT}/track/{track['id']}"
# Testing Proxy
# Testing Proxy - mitmproxy ftw
# url = f"http://localhost:8080/track/{track['id']}"
# log_msg(track['id'])
li = xbmcgui.ListItem(label, offscreen=True)
li.setProperty("isPlayable", "true")
# Kodi 19 legacy code
# Unsure how to detect Kodi version so I'll leave this here for those stuck in the past
# duration = track["duration_ms"] / 1000
# li.setInfo(
# "music",
# {
@ -249,6 +247,7 @@ class PluginContent:
# )
# Kodi 20+ Equivalent
duration = int(math.ceil(track["duration_ms"] / 1000))
limus: xbmc.InfoTagMusic = li.getMusicInfoTag()
limus.setTitle(title)
limus.setAlbum(track["album"]["name"])