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