Bug 9132 - status command do not return updated ratings until SC restart
: status command do not return updated ratings until SC restart
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: CLI
: unspecified
: PC Windows Vista
: P3 minor (vote)
: 7.x
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-08-13 07:57 UTC by Joggs
Modified: 2009-07-31 10:27 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joggs 2008-08-13 07:57:25 UTC
If i send in a rating for a song with trackstat setrating 80 and after that do a {playerid} status 0 99999 tags:R , I will not get the rating for the updated song in my response.
If I do a songs 0 9999 album_id:{0} tags:R , I get the rating so it is only for the status command you don't receive the updated ratings

If I restart squeezecenter I get the new rating in my response.
Comment 1 Michael Herger 2008-08-14 01:00:14 UTC
Please don't preset targets.
Comment 2 James Richardson 2008-10-30 14:06:38 UTC
Would this be yours to address
Comment 3 Michael Herger 2008-10-30 14:26:29 UTC
QA to reproduce
Comment 4 Ross Levine 2008-11-12 18:03:11 UTC
I'm confused, I thought trackstat only allows ratings 1-10?
Comment 5 Joggs 2008-11-12 22:58:31 UTC
Yes, 1-10 but the api can handle different formats 
100 = 10 or 5
90=9 or 4,5
80=8 or 4
and so on..
Comment 6 Ross Levine 2008-11-14 12:45:39 UTC
Thanks Joggs. Now I have questions about the status inquiry, namely I don't see anything trackstat related when I do <playerid> status calls. 

Would you mind sharing the exact CLI commands you're using, the responses, and what you expect as a response? It sure would help me a lot. :-)
Comment 7 Joerg Schwieder 2008-11-14 12:47:59 UTC
Are you sure this is TrackStat related at all?
Are there any other CLI commands that use "%"?
Comment 8 Erland Isaksson 2008-11-15 09:14:30 UTC
(In reply to comment #6)
> Thanks Joggs. Now I have questions about the status inquiry, namely I don't see
> anything trackstat related when I do <playerid> status calls. 
> 

TrackStat only sets the rating in the standard tracks table in the SqueezeCenter database. When you run the status query I'm guessing that the status command reads the rating information from the tracks table. I'm pretty sure TrackStat isn't involved when you run the status command, it should only be involved when you change ratings.
Comment 9 Joggs 2008-11-16 00:55:43 UTC
I agree with Erland.
Stage 1: 
I change the song rating which sets the song rating in the sq database. So far so good, the setting is now in the database.

Stage2: If I now want to see the updated rating I can do it by using 

a) songs 0 9999 album_id:{0} tags:R -> I get the new rating in the response. Everything works as expected.

b) {playerid} status 0 99999 tags:R -> This will not display the new rating, rather the old one which to me seems like some kind of caching because if i restart SQ I will get the new rating.



Comment 10 Ross Levine 2008-11-18 17:12:22 UTC
Thanks Erland, Joggs, I'm not able to reproduce this as you describe. Setting the rating from webUI also exhibits this issue. Steps to reproduce:

Set a rating on for a file in trackstat, I used the webUI and set it to 4 stars (80).

Use this command in CLI: songs 0 9999 album_id{0} tags:R

Note the rating is 80%, now use this command in CLI: (playerid) status 0 9999 tags:R

Note the rating is 80%, now change the rating, again I used webUI and set it to 2 stars (40)

Try both CLI commands and notice that the status command is not updated, and the tag command is updated. Restart SqueezeCenter and the status command shows the updated rating. 

Thanks again for making this clear Joggs. Erland, I noticed your wiki entry for trackstat makes no mention of the status command, do you feel it should be supported? Would you be the right person to work on this?
Comment 11 Ross Levine 2008-11-18 17:13:28 UTC
Correction to my last comment I *AM* able to reproduce. Normally I proof-read, my bad!
Comment 12 Ross Levine 2008-12-11 17:46:25 UTC
Michael let me know if you need anything else from QA. 
Comment 13 Michael Herger 2008-12-12 01:32:15 UTC
I guess this is only related to the TrackStat plugin?

If so: how does it write the values to the DB? AFAICT the status query code is returning whatever is in the DB. I can only assume that it's not correctly written back before SC is shut down.
Comment 14 Erland Isaksson 2008-12-12 08:43:29 UTC
(In reply to comment #13)
> I guess this is only related to the TrackStat plugin?
> 
> If so: how does it write the values to the DB? AFAICT the status query code is
> returning whatever is in the DB. I can only assume that it's not correctly
> written back before SC is shut down.
> 

TrackStat makes these calls on a Slim::Schema:Track object

$track->persistent->set('rating' => $rating);
$track->persistent->update();
Comment 15 Michael Herger 2009-01-08 10:16:10 UTC
change 24574 - playlist track objects can be outdated, if track rating or something has been changed since tracks have been queued up. If rating is requested in the status query, force the track object in the client's playlist to be updated
Comment 16 James Richardson 2009-01-22 09:58:09 UTC
Fixed - Closed Message (SC)

This bug has been fixed in the 7.3.3 release version of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 17 James Richardson 2009-01-22 13:53:30 UTC
Correction: SqueezeCenter version is 7.3.2
Comment 18 Chris Owens 2009-07-31 10:27:09 UTC
Reduce number of active targets for SC