Bugzilla – Bug 4052
Navigating to another album under Now Playing displays last track, not track 1
Last modified: 2008-09-15 14:39:24 UTC
This is with SlimServer v6.5b1 - 9424 (Windows XP - EN - cp1252, Perl Version: v5.8.7 MSWin32-x86-multi-thread, MySQL Version: 5.0.22-community-nt). I'll try to explain this one so it makes sense. It's small but I think it's a bug. 1. Choose an artist with more than one album in the library, e.g. Album1 by ArtistA and Album2 by ArtistA. 2. Use browse/search to play Album1. 3. From Now Playing, scroll to any track on the album, e.g. Track5. Go right to the track properties. 4. Scroll down to Artist, and then right to Albums. 5. Go right in to Album2. 6. The track shown is the last track in Album2. It's a bit odd - it'd be more logical to show the first track in Album2. This might be a feature, but I don't imagine it is. All of the other track properties show the first track. The only exception to this that I've found is this other Now Playing scenario. 1. Choose any album, e.g. Album1 by ArtistA. 2. Use browse/search to play Album1. 3. From Now Playing, scroll to any track on the album, e.g. Track5. Go right to the track properties. 4. Scroll down to Artist, and then right to Albums. 5. Go right in to Album1. 6. The track shown is Track5 in Album2. Showing the current track might be intended. Personally, I�m not so bothered by this one as it seems logical although just showing Track1 might be better. Thanks.
going to the item based on the currently playing track was a request. I can give you the email of the person, if you wish to argue it out in private.
No, you've got me wrong. I'm not looking for a pointless for/against discussion of a feature (of the kind that you don't like either). It�s often hard to know what is a feature and what is a bug with things so minor as this. I'm happy to ignore the second one since it's a feature. I mentioned it as it seemed like a behaviour that might have a bearing on the first case.
good to hear. The first case problem is probably due to the section of code in Buttons/BrowseDB.pm, lines 809-819. Items are skipped through, and stop on a match for the track info when the user left Now Playing. As such, when nothing is found, it ends up at the end of a given list. Solution could be: my $j = $#array; for my $item (@items) { last if blessed($item) && $selection == $item->id; $j--; } # set index to matching item from this level $listIndex = $j;
make that: my $j = $#items;
better solution, tested: my $j = scalar @items; for my $item (@items) { $j--; last if blessed($item) && $selection == $item->id; } # set index to matching item from this level $listIndex = $j;
in trunk at change 9550 to make it available to others to test/verify. will merge to 6.5 if this works well.
ping...let me know if this is the right patch. I can still merge if anyone will verify.
Yes, looks good.
Commited to 6.5
The change to v6.5 at r9668 fixes the first case but it breaks the second case. Rather than selecting the currently playing track from the album, it displays another track. It displays tracks in reverse order. The old behaviour was to display the currently track. So: 1. Choose any album, e.g. Album1 by ArtistA. 2. Use browse/search to play Album1 (say it has 13 tracks). 3. From Now Playing, scroll to Track1. Go right to the track properties. 4. Scroll down to Artist, and then right to Albums. 5. Go right in to Album1. 6. The track shown is the Track13 in Album1. ...continues throughout the playlist... 7. From Now Playing, scroll to Track2. Go right to the track properties. 8. Scroll down to Artist, and then right to Albums. 9. Go right in to Album1. 10. The track shown is the Track12 in Album1. ...until... 7. From Now Playing, scroll to Track13. Go right to the track properties. 8. Scroll down to Artist, and then right to Albums. 9. Go right in to Album1. 10. The track shown is the Track1 in Album1.
the patch does nothing about the track order. as for displaying another track, it could perhaps be off by one. does that seem to fit?
It's not the track order (of the tracks displayed when you go right) but the item that displayed first. No, it's reverse rather than being off by one. If P is the track in now playing that you start from (to go right), and N is the track that displayed for the album (after going right) and T is the total number of tracks on the album, then N = T - (P - 1).
dunno why I didn't do it this way before. here is a cleaner method: my $j = 0; # search for matching selection in reverse order, so if not found we end up at item 0. for my $item (@items) { if (blessed($item) && $selection == $item->id) { $listIndex = $j; last; } $j++; } can merge in tonight.
fixed with better method at change 9729. closing again, but feel free to reopen if you have issues.
Works for me - thanks.