gmusicbrowser Forum

Main board => Customization => Topic started by: trasdahl on June 30, 2011, 12:15:06

Title: [PLUGIN] Albuminfo
Post by: trasdahl on June 30, 2011, 12:15:06
I've written a plugin based on (and similar to) the artistinfo plugin, except it retrieves information about albums, and it does so from allmusic.com. The plugin displays the album review in a Context widget, and offers to save some of the information (genre, moods, styles and themes) in gmb fields. This requires some fields to be enabled/created, so I cite my README:

GENRES IS THE ONLY FIELD EXISTING AND ENABLED IN GMUSICBROWSER BY DEFAULT. "Moods" exists, but must be enabled. This can be done under Preferences -> Fields -> Standard fields -> mood. "Styles" and "Themes" must be created by the user under Preferences -> Fields -> Custom fields. Click "New custom field", call it "Style" (yes, capitalized). Field type must be "flags". Field name is what appears in the filter pane tab, and can be chosen freely ("Styles" is natural). Do the same for "Themes". Moods, Styles and Themes will now be available as filter panes, songtree columns etc.

For more information, read the README.

If (or should I say when) you find any bugs, please tell me! Also let me know if you have any feature requests.
There's a TODO list in the source file, but it's actually more of a "Suggestions" list, so I don't know if I'll implement them unless someone tells me to :)

I hope you find it useful and that it doesn't break anything :)
Title: Re: [PLUGIN] Albuminfo
Post by: ochosi on July 01, 2011, 22:40:18
hey,
just downloaded and tried it - looks great! :)
haven't had time to look at the code, but i can already say that i like the manual search-function.

i'm starting to think that these context-tabs should get meaningful icons, because slowly but surely i'm getting a tab-overflow problem here.
i mean a lastfm-icon or an allmusic-icon is ok, but it doesn't tell the user about the functionality of the thing. maybe the generic album and artist icons would be better for that. what do you think?

also: if you feel like hosting/sharing your code on github feel free to send me an email.
Title: Re: [PLUGIN] Albuminfo
Post by: laite on July 03, 2011, 08:42:41
Nice work, looks (and works) really good!
Title: Re: [PLUGIN] Albuminfo
Post by: ochosi on July 03, 2011, 09:39:37
after using it for a while, here are two feature-request for v0.2:
* if no review is found, there's a button to show lastfm info instead.
* if the widget isn't loaded/shown in the layout, there's an entry in the album-context-menu to open that pane/plugin in a new window.
Title: Re: [PLUGIN] Albuminfo
Post by: laite on July 03, 2011, 10:19:44
Suggestion: I would appreciate 'scan the whole library' - function, as I have fairly large collection and it would be nice to use moods/styles immediately without the need to manually play songs from every album :)
Title: Re: [PLUGIN] Albuminfo
Post by: trasdahl on July 04, 2011, 12:08:44
Hello again.

Quotemaybe the generic album and artist icons would be better for that. what do you think?

I don't really have an opinion about the icons. But it kinda depends on the scope of the plugin. I was uncertain whether I should call it allmusic-plugin or albuminfo plugin. If people think there should be one albuminfo-plugin for allmusic, last.fm etc., then I guess generic icons are sensible.

Quoteif no review is found, there's a button to show lastfm info instead.

I was considering togglebuttons such as the "biography, events & similar"-buttons in artistinfo. Or it could be done the way you describe. But once you add more than one source, then maybe stuff such as "manual search" and "auto-save fields" becomes confusing. Maybe I can try it out, see how it works.

Quoteif the widget isn't loaded/shown in the layout, there's an entry in the album-context-menu to open that pane/plugin in a new window.

You have the "Open Context window" command in the standard main menu, don't you think that's enough?

QuoteI would appreciate 'scan the whole library'

I can try, though I'm not quite sure how to :). I think it would be pretty slow, and I don't know if it would be safe if you for example cancel the process by shutting down gmb.
Title: Re: [PLUGIN] Albuminfo
Post by: laite on July 04, 2011, 14:01:26
Quote from: trasdahl on July 04, 2011, 12:08:44
I can try, though I'm not quite sure how to :). I think it would be pretty slow, and I don't know if it would be safe if you for example cancel the process by shutting down gmb.

Yeah, I was thinking this should be like some small button in the plugin's preferences which would span progress-window similar to gmb's scan and checks are.

Anyway, suggestion #2: It would be nice to see album's styles/moods etc. immediately in the panel view, although I'm not sure if they take too much space out of it. Perhaps as optional?
Title: Re: [PLUGIN] Albuminfo
Post by: laite on July 11, 2011, 14:02:31
BUG: Albums from artists that contains umlauts in their names (like "Amon Düül II", "Kauko Röyhkä" etc.) can't be found with automatic search ("review not found"). When searched manually they work fine.
Title: Re: [PLUGIN] Albuminfo
Post by: trasdahl on July 11, 2011, 15:04:26
Thanks for the feedback.

