Skip to content

Commit

Permalink
Make any new preset a favourite too.
Browse files Browse the repository at this point in the history
TTP: Defect-822
Change-Id: I23702c1951c323d52ada43f55935780096f2c96f
  • Loading branch information
logitech-replication committed Aug 22, 2012
1 parent 7ac1987 commit 432fdb3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Slim/Control/LocalPlayers/Jive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1989,6 +1989,19 @@ sub jiveFavoritesCommand {
$url = $song->url;
$type = 'audio';
$title = $song->title;
$icon = $song->coverurl if $song->can('coverurl');
if (!$icon) {
my $handler = Slim::Player::ProtocolHandlers->handlerForURL($url);
if ( $handler && $handler->can('getMetadataFor') ) {
my $remoteMeta = $handler->getMetadataFor( $request->client, $url);
$icon = $remoteMeta->{'cover'};
}
}
if (!$icon && !$song->remote) {
if(my $coverid = $song->coverid) {
$icon = '/music/' . $coverid . '/cover';
}
}
}

# favorite needs to be saved as either a playlist or default to audio
Expand All @@ -2014,6 +2027,11 @@ sub jiveFavoritesCommand {
text => [ $client->string('PRESET_ADDING', $preset), $title ],
},
});

# Make all presets favourites too
if (my $favs = Slim::Utils::Favorites->new($client)) {
$favs->add($url, $title, $type, $parser, undef, $icon) unless defined $favs->findUrl($url);
}
} else {

my @favorites_menu = (
Expand Down

0 comments on commit 432fdb3

Please sign in to comment.