Bug 1637 - savePlaylist plugin always enabled
: savePlaylist plugin always enabled
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Plugins
: 6.1.0
: All All
: P2 minor (vote)
: ---
Assigned To: KDF
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-06 13:41 UTC by James Craig
Modified: 2008-09-15 14:37 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Craig 2005-06-06 13:41:16 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'};
}
Comment 1 KDF 2005-06-06 15:48:36 UTC
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.
Comment 2 James Craig 2005-06-07 01:38:20 UTC
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) ?
Comment 3 KDF 2005-06-07 06:07:17 UTC
hmm...the mappings are a tricky thing.  This is probably a question for Moser,
if you can get his attention on the dev list. 
Comment 4 KDF 2005-06-07 06:24:40 UTC
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.
Comment 5 Chris Owens 2006-06-16 14:42:01 UTC
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.