Accessing uids

Jeff Mitchell kde-dev at emailgoeshere.com
Mon Aug 11 18:37:48 CEST 2008


Today I was working on making playlists AFT-happy, which has been a 
thorn since 1.4 when it was impossible, and I ran into a stumbling block.

SqlMeta lives inside src/collection/sqlcollection.  This is built 
separately, not a part of amaroklib.

I need to call the uid() method of SqlTrack, if the casting to SqlTrack 
works.  But I can't cast it, because I can't tell it about SqlMeta.

So I have the following options:

1) Move SqlMeta into src/meta and have it be built into amaroklib.  One 
could argue that all known types of meta should live together so that 
any part of Amarok can take advantage of specific features of different 
Meta types.  One could also argue the opposite  :-)

2) Add a uid() function into Meta::Track.  While some may argue that 
this may not really "belong" to a track, remember that uidUrl already 
exists, which in many cases just puts this uid into a url format, so it 
would essentially be a helper method so that one doesn't have to strip 
the url-ness all over the place.  Most existing collections could simply 
return the same as uidUrl().

3) Restructure things in the database such that UIDs aren't what's 
stored, but rather uidUrls are stored in the uniqueid fields.  This 
involves a lot more foo elsewhere, but is doable, if rather awkward and 
somewhat of a waste of space.


Thoughts?

--Jeff


More information about the Amarok-devel mailing list