I don't have much time to fix bugs and features these days, and with the summer holiday coming and all, it might be some time (days, weeks). Sorry about that.

If anybody wants to contribute, though, feel free! :)
Title: Re: [PLUGIN] Albuminfo
Post by: trasdahl on July 11, 2011, 15:18:55
Btw, I noticed an interesting bug myself. If you choose "Auto-save fields" and "Add to existing values", each song in the album is saved separately. I think it has to be done that way. So, if the album contains a lot of songs and if your computer is a bit slow, then the progress window pops up with one progress bar for each song, stacked vertically. If there are a LOT of songs, the progress window becomes extremely "tall", actually so tall that compiz crashes with the report "Max texture size exceeded" (or something like that).

Now how about that, huh? :)

I'm not quite sure what to do about it.
Title: Re: [PLUGIN] Albuminfo
Post by: Quentin Sculo on July 17, 2011, 14:14:45
About the problem with umlauts or other accents in the album name, replacing :
lc($entry->{artist}) eq lc($artist)
with :
::superlc($entry->{artist}) eq ::superlc($artist)
should make it work (::superlc() is a function that tries to remove accents : ö => o)

About saving fields with the Songs::Set function, there is a simpler way to do it :
- $ID can be a list of IDs :
- for genre-like fields, you can add/remove values with "+genre" => ["genre1","genre2"]  (or "-genre")
so you can simply do :
Songs::Set($IDs, ["mood"=>["mood1","mood2"],  "Style"=>["style1","style2"], ]);
or if adding to existing values :
Songs::Set($IDs, ["+mood"=>["mood1","mood2"],  "+Style"=>["style1","style2"], ]);
that should solve your many progress bars problem.

I think I'm going to add "style" and "theme" as standard optional fields, that will make things simpler.
Title: Re: [PLUGIN] Albuminfo
Post by: pyropingvin on November 22, 2011, 19:40:27
Quote from: laite on July 03, 2011, 10:19:44
Suggestion: I would appreciate 'scan the whole library' - function, as I have fairly large collection and it would be nice to use moods/styles immediately without the need to manually play songs from every album :)
I support this suggestion and mabye it can be implemented as a separate script...
Title: Re: [PLUGIN] Albuminfo
Post by: trasdahl on December 05, 2011, 11:14:41
"Scan the whole library" - function is now implemented, and can be found in the shimmer git:

https://github.com/shimmerproject/gmusicbrowser/commit/7f581f6e60274f3392672b1732734c2af6149829

Better late than never, huh? ;)
Title: Re: [PLUGIN] Albuminfo
Post by: nonameplease on May 29, 2012, 19:15:41
Does not work, search also does not work. Could you please help? It used to work first time I started gmusicbrowser, now it always says "no review found".
Title: Re : Re: [PLUGIN] Albuminfo
Post by: laite on May 30, 2012, 07:17:05
Quote from: nonameplease on May 29, 2012, 19:15:41
Does not work, search also does not work. Could you please help? It used to work first time I started gmusicbrowser, now it always says "no review found".

For me it worked perfectly until just now, I guess it might have something to do with allmusic.com renewing itself (at least the site design is completely different) :-\
Title: Re : [PLUGIN] Albuminfo
Post by: vilain_mamuth on November 01, 2012, 16:37:49
it seems that this plugin is based on html parsing, if the site design change then the plugin fails.

why don't use allmusic api instead?
Title: Re: [PLUGIN] Albuminfo
Post by: ochosi on November 01, 2012, 18:17:48
from what i remember when last investigating, the allmusic-api has become unfree, so the plugin can't use it anymore. that's why it doesn't work anymore.

it would have to be rewritten for a different site/service.
Title: Re: [PLUGIN] Albuminfo
Post by: stalphonzo on December 07, 2012, 16:06:12
I took the liberty to make some modifications to the parsing code.
So this new version works fine here.
In manual search the column "Label" should be changed to "Genre", but I can't find the corresponding part of the code.
So you have to live with that little weirdness.
Have fun until allmusic.com people change the design again.
Actually the plugin parses the html code itself, so there isn't any api used.

Question: Would a unfree api lead to licensing problems? There is an api and it seems free to use after registration of developer... . Thought about givin' it a try in order to rewrite the plugin, because for me it's the ultimate killer feature of gmusicbrowser.
Title: Re: [PLUGIN] Albuminfo
Post by: stalphonzo on December 11, 2012, 16:16:00
Fixed a bug causing freezes
Title: Re: [PLUGIN] Albuminfo
Post by: Quentin Sculo on December 11, 2012, 23:58:42
Quote from: stalphonzo on December 07, 2012, 16:06:12
I took the liberty to make some modifications to the parsing code.
So this new version works fine here.
Thanks, I took a quick look, it looks ok. What name and email should I use for the commit (once the genre issue is dealt with) ? (the email doesn't have to be valid, it's mostly a unique identifier)
Quote from: stalphonzo on December 07, 2012, 16:06:12
In manual search the column "Label" should be changed to "Genre", but I can't find the corresponding part of the code.
It's in the line :
label => { name=> ::_p('Record_label',"Label"), storecol=>2, width=>110, },
'Record_label' is a hint/identifier for the translation, as "label" is used for other stuff in gmb.
Of course the 'label' string is used as identifier in a few places, so it could be better to change them as well.
Any reason you replaced labels by genres ?

