Bug 8645 - Indication of favorite doesnt work for first favorite
: Indication of favorite doesnt work for first favorite
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Web Interface
: 7.1
: PC Other
: -- minor (vote)
: ---
Assigned To: Unassigned bug - please assign me!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-03 15:57 UTC by Erland Isaksson
Modified: 2008-07-04 00:38 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 Erland Isaksson 2008-07-03 15:57:55 UTC
It seems like the favorite indication icon doesn't work correctly in the web interface for the first favorite. It works perfectly for the second and all the rest of the favorities.

To reproduce:
1. Make sure you have no favorites
2. Goto Random Mix and click on a favorite icon besides "Random Songs"

The result is that a favorite is added but the favorite icon beside "Random Songs" never changes to a "delete favorite" icon. Due to this it also not possible to delete the first favorite from the "Random Mix" page.

The Random Mix favorite is just an example, the behaviour is the same also for other favorites. The problem only occurs for the favorite with position 0.

I suspect the problem might be related to the fact that the findUrl function in Slim/Plugin/Favorite/OpmlFavorite.pm return the favorite index and this will be 0 for the first favorite. 0 is probably interpreted as "no favorite found" somewhere in the code.
Comment 1 Michael Herger 2008-07-04 00:38:24 UTC
change 21500 - favorite IDs are zero based, check whether they're defined instead of relying on them being > 0