Compare commits

..

1 Commits

Author SHA1 Message Date
8003fbfa62
Fix Instance Creation
fix client instance initialization.

Signed-off-by: Pratyush Desai <pratyush.desai@liberta.casa>
2025-11-21 00:56:59 +05:30

View File

@ -91,16 +91,19 @@ class ListenBrainz(callbacks.Plugin):
except Exception as e:
irc.error(f"An unexpected error occurred: {e}", Raise=True)
return
total_tracks = payload.get("total_recording_count", "N/A")
recordings = payload.get("recordings", [])
if not recordings:
irc.reply(f"{user} has no recorded tracks.")
return
top_tracks = recordings[:3]
header = f"{user}'s Top {len(top_tracks)} Tracks (Total unique tracks: {total_tracks:,}):"
irc.reply(header)
for i, track in enumerate(top_tracks):
rank = i + 1
artist = track.get("artist_name", "Unknown Artist")
@ -137,7 +140,7 @@ class ListenBrainz(callbacks.Plugin):
irc.reply(f"{user} has no recorded releases.")
return
top_releases = releases[:DISPLAY_LIMIT]
top_releases = releases[:3]
header = f"{user}'s Top {len(top_releases)} Releases (Total unique releases: {total_albums:,}):"
irc.reply(header)