Author Topic: Extending Notify plugin  (Read 2937 times)

WovenTales

  • Newbie
  • *
  • Posts: 13
    • View Profile
Extending Notify plugin
« on: December 30, 2011, 04: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!

Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1095
    • View Profile
Re: Extending Notify plugin
« Reply #1 on: December 30, 2011, 07: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)

WovenTales

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Extending Notify plugin
« Reply #2 on: December 30, 2011, 13: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!

Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1095
    • View Profile
Re: Extending Notify plugin
« Reply #3 on: January 03, 2012, 21:07:36 »
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.