Index: Slim/Utils/Favorites.pm =================================================================== --- Slim/Utils/Favorites.pm (revision 4156) +++ Slim/Utils/Favorites.pm (working copy) @@ -76,6 +76,7 @@ return undef; } } + sub findByClientAndURL { my $class = shift; my $client = shift; @@ -93,6 +94,29 @@ } } +sub moveItem { + my $client = shift; + my $from = shift; + my $to = shift; + + if (defined $to && $to =~ /^[\+-]/) { + $to = $from + $to; + } + + my @titles = Slim::Utils::Prefs::getArray('favorite_titles'); + my @urls = Slim::Utils::Prefs::getArray('favorite_urls'); + + if (defined $from && defined $to && + $from < scalar @titles && + $to < scalar @titles && $from >= 0 && $to >= 0) { + + Slim::Utils::Prefs::set('favorite_titles',$titles[$from],$to); + Slim::Utils::Prefs::set('favorite_urls',$urls[$from],$to); + Slim::Utils::Prefs::set('favorite_titles',$titles[$to],$from); + Slim::Utils::Prefs::set('favorite_urls',$urls[$to],$from); + } +} + sub deleteByClientAndURL { my $class = shift; my $client = shift; @@ -106,6 +130,18 @@ } +sub deleteByClientAndId { + my $class = shift; + my $client = shift; + my $i = shift; + + if (defined($i)) { + Slim::Utils::Prefs::delete('favorite_titles', $i); + Slim::Utils::Prefs::delete('favorite_urls', $i); + } + +} + # creates a read-only list of favorites. # if you need to modify the list, use add then call new again. sub new { Index: Plugins/Favorites/HTML/EN/plugins/Favorites/favorites_list.html =================================================================== --- Plugins/Favorites/HTML/EN/plugins/Favorites/favorites_list.html (revision 0) +++ Plugins/Favorites/HTML/EN/plugins/Favorites/favorites_list.html (revision 0) @@ -0,0 +1,42 @@ +[% pagetitle = 'PLUGIN_FAVORITES_MODULE_NAME' | string %] +[% PROCESS pageheader.html %] +
+ +
[% "HOME" | string %] + / [% "PLUGIN_FAVORITES_MODULE_NAME" | string %] +
+ ++ [% fav %] + | + +
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
![]() |
+ ![]() |
+ ![]() |
+
![]() |
+ + [% "HOME" | string %] + / [% "PLUGIN_FAVORITES_MODULE_NAME" | string %] + | ++ |
![]() |
+ ![]() |
+ + |
+ [% fav %] + | + +
+
+ ![]() |
+
+
+ ![]() |
+
+
+ ![]() |
+
+
+ ![]() |
+
/[% "PLUGIN_FAVORITES_MODULE_NAME" | string %]
++ [% fav %] + | +
+
+ ![]() |
+
+
+ ![]() |
+
+
+ ![]() |
+
+
+ ![]() |
+