Skip to content

Commit

Permalink
ur
Browse files Browse the repository at this point in the history
  • Loading branch information
fatg3erman committed Apr 17, 2021
1 parent d54cbcc commit 6e48b73
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions api/player/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
$mpd_status['radioparam'] = prefs::$prefs['multihosts'][$p]['radioparams']['radioparam'];
$mpd_status['radiomaster'] = prefs::$prefs['multihosts'][$p]['radioparams']['radiomaster'];
$mpd_status['radioconsume'] = prefs::$prefs['multihosts'][$p]['radioparams']['radioconsume'];
$mpd_status['mopidy_radio_domains'] = prefs::$prefs['mopidy_radio_domains'];

header('Content-Type: application/json');
echo json_encode($mpd_status);
Expand Down
1 change: 1 addition & 0 deletions player/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ function playerController() {
debug.core('PLAYER', e, player.status[e]);
prefs[e] = player.status[e];
});
$('#radiodomains').makeDomainChooser("setSelection", player.status.mopidy_radio_domains);
if (player.status.songid != self.previoussongid) {
if (playlist.trackHasChanged(player.status.songid)) {
self.previoussongid = player.status.songid;
Expand Down
1 change: 0 additions & 1 deletion ui/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ var prefs = function() {
"ratman_sortby",
"sleeptime",
"sleepon",
"mopidy_radio_domains",
"tradsearch",
"sortwishlistby",
"player_in_titlebar",
Expand Down
18 changes: 12 additions & 6 deletions ui/widgets.js
Original file line number Diff line number Diff line change
Expand Up @@ -1431,18 +1431,24 @@ $.widget("rompr.makeDomainChooser", {
i.capitalize()+'</label></div>');
}
}
this.setSelection(this.options.default_domains);
this.options.holder.disableSelection();
},

_setOption: function(key, value) {
this.options[key] = value;
},

setSelection: function(domains) {
this.options.holder.find('.topcheck').each(function() {
var n = $(this).attr("id");
var d = n.substr(0, n.indexOf('_'));
if (self.options.default_domains.indexOf(d) > -1) {
if (domains.indexOf(d) > -1) {
$(this).prop("checked", true);
} else {
$(this).prop("checked", false);
}
});
this.options.holder.disableSelection();
},

_setOption: function(key, value) {
this.options[key] = value;
},

getSelection: function() {
Expand Down

0 comments on commit 6e48b73

Please sign in to comment.