Bug 6929 - Newly added favorite should go at the end of the list
: Newly added favorite should go at the end of the list
Status: CLOSED FIXED
Product: SB Controller
Classification: Unclassified
Component: UI
: unspecified
: PC All
: P2 normal (vote)
: 7.0
Assigned To: Ben Klaas
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-03 14:26 UTC by Peter Watkins
Modified: 2008-05-15 13:03 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Watkins 2008-02-03 14:26:37 UTC
I added an album as a new Favorite with my SBC today. It was inserted as the new first Favorite -- thereby remapping the button numbers for all the Favorites I already had.

Unless a user explicitlky requests otherwise, a newly added Favorite should go at the end of the list so the button.hold mappings don't change.
Comment 1 KDF 2008-02-03 22:12:31 UTC
I think this is a cli issue.  the cliAdd command in Plugin::Favorites::Plugin is expecting a specified index. Whereas Plugin::Favorites::OPMLFavorites::add automatically adds to the end.

this is a possible fix (adds to end when an index is not specified):
Index: server/Slim/Plugin/Favorites/Plugin.pm
===================================================================
--- server/Slim/Plugin/Favorites/Plugin.pm	(revision 17145)
+++ server/Slim/Plugin/Favorites/Plugin.pm	(working copy)
@@ -741,7 +741,11 @@
 			return;
 		}
 
-		splice @$level, $i, 0, $entry;
+		if (defined $i) {
+			splice @$level, $i, 0, $entry;
+		} else { # with no specified index, place automatically at the end
+			push @$level, $entry;
+		}
 
 		$favs->save;
 
Comment 2 Ben Klaas 2008-02-04 08:00:08 UTC
KDF's patch is a winner. Checked in with change 17164
Comment 3 James Richardson 2008-05-15 13:03:00 UTC
This bug has recently been fixed in the latest release of SqueezeCenter 7.0.1

Please try that version, if you still see the error, then reopen this bug.

To download this version, please navigate to: http://www.slimdevices.com/su_downloads.html