Quote from: stalphonzo on December 07, 2012, 16:06:12
Question: Would a unfree api lead to licensing problems? There is an api and it seems free to use after registration of developer... . Thought about givin' it a try in order to rewrite the plugin, because for me it's the ultimate killer feature of gmusicbrowser.
The problem with the free api is that it is limited to 3500 request by day :
Quote from: licence link=http://developer.rovicorp.com/terms3.2  Usage Limitations. You must access the Content through the APIs in a manner that requires you to fully refresh each time a call is made for Content.  Currently, you are allowed to make up to 3,500 API calls per day in the aggregate, as calculated by Rovi, during the term of this Agreement, with a maximum of five API calls per second in the aggregate, as calculated by Rovi, for each Key issued to you.  Rovi may change such usage limits at any time without notice. In addition to its other rights under this Agreement, Rovi may utilize technical measures to prevent overusage and/or stop usage of the Rovi Property at any time. 
Title: Re: [PLUGIN] Albuminfo
Post by: stalphonzo on December 14, 2012, 00:45:14
Thanks for your reply.
I changed Label to Genre because the label information isn't available anymore.
I messed a bit with the regexps (seems to work now but it isn't pretty), but I don't when i'll have the time to do it.
Title: Re: [PLUGIN] Albuminfo
Post by: stalphonzo on December 26, 2012, 21:54:13
update for changed rating on allmusic.com
Title: Re: [PLUGIN] Albuminfo
Post by: Quentin Sculo on February 03, 2013, 22:44:13
I've made some minor modifications (replace label by genre and remove a no longer used field).
I want to commit it, I just need a name and email to put as author for the git commit (the email doesn't have to be valid, it's mostly a unique identifier), so let me know what I should use.

edit: Forgot to say, it's now in git, thanks
Title: Re: [PLUGIN] Albuminfo
Post by: watchman on July 16, 2013, 02:23:56
Good day every one,

I think i have a problem with the plugin.
When i want to use it GMB freeze.
Any one an idea?



Title: Re: [PLUGIN] Albuminfo
Post by: laite on July 18, 2013, 06:15:36
Quote from: watchman on July 16, 2013, 02:23:56
Good day every one,

I think i have a problem with the plugin.
When i want to use it GMB freeze.
Any one an idea?

I have the same problem for some albums. When playing song from some album, Albuminfo - plugin freezes to show "Loading..", all visual on layout freezes (not responding), and after current song is finished no more are played.

Without albuminfo-plugin (unchecked from preferences->plugins) everything works perfectly.

One of the albums I noticed this with is "Stevie Ray Vaughan - 1st Unreleased Album", I've included log from gmusicbrowser -debug as an attachment.

My initial guess would be the line "*** GPerl asked to invoke callback from a foreign thread; handing it over to the main loop", but I don't really have no idea what that implies. I just don't like the looks of that :P
Title: Re: [PLUGIN] Albuminfo
Post by: watchman on July 22, 2013, 09:45:28
I have it with all the songs. Soon as i start the plug-in then it freeze.
Do you think GMB has still support?
Title: Re: [PLUGIN] Albuminfo
Post by: Quentin Sculo on September 27, 2013, 21:30:28
Sorry for not replying on forum, I've fixed it in git 2 weeks ago. I'll try to do a new release soon (1-2 week maybe)
Title: Re: [PLUGIN] Albuminfo
Post by: watchman on September 28, 2013, 01:10:53
Thanks Quentin Sculo,

Welcome back....and i'll wait.
Title: Re: [PLUGIN] Albuminfo
Post by: VastOne on December 01, 2013, 17:18:10
I have a question regarding the status of albuminfo.pm in the debian repos

A couple of VSIDO users noticed GMB freezing up when accessing Albuminfo in Context

Reviewing the history on this thread,  I noticed that the freeze issue had been resolved a while back

All VSIDO users use the git version of GMB but I also have the debian repo of GMusicBrowser installed because it corrects 99% of any dependency issues.

Checking the file sizes in git and what is in /usr/share/gmusicbrowser on albuminfo.pm, they are different.  The git file is 35.1k in size and the /usr/share/gmusicbrowser file is 34.7

I verified that copying the git version of the file to /usr/share/gmusicbrowser and replacing that resolves the freezing issue

The question I have is, when using the git version does it actually look and use ~/gmusicbrowser/plugins/albuminfo.pm or is it looking first at /usr/share/gmusicbrowser/albuminfo.pm? Or, if you have a version in ~/.config/gmusicbrowser/plugins, when would it be read?  What is the priority in reading from these locations of the same file?

Thanks