You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If ["favorites", "delete", "url:http://...."] is used to remove a favourite, the plugin also removes others. Looking at cliDelete in Slim/Plugin/Favorites/Plugin.pm, line 932 checks if no index is supplied and deletes via the URL. However, line 941 then attempts to delete via this non-existent index.
I think the $favs->deleteIndex($index); should be in an else section. i.e. re-write function as follows:
sub cliDelete {
my $request = shift;
if ($request->isNotCommand([['favorites'], ['delete']])) {
$request->setStatusBadDispatch();
return;
}
my $client = $request->client();
my $index = $request->getParam('item_id');
my $url = $request->getParam('url');
my $title = $request->getParam('title');
# XXX: refactor to use Slim::Utils::Favorites
my $favs = Slim::Plugin::Favorites::OpmlFavorites->new($client);
if (!defined $index || !defined $favs->entry($index)) {
if ($url) {
$favs->deleteUrl($url);
} else {
$request->setStatusBadParams();
return;
}
} else {
$favs->deleteIndex($index);
}
# show feedback if this action came from jive cometd session
if ($request->source && $request->source =~ /\/slim\/request/) {
my $deleteMsg = $title?$title:$url;
$client->showBriefly({
'jive' => {
'text' => [ $client->string('FAVORITES_DELETING'),
$deleteMsg ],
}
});
}
$request->setStatusDone();
}
p.s. I would have created a pull request, but my ISP seems to be going really slow with a git checkout of slimserver!
The text was updated successfully, but these errors were encountered:
CDrummond
changed the title
Deleteing favourite via CLI with URL deletes others
Deleting favourite via CLI with URL deletes others
Apr 3, 2021
If
["favorites", "delete", "url:http://...."]
is used to remove a favourite, the plugin also removes others. Looking atcliDelete
inSlim/Plugin/Favorites/Plugin.pm
, line 932 checks if no index is supplied and deletes via the URL. However, line 941 then attempts to delete via this non-existent index.I think the
$favs->deleteIndex($index);
should be in anelse
section. i.e. re-write function as follows:p.s. I would have created a pull request, but my ISP seems to be going really slow with a git checkout of slimserver!
The text was updated successfully, but these errors were encountered: