[Slim-Checkins] r11767 - /trunk/server/Slim/Plugin/MusicMagic/ClientSettings.pm

mherger at svn.slimdevices.com mherger at svn.slimdevices.com
Mon Apr 16 09:42:03 PDT 2007


Author: mherger
Date: Mon Apr 16 09:42:03 2007
New Revision: 11767

URL: http://svn.slimdevices.com?rev=11767&view=rev
Log:
Bug: N/A
Description: add file on behalf of kdf

Added:
    trunk/server/Slim/Plugin/MusicMagic/ClientSettings.pm

Added: trunk/server/Slim/Plugin/MusicMagic/ClientSettings.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Plugin/MusicMagic/ClientSettings.pm?rev=11767&view=auto
==============================================================================
--- trunk/server/Slim/Plugin/MusicMagic/ClientSettings.pm (added)
+++ trunk/server/Slim/Plugin/MusicMagic/ClientSettings.pm Mon Apr 16 09:42:03 2007
@@ -1,0 +1,65 @@
+package Slim::Plugin::MusicMagic::ClientSettings;
+
+# SlimServer Copyright (C) 2001-2006 Logitech.
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License,
+# version 2.
+
+use strict;
+use base qw(Slim::Web::Settings);
+
+use Slim::Utils::Log;
+use Slim::Utils::Misc;
+use Slim::Utils::Strings qw(string);
+use Slim::Utils::Prefs;
+
+my $log = Slim::Utils::Log->addLogCategory({
+	'category'     => 'plugin.musicmagic',
+	'defaultLevel' => 'WARN',
+});
+
+my $prefs = preferences('plugin.musicip');
+
+$prefs->migrateClient(1, sub {
+	my ($clientprefs, $client) = @_;
+	
+	$clientprefs->set('mix_filter',  Slim::Utils::Prefs::OldPrefs->clientGet($client, 'MMMFilter')     );
+	$clientprefs->set('reject_size', Slim::Utils::Prefs::OldPrefs->clientGet($client, 'MMMRejectSize') );
+	$clientprefs->set('reject_type', Slim::Utils::Prefs::OldPrefs->clientGet($client, 'MMMRejectType') );
+	$clientprefs->set('mix_genre',   Slim::Utils::Prefs::OldPrefs->clientGet($client, 'MMMMixGenre')   );
+	$clientprefs->set('mix_variety', Slim::Utils::Prefs::OldPrefs->clientGet($client, 'MMMVariety')    );
+	$clientprefs->set('mix_style',   Slim::Utils::Prefs::OldPrefs->clientGet($client, 'MMMStyle')      );
+	$clientprefs->set('mix_type',    Slim::Utils::Prefs::OldPrefs->clientGet($client, 'MMMMixType')    );
+	$clientprefs->set('mix_size',    Slim::Utils::Prefs::OldPrefs->clientGet($client, 'MMMSize')       );
+	1;
+});
+
+sub name {
+	return 'MUSICMAGIC';
+}
+
+sub page {
+	return 'plugins/MusicMagic/settings/mipclient.html';
+}
+
+sub prefs {
+	my ($class,$client) = @_;
+	
+	return ($prefs->client($client), qw(mix_filter reject_size reject_type mix_genre mix_variety mix_style mix_type mix_size));
+}
+
+sub needsClient {
+	return 1;
+}
+
+sub handler {
+	my ($class, $client, $params) = @_;
+
+	$params->{'filters'}  = Slim::Plugin::MusicMagic::Settings::grabFilters();
+
+	return $class->SUPER::handler($client, $params);
+}
+
+1;
+
+__END__



More information about the checkins mailing list