gmusicbrowser Forum

Main board => Customization => Topic started by: laite on July 20, 2011, 23:14:17

Title: [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: laite on July 20, 2011, 23:14:17
Hi. About four months ago I made a little script (http://forum.gmusicbrowser.org/index.php?topic=335.0 (http://forum.gmusicbrowser.org/index.php?topic=335.0)) for fetching playcounts from last.fm. It was downright ugly, so I finally got myself up to create a proper plugin for this.

Screenshot: (http://www.zimagez.com/miniature/screenshot-07222011-114057am.png) (http://www.zimagez.com/zimage/screenshot-07222011-114057am.php)

** README & DOWNLOAD **

You can check README and download plugin from https://github.com/laite/gmusicbrowser-plugins/tree/master/lastfm_pcget

Installation happens as usual: copy lastfm_pcget.pm to ~/.config/gmusicbrowser/plugins (OR for all users: /usr/share/gmusicbrowser/plugins), restart gmusicbrowser and lastfm_pcGet should appear in preferences->plugins.
Title: Re: [PLUGIN] last.fm playcount fetcher
Post by: laite on July 22, 2011, 17:56:43
Hi everybody!

I added an option to get tagcorrections from last.fm, please check README from github to understand how it works.

All bugs, misbehavings and suggestions are welcome, so please tell if you have some.
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: yaouennec on January 31, 2012, 17:28:21
Hi
I'm interesested in your plugin, but i don't manage to see it in the plugin list.
I've downloaded, copied it, restart gmb but i don't see it in the list.
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: laite on January 31, 2012, 18:06:08
Hi
I'm interesested in your plugin, but i don't manage to see it in the plugin list.
I've downloaded, copied it, restart gmb but i don't see it in the list.

Hi. Where exactly did you copy plugin (aka file 'lastfm_pcget.pm')? What version of gmusicbrowser are you using? Besides these points, I really can't think of anything but perhaps a corrupted download?

Hm, I think I'll change the opening post a bit, since a better place to copy the file would be in ~/.config/gmusicbrowser/plugins/ so there's no need to sudo it. Should work from either place, though.
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: yaouennec on January 31, 2012, 18:27:18
I use the git version. v 1.1.7.1
And i copy it in ~/.gmusicbrowser/plugin/
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: laite on January 31, 2012, 21:36:31
And i copy it in ~/.gmusicbrowser/plugin/

Ok, the folder where you should put plugin must be _exactly_ like: ~/.config/gmusicbrowser/plugins/

If you have used gmusicbrowser, you should have ~/.config/gmusicbrowser folder already present, not necessarily 'plugins'-folder in there, but just create it if it's not already.
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: yaouennec on January 31, 2012, 22:00:39
i just update the git and i'm now in 1.1.8

I put a copy (lastfm_pcget.pm)  where you say, and i let another one in ~/.gmusicbrowser/plugins/, but it still the same.
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: laite on February 01, 2012, 00:22:01
i just update the git and i'm now in 1.1.8

I put a copy (lastfm_pcget.pm)  where you say, and i let another one in ~/.gmusicbrowser/plugins/, but it still the same.

Hm. I'm afraid I really don't know what's the problem. I'm using plugin currently with gmb 1.1.8 and having no problems  with it :-\

Did you try already copying it to folder where all other plugins are ( /usr/share/gmusicbrowser/plugins , there should be about a dozen .pm-files already)?

Perhaps you could try some other plugin and see if it works, like https://raw.github.com/laite/gmusicbrowser-plugins/master/albumrandom/albumrandom.pm (https://raw.github.com/laite/gmusicbrowser-plugins/master/albumrandom/albumrandom.pm) (save that as albumrandom.pm and try including it in gmb same way as lastfm_pcget.pm).
Title: Re : [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: yaouennec on February 01, 2012, 03:20:51
I've just install it, like you say, and i can see albumrandom in the list !

No plugin found in /home/yves/.config/gmusicbrowser/plugins/lastfm_pcget.pm, maybe it uses an old format

begin of the plugin downloaded :
Quote


<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'>
and the end :
   
Quote
  </body>
</html>

1380 lines
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: Quentin Sculo on February 01, 2012, 17:39:40
Your file inlcudes extra html, it shouldn't. Use this link instead :
https://raw.github.com/laite/gmusicbrowser-plugins/master/lastfm_pcget/lastfm_pcget.pm
Title: Re : [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: yaouennec on February 01, 2012, 18:15:39
thanks a lot
it's ok now
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: roaje on May 26, 2012, 00:59:56
Hey i don't know if this is the proper thread to ask this, but a really nice feature would be to have a love button somewhere on the interface - im not sure if its an easy task to add it somewhere on the main window or maybe just have a keyboard shortcut, it just sucks having to login to the last.fm site :P

And thanks for a really excellent jukebox and for making this plug-in!  :D
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: laite on May 26, 2012, 12:03:06
Hey i don't know if this is the proper thread to ask this, but a really nice feature would be to have a love button somewhere on the interface - im not sure if its an easy task to add it somewhere on the main window or maybe just have a keyboard shortcut, it just sucks having to login to the last.fm site :P

Hi, adding love-button should be pretty easy, I'll talk to Quentin about it in the IRC and see what we come up with. This was discussed before a long time ago, but I've already forgotten why it didn't get implemented then  :D
Title: Re : [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: mgrubert on May 26, 2012, 13:09:42
Yes : it would be nice.

Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: laite on May 28, 2012, 14:59:43
Hey i don't know if this is the proper thread to ask this, but a really nice feature would be to have a love button somewhere on the interface

Well, ain't this your lucky day!  :D

There now is a button for loving (and unloving!) tracks, see images below. Due to last.fm user must 'give permission' in last.fm page before he/she can love/unlove tracks from gmb.

Button will appear to your layout if you have 'Extrabuttons' item on it, otherwise you have to add item called 'lastfmLoveButton' manually. Pics are also in git, to install copy them to /usr/share/gmusicbrowser/pix/THEMEYOUAREUSING/ (I suppose they should also work from .config/gmusicbrowser/pix/, but for some reason they didn't for me (any ideas, quentin?). You can obviously replace them whit whatever you like if you're not happy with them :)

On the first click of the love button configuration is asked, do what the helpful dialogs tell you and everything should be fine. Left-clicking button loves, right-clicking unloves track.

To install new features, just grab plugin from the link in opening post and replace old version with it.

If anything goes wrong, please tell me and I'll look into it. You can find me here or at IRC: laite @ #gmusicbrowser (freenode)

Oh, and one more thing: I included an option to 'sync' last.fm loved status' to a local label, you can enable this in preferences. Similar to playcount, it is checked only from currently playing song and label is added or removed accordingly.

-
thanks,
laite
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: mgrubert on May 28, 2012, 23:26:18
Nice ! Thx !
Title: Re: [PLUGIN] last.fm playcount / tagcorrection fetcher
Post by: roaje on May 29, 2012, 01:00:11
Thank you very much for this - everything works just like you said! Appreciate you taking the time and hooking it up so quickly
Title: Re: [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: laite on May 31, 2012, 17:41:04
Hi. There was a major bug that prevented tracks with umlauted characters (åäö..) from working, and also an old bug where corrections where suggested with '&amp;' instead of plain '&'. These are fixed in latest release today, I suggest everybody who uses this plugin to download it. Straight link to plugin: https://raw.github.com/laite/gmusicbrowser-plugins/master/lastfm_pcget/lastfm_pcget.pm (https://raw.github.com/laite/gmusicbrowser-plugins/master/lastfm_pcget/lastfm_pcget.pm)
Title: Re: [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: mgrubert on June 02, 2012, 02:50:05
A column in treesong to see the "lastfm heart" ?
Title: Re: [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: laite on June 02, 2012, 09:15:24
A column in treesong to see the "lastfm heart" ?

You can do this with 'sync label'-option, just set the heart as icon for selected label and show labels icons in songtree :)

Other than that, it would require too much querys to last.fm, since each 'heart' must be obtained individually, so that propably is not going to happen :/
Title: Re : [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: mgrubert on June 03, 2012, 13:06:30
Where is this 'sync label' -option ?
Title: Re: Re : [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: laite on June 03, 2012, 13:40:39
Where is this 'sync label' -option ?

In preferences->plugins->lastfm_pcget, just make sure you have late enough version of plugin.

There are four modes available for sync:
* local to last.fm => if label exists on current track, automatically 'love' track in last.fm
* last.fm to local => if track is 'loved' in last.fm, plugin adds label to track (if it doesn't have it already)
* last.fm AND local => removes tracks label and last.fm-loved UNLESS both exist already
* last.fm OR local => add labels and last.fm-loved IF either one of them exists

Title: Re : [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: mgrubert on June 03, 2012, 19:48:29
Ok, and how to do that " just set the heart as icon for selected label " ?
Title: Re : Re : [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: laite on June 03, 2012, 19:52:42
Ok, and how to do that " just set the heart as icon for selected label " ?

Add 'labels'-tab to your filter, and right-clicking on any label allows you to set image on them ('set icon' or some similar option). This only works after you have specific label in some of your tracks, I think, but you can manually add it in songs properties (name by default is 'last.fm loved', if I recall correctly - you can check this in plugin preferences / change it to anything you like)
Title: Re : [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: mgrubert on June 03, 2012, 19:55:07
Thx (I just found explanation in wiki : "Icons for currently playing labels for which an icon is defined in ~/.config/gmusicbrowser/icons/ (by a .png or .svg named "label-" followed by the label name.)").
I didn't know this feature.
It's nice !
Title: Re: [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: mgrubert on March 15, 2014, 01:22:57
Hi Laite,
I don't remember where put lastfm_heart.png and lastfm_heart_empty to see button on ExtraButtons widjet.
I see label and button on info_windows but not in ExtraButtons.
I put the two png files on .config/gmusicbrowser/pix , .config/gmusicbrowser/pix/mylayout and /usr/share/gmusicbrowser/pix and /usr/share/gmusicbrowser/pix/mylayout directories but I don't succeed.
Could you help me ?
Title: Re : Re: [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: laite on March 15, 2014, 12:49:05
Hi Laite,
I don't remember where put lastfm_heart.png and lastfm_heart_empty to see button on ExtraButtons widjet.
I see label and button on info_windows but not in ExtraButtons.
I put the two png files on .config/gmusicbrowser/pix , .config/gmusicbrowser/pix/mylayout and /usr/share/gmusicbrowser/pix and /usr/share/gmusicbrowser/pix/mylayout directories but I don't succeed.
Could you help me ?

Hi!

I have them in /usr/share/gmusicbrowser/pix/elementary (as I use elementary icon theme) and they seem to work with ExtraButtons. Note that you have to restart gmusicbrowser after copying files to your icon theme directory.
Title: Re : [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: mgrubert on March 18, 2014, 11:43:30
OK, it works now.
Thx
Title: Re: [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: mgrubert on October 11, 2016, 23:48:28
Hi Laite,

I have problem with the plugin : it crashes GMB.

Without connexion, all rocks, with a connexion, after 30s, GMB crashes.
I try with plugin off and all is ok.

The crash occurs when the plugin is on and pc conneected after 30s.
May be when the playcount is changed ?

How could we do to make it rules again ?
I NEED the lastfm playcount update :p
Title: Re: [PLUGIN] last.fm playcount / tagcorrection / loved-status fetcher
Post by: mgrubert on October 24, 2016, 21:06:52
Hi,

I try with activing/un-activing several options in plugin settings.

Now it works with those changes :
. un-check corrections
. set every tracks playcount separately

Nice for me.

If you need tests, I'm your man.

Regards