Urls in tables

Jeff Mitchell kde-dev at emailgoeshere.com
Wed Aug 13 13:40:22 CEST 2008


Eean, Hydrogen and I ran into a bit of a problem yesterday, which maybe is not 
a problem at all, but we're not sure.

The statistics and lyrics tables store urls as an integer reference to the 
urls table.  This means that although they are permanent tables, they only 
have relevance to tracks that were in the collection and remain in the 
collection.  Now, this may be appropriate -- lyrics are kind of track 
properties, and statistics are also track properties, and tracks are a 
property of the collection, so it's legitimate to say that these items are 
only supported on the tracks in the collection.  The question is, is this the 
correct answer, regardless of legitimacy.

There are arguments both ways -- requiring tracks to be in the collection 
certainly makes it easier to keep the tables from getting crufty...unless you 
*want* the statistics table, for instance, to contain play counts for every 
path you ever play, which may in fact be desired.  This would also let you 
remove a folder from your collection but still update statistics on tracks 
inside of it.  Another issue is whether a UNIQUE column can contain multiple 
values with NULL (although the UNIQUE part of the column could be 
removed...it's there mostly for safety).

It should be noted that playlists store urls not as urlids but as actual 
string urls, which is rather a requirement as you can add things to a 
playlist that are not in the sqlcollection. 

But that prompted Ian to have a thought as to whether the url table itself, 
currently a very sqlcollection-based table built by the collectionscanner, 
should have support for adding entries from outside the collectionscanner.  
Here are his thoughts from last night; he can respond to this with more 
detail if people are interested:

[23:17:02] <eeanm> jefferai: seems like the best solution is to make "being in 
the collection" not a requirement for the URL table
[23:18:01] <eeanm> might be a bit late to do that for now though
[23:18:05] <jefferai> what do you mean?
[23:18:18] <jefferai> the url table is built by the collection scanner
[23:22:59] <eeanm> jefferai: What I'm saying is that the collection scanner 
could be just one possible source for a new row in the table
[23:23:04] <eeanm> in the url table

Anyways, we decided that it's a good time to send it all over there while you 
all are together... 


More information about the Amarok-devel mailing list