Skip to content

Commit

Permalink
Add list-of-index values as delete option for favourites.
Browse files Browse the repository at this point in the history
Change-Id: I797d415bb5490e9885fcd63573b9d1ef4745716a
  • Loading branch information
logitech-replication committed Aug 24, 2012
1 parent b496ca9 commit 3dcb1a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion HTML/EN/html/docs/cli-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -9023,9 +9023,12 @@ <h3 id="Favorites">
<td>
The id of a favorite or level to be deleted. The id represents the hierarchical
structure of the file using a dotted syntax similar to the one used
in SNMP, like eg. 2.0.9.3.
in SNMP, like eg. 2.0.9.3.
<br>
Either this parameter or &quot;url&quot; is mandatory. This takes precedence.
<br>
If this parameter is a comma-separated list, then each of the items will be deleted
and the &quot;url&quot parameter will be ignored.
</td>
<tr>
</tr>
Expand Down
7 changes: 7 additions & 0 deletions Slim/Plugin/Favorites/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,13 @@ sub cliDelete {
my $title = $request->getParam('title');

my $favs = Slim::Utils::Favorites->new($client);

if (defined $index && $index =~ /,/) {
main::DEBUGLOG && $log->debug("deleting list by index: $index");
$favs->deleteIndex($_) foreach sort {$b <=> $a} split(/,/, $index);
$request->setStatusDone();
return;
}

if (!defined $index || !defined $favs->entry($index)) {
if ($url) {
Expand Down

0 comments on commit 3dcb1a6

Please sign in to comment.