Bugzilla – Bug 1637
savePlaylist plugin always enabled
Last modified: 2008-09-15 14:37:04 UTC
the savePlaylist plugin needs an initPlugin() function. It's been drawn to my attention that the savePlaylist plugin is cancelling out the key mappings I've added for the iTunesUpdate plugin, even when disabled! I think this is because Slim::Hardware::IR::addModeDefaultMapping only takes the first mapping for a given mode - When I moved iTunesUpdate to a subdir or created the initPlugin function I assume the order of initialisation changed? Is this the best way to add key mappings? What if 2 plugins want to add keys that don't clash? Anyway the change is just to wrap the last 3 lines in initPlugin: sub initPlugin { Slim::Hardware::IR::addModeDefaultMapping('playlist',\%mapping); our $functref = Slim::Buttons::Playlist::getFunctions(); $functref->{'save'} = $functions{'save'}; }
in general, its a bad idea to be adding mappings to common modes for just this reason. The SavePlaylist was a bit different, since it was being done with the knowledge that it would be an included plugin with the main distro. This change is still good becuase at least users can disable it to make the itunesUpdate plugin work. I'll commit this later. initPlugin is more recent that a good number of plugins. Fortunately most do not have sections of code that get run as part of the initial require.
thanks very much. so do I have any alternatives here given I want to take the keypresses when in the now playing mode (can't expect people to navigate to my plugin every time they rate a song) ?
hmm...the mappings are a tricky thing. This is probably a question for Moser, if you can get his attention on the dev list.
committed fix to trunk at change 3347. I'm going to mark this as fixed. If you cannot get something useful from Moser as a mapping solution, or if something new has to be added to the server to handle the options please create a new enhancement request for that feature.
There are 536 bugs in the database with targets of '---' that were fixed prior to new year 2006. I am setting them to targets of 6.2.1 to keep them from showing up in my queries.