Update settings page
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
[% PROCESS settings/header.html %]
|
||||
|
||||
<div>Hello World</div>
|
||||
|
||||
[% WRAPPER setting title="PLUGIN_YOUTUBEMUSIC_TESTPREF" desc="PLUGIN_YOUTUBEMUSIC_TESTPREF_DESC" %]
|
||||
<input type="text" class="stdedit" name="pref_testPref" id="pref_testPref" value="[% prefs.pref_testPref %]" size="45">
|
||||
[% END %]
|
||||
|
||||
[% PROCESS settings/footer.html %]
|
||||
|
||||
@@ -16,6 +16,10 @@ my $log = Slim::Utils::Log->addLogCategory({
|
||||
|
||||
my $prefs = preferences('plugin.youtubemusic');
|
||||
|
||||
$prefs->init({
|
||||
testPref => 'test'
|
||||
});
|
||||
|
||||
sub initPlugin {
|
||||
my $class = shift;
|
||||
|
||||
|
||||
15
Settings.pm
15
Settings.pm
@@ -4,6 +4,7 @@ use strict;
|
||||
use base qw(Slim::Web::Settings);
|
||||
|
||||
use Slim::Utils::Log;
|
||||
use Slim::Utils::Prefs;
|
||||
|
||||
my $log = logger('plugin.youtubemusic');
|
||||
|
||||
@@ -15,5 +16,19 @@ sub page {
|
||||
return 'plugins/YouTubeMusic/settings/basic.html';
|
||||
}
|
||||
|
||||
sub prefs {
|
||||
return (preferences('plugin.youtubemusic'), qw(testPref));
|
||||
}
|
||||
|
||||
sub handler {
|
||||
my ($class, $client, $params) = @_;
|
||||
|
||||
if ($params->{'saveSettings'}) {
|
||||
preferences('plugin.youtubemusic')->set('testPref', $params->{'pref_testPref'});
|
||||
}
|
||||
|
||||
return $class->SUPER::handler($client, $params);
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
2
repo.xml
2
repo.xml
@@ -9,7 +9,7 @@
|
||||
<link>https://git.sanggi.ch/matteo/lms-plugins</link>
|
||||
<creator>mschuepbach</creator>
|
||||
<email>mschuepbach@pm.me</email>
|
||||
<sha>1255a9cc37e3581f3df7d4b153ef6ea980cfc8aa</sha>
|
||||
<sha>d42564a4941d72b81b7e7a55cc8cfc576f9a92ee</sha>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</extensions>
|
||||
|
||||
@@ -4,3 +4,9 @@ PLUGIN_YOUTUBEMUSIC
|
||||
PLUGIN_YOUTUBEMUSIC_DESC
|
||||
EN Integration for YouTube Music
|
||||
|
||||
PLUGIN_YOUTUBEMUSIC_TESTPREF
|
||||
EN Test Preference
|
||||
|
||||
PLUGIN_YOUTUBEMUSIC_TESTPREF_DESC
|
||||
EN This is a test.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user