ziggyb63;380621 Wrote: 
> Hi Jezbo. 
> 
> I'm running 7.2, and 1.0.6 helped but nope, it still does not pick up
> all of the tracks or albums from SC. The muso.log file does not show a
> lot of the tracks I know are there - what can I do to assist you? I
> have some MySQL GUI tools and can run a few queries if you PM me?
> 
> Nice job so far with the UI, love it!

I'll post the queries on here so others may try it too. This is the
query it runs to scan the SC database:


Code:
--------------------
    
  SELECT t.id, t.url,
  CAST(t.title AS CHAR(10000) CHARACTER SET utf8) track,
  t.secs,
  tp.lastplayed,
  tp.rating,
  CAST(a.title AS CHAR(10000) CHARACTER SET utf8) album,
  a.Year,
  CAST(g.name AS CHAR(10000) CHARACTER SET utf8) genre,
  CAST(c.name AS CHAR(10000) CHARACTER SET utf8) artist,
  t.tracknum,
  tp.playcount
  FROM tracks t
  JOIN tracks_persistent tp ON (tp.id = t.id)
  LEFT OUTER JOIN genre_track gt ON (t.id = gt.track)
  LEFT OUTER JOIN genres g ON (gt.genre = g.id)
  LEFT OUTER JOIN albums a ON (t.album = a.id)
  LEFT OUTER JOIN contributor_track ct ON (ct.track = t.id and ct.role = 1)
  LEFT OUTER JOIN contributors c ON (ct.contributor = c.id)
  WHERE lower(t.url) NOT LIKE '%.cue'
  
--------------------


Or, if you have the trackstat plugin it does things slightly
differently:


Code:
--------------------
    
  SELECT t.id, t.url,
  CAST(t.title AS CHAR(10000) CHARACTER SET utf8) track,
  t.secs,
  ifnull(s.lastPlayed, tp.lastPlayed) lastplayed,
  ifnull(s.rating, tp.rating) rating,
  CAST(a.title AS CHAR(10000) CHARACTER SET utf8) album,
  a.Year,
  CAST(g.name AS CHAR(10000) CHARACTER SET utf8) genre,
  CAST(c.name AS CHAR(10000) CHARACTER SET utf8) artist,
  t.tracknum,
  ifnull(s.playcount,tp.playcount) playcount
  FROM tracks t
  JOIN tracks_persistent tp ON (tp.id = t.id)
  LEFT OUTER JOIN track_statistics s ON (s.url = t.url)
  LEFT OUTER JOIN genre_track gt ON (t.id = gt.track)
  LEFT OUTER JOIN genres g ON (gt.genre = g.id)
  LEFT OUTER JOIN albums a ON (t.album = a.id)
  LEFT OUTER JOIN contributor_track ct ON (ct.track = t.id and ct.role = 1)
  LEFT OUTER JOIN contributors c ON (ct.contributor = c.id)
  WHERE lower(t.url) NOT LIKE '%.cue'
  
--------------------


That is unless you are on an older version of the SC database (with no
tracks_persistent table) in which case it does something different
again. You can compare the number of tracks returned with that from
querying tracks alone.


-- 
jezbo
------------------------------------------------------------------------
jezbo's Profile: http://forums.slimdevices.com/member.php?userid=9888
View this thread: http://forums.slimdevices.com/showthread.php?t=57629

_______________________________________________
plugins mailing list
plugins@lists.slimdevices.com
http://lists.slimdevices.com/lists/listinfo/plugins

Reply via email to