jezbo wrote: 
> 
> My muso<>LMS synch code is only reading, unless a rating is set in muso
> which isn't set in LMS in which case it updates your track_statistics
> table - this should be a short transaction, but I should probably do as
> you do to ensure it doesn't do this while LMS is scanning - how do you
> check this?
> 
It doesn't matter that it's a short transaction because the scanner
writes all the time so if it happens during scanning it's likely going
to crash the scanner in some situations. I had issue with increasing the
play count when the current track was played during scanning and that's
also an extremely short transaction.

I'm using a perl if-statement like this:

Code:
--------------------
    
  if($driver eq 'SQLite' && Slim::Music::Import->stillScanning && 
(!UNIVERSAL::can("Slim::Music::Import","externalScannerRunning") || 
Slim::Music::Import->externalScannerRunning)) {
  # Queue rating request and do it after scanning
  ....
  }
  
--------------------



jezbo wrote: 
> 
> Is there any possibility of a trackstat rating being set via the CLI?
> Then I could do this as needed when ratings are set and my synch process
> could be 100% read-only, which would be safer.
> 
Yes, TrackStat have a CLI interface, it's documented on the wiki:
http://wiki.slimdevices.com/index.php/TrackStat_plugin#CLI_interface

Just note that if you set them while scanning, you won't get the new
rating value when reading until the scanning is finished, because all
write requests are queued and executed after the scanner has finished.

Still, I definitely prefer that you use the CLI command instead of
writing directly to the database, because if I change the database
structure the CLI command is going to be backward compatible but the
database might not be, for example I recently added a "urlmd5" column in
the table which is very important to set if you add new rows to the
TrackStat tables.


------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=89450

_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/beta

Reply via email to