Added more commands #2
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "add_more_commands"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
added 2 commands that show the top tracks and albums played by a user. There are some formatting decisions that will need to be taken. Also the client library for the API seems exhausted. Missing some key things. Yet to use a constructor the initialize an instance of the client when plugin is called rather than under each function.
can refer #1
Signed-off-by: Pratyush Desai pratyush.desai@liberta.casa
@ -52,16 +53,16 @@ class ListenBrainz(callbacks.Plugin):listen = client.get_playing_now(user)if listen is not None:nit: I think
if listen is None ... foo ... else ... barwould be more direct thanif listen is not None ... bar ... else ... foo@ -70,11 +71,92 @@ class ListenBrainz(callbacks.Plugin):count = client.get_user_listen_count(user)if count is not None:similar here, but it was not touched in this patch
@ -78,0 +104,4 @@irc.reply(header)for i, track in enumerate(top_tracks):rank = i + 1rankdoes not seem to be used, it could be removed, and thenenumerate()andiwould no longer be needed either - or am I missing something?it was a part of the output in the original idea but thought maybe it’s better to merge a –count optional arg which also does a reply.inPrivate (iirc it’s called).
i feel even 4 lines is a lot of output so kept this hardcoded to top 3 results as it gives 25 by default.
Planning to keep it.
@ -78,0 +146,4 @@irc.reply(header)for i, release in enumerate(top_releases):rank = i + 1same here
Added more commandsto DRAFT: Added more commandsDRAFT: Added more commandsto WIP: Added more commandse9a800a093to25d72680cbWIP: Added more commandsto Added more commands8003fbfa62tod240612183d240612183toa675fc8c18Merging as there’s too much to improve and don’t want to jam it all here with forced pushes.