New plex implementation

This commit is contained in:
Johan Hjorth 2025-06-25 15:03:26 +02:00
parent bd5b3538c8
commit 56e1061325
6 changed files with 121 additions and 6 deletions

View file

@ -45,3 +45,9 @@ def recent_artists():
page += 1
return [(n, m) for (n, m), c in counts.items() if c >= MIN_PLAYS]
def get_top_tracks(artist_name, limit=3):
res = lf_request("artist.getTopTracks", artist=artist_name, limit=limit)
if not res:
return []
return [t["name"] for t in res.get("toptracks", {}).get("track", [])]