Skip to content

Commit 5605278

Browse files
committed
Show a few popular options in the settings screen.
1 parent f597a3f commit 5605278

4 files changed

Lines changed: 23 additions & 3 deletions

File tree

HTML/EN/plugins/LocalPlayer/settings/basic.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828

2929
[% WRAPPER setting title="PLUGIN_LOCALPLAYER_OPTIONS" desc="PLUGIN_LOCALPLAYER_OPTIONS_DESC" %]
3030
<input type="text" class="stdedit" name="opts" id="opts" value="[% opts %]" size="100">
31-
[% END %]
31+
[% IF optionsTable %]
32+
<div><br/>[% "PLUGIN_LOCALPLAYER_POPULAR_OPTIONS" | string %]</div>
33+
<pre>[% optionsTable | html -%]</pre>
34+
[% END %]
35+
[%- END -%]
3236

3337
[% WRAPPER setting title="PLUGIN_LOCALPLAYER_DEBUG" desc="PLUGIN_LOCALPLAYER_DEBUG_DESC" %]
3438
<select class="stdedit" name="debugs" id="debugs">

Settings.pm

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,20 @@ sub handler2 {
7272

7373
if ($prefs->get('autorun')) {
7474

75-
$params->{'binary'} = Plugins::LocalPlayer::Squeezelite->bin;
75+
my $bin = Plugins::LocalPlayer::Squeezelite->bin;
76+
$params->{'binary'} = $bin;
7677
$params->{'binaries'} = [ Plugins::LocalPlayer::Squeezelite->binaries('update') ];
7778
$params->{'running'} = Plugins::LocalPlayer::Squeezelite->alive;
7879

80+
if (my $path = Slim::Utils::Misc::findbin($bin)) {
81+
if (my $options = `$path -?`) {
82+
# extract descriptions for server address, name, and MAC address
83+
while ($options =~ /(^\s+-[smn]\s+.+\n)/mg) {
84+
$params->{'optionsTable'} .= $1;
85+
}
86+
}
87+
}
88+
7989
my $devices = Plugins::LocalPlayer::Squeezelite->devices;
8090

8191
unshift @$devices, { name => '', desc => "Default" };

Squeezelite.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ sub bin {
7878
}
7979
}
8080

81-
return $binaries[0] =~ /squeezelite-osx/ ? $binaries[0] : undef;
81+
return $binaries[0];
8282
}
8383

8484
sub start {

strings.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ PLUGIN_LOCALPLAYER_OPTIONS
6161
FR Options Supplémentaires (Avancé)
6262
NL Extra Opties (Geavanceerd)
6363

64+
PLUGIN_LOCALPLAYER_POPULAR_OPTIONS
65+
FR Quelques options populaires :
66+
DE Populäre Einstellungen:
67+
EN Some popular options:
68+
NL Een paar populaire opties:
69+
6470
PLUGIN_LOCALPLAYER_OPTIONS_DESC
6571
DE Ergänzen Sie weitere Squeezelite Befehlszeilenparameter. Siehe <a href="https://ralph-irving.github.io/squeezelite.html" target="_blank">https://ralph-irving.github.io/squeezelite.html</a> für Details.
6672
EN Add additional Squeezelite command line options here. See <a href="https://ralph-irving.github.io/squeezelite.html" target="_blank">https://ralph-irving.github.io/squeezelite.html</a> for details.

0 commit comments

Comments
 (0)