gmusicbrowser Forum

Main board => Questions => Topic started by: WovenTales on December 29, 2011, 23:25:50

Title: Extending Notify plugin
Post by: WovenTales on December 29, 2011, 23:25:50
I've finally found a music browser/manager that I like in gmusicbrowser! One of the few obvious improvements I can think of is extending the Notify plugin. In my case, I have enabled the "Version" tag and usually differentiate different versions of a song solely through that field. The "Now Playing" at the top (I'm using a modified Quodlibit layout) displays the contents of that tag beside the title, but I can't see any way to place the version in the notification popup. I have looked at the code for the plugin, but I'm not a perl programmer and the only thing I could figure out was that there was a call to a MakeReplaceText function for listing the parameters in the tooltip.

Does anyone know how to add more fields to what the plugin parses? I don't see a need for more one-letter replacements, unless that's the best way to do it, but something like %version or %discname where any tag can be specified would probably be helpful to more people than just me. Thanks!
Title: Re: Extending Notify plugin
Post by: Quentin Sculo on December 30, 2011, 02:29:42
You can use $version, I need to make it more clear that everywhere you can use %t or other %-letter, you can also (with version v1.1.x) use $fieldname.  (and in the future, expressions using a syntax I have yet to make up my mind on)
Title: Re: Extending Notify plugin
Post by: WovenTales on December 30, 2011, 08:37:44
Well, you seem to have beaten me to it. ;) The version is now part of my notifications—thank you! I don't suppose there's any way to say "if $version is empty, new line; else continue"? But no, that's more complexity in the code than is worth the result. If it's not in there already, don't worry about it. Again, thanks for pointing that out!
Title: Re: Extending Notify plugin
Post by: Quentin Sculo on January 03, 2012, 16:07:36
Quote from: WovenTales on December 30, 2011, 08:37:44
I don't suppose there's any way to say "if $version is empty, new line; else continue"? But no, that's more complexity in the code than is worth the result. If it's not in there already, don't worry about it. Again, thanks for pointing that out!
The planned syntax will make that kind of thing possible.
Currently there is only the virtual field $version_or_empty that is either an empty string if the $version field is empty, or " ($version)". Not sure that will fit your needs.