[Slim-Checkins] r33849 - in /7.7/trunk/server/Slim: Control/Jive.pm Plugin/OPMLBased.pm

[email protected] Fri, 17 Feb 2012 14:52:12 -0000
Newsgroups gmane.music.equipment.slimdevices.cvs
Message-ID <[email protected]>
Author: mherger
Date: Fri Feb 17 06:52:12 2012
New Revision: 33849

URL: http://svn.slimdevices.com/slim?rev=33849&view=rev
Log:
Bug: n/a
Description: add some smarts to the plugin handler for mysb.com based apps to allow for white-label solutions
- don't rely on the name string token, but use the plugin UUID instead
- use the icon as defined by mysb.com to override the one defined in the plugin manifest

Modified:
    7.7/trunk/server/Slim/Control/Jive.pm
    7.7/trunk/server/Slim/Plugin/OPMLBased.pm

Modified: 7.7/trunk/server/Slim/Control/Jive.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Control/Jive.pm?rev=33849&r1=33848&r2=33849&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Control/Jive.pm (original)
+++ 7.7/trunk/server/Slim/Control/Jive.pm Fri Feb 17 06:52:12 2012
@@ -2941,8 +2941,12 @@
 		if ( my $plugin = $apps->{$app}->{plugin} ) {
 			# Make sure it's enabled
 			if ( my $pluginInfo = Slim::Utils::PluginManager->isEnabled($plugin) ) {
+				
 				# Get the predefined menu for this plugin
-				if ( my ($globalMenu) = grep { $_->{text} && $_->{text} eq $pluginInfo->{name} } @appMenus ) {				
+				if ( my ($globalMenu) = grep {
+					( $_->{uuid} && lc($_->{uuid}) eq lc($pluginInfo->{id}) )
+					|| ( $_->{text} && $_->{text} eq $pluginInfo->{name} )
+				} @appMenus ) {				
 					main::INFOLOG && $isInfo && $log->info( "App: $app, using plugin $plugin" );
 				
 					# Clone the existing menu and set the node
@@ -2956,6 +2960,12 @@
 
 					# flag as an app
 					$clone->{isApp} = 1;
+					
+					# use icon as defined by MySB to allow for white-label solutions
+					if ( my $icon = $apps->{$app}->{icon} ) {
+						$icon = Slim::Networking::SqueezeNetwork->url( $icon, 'external' ) unless $icon =~ /^http/;
+						$clone->{window}->{'icon-id'} = $icon ;
+					}
 
 					push @{$menu}, $clone;
 				}

Modified: 7.7/trunk/server/Slim/Plugin/OPMLBased.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Plugin/OPMLBased.pm?rev=33849&r1=33848&r2=33849&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Plugin/OPMLBased.pm (original)
+++ 7.7/trunk/server/Slim/Plugin/OPMLBased.pm Fri Feb 17 06:52:12 2012
@@ -76,6 +76,7 @@
 		stringToken    => (uc($name) eq $name) ? $name : undef, # Only use string() if it is uppercase
 		text           => $name,
 		id             => 'opml' . $args{tag},
+		uuid           => $class->_pluginDataFor('id'),
 		node           => $args{node} || $args{menu} || 'plugins',
 		weight         => $class->weight,
 		displayWhenOff => 0,