Re: [Banshee-List] Smart Playlist plugin
- From: "Gabriel Burt" <gabriel burt gmail com>
- To: banshee-list gnome org
- Subject: Re: [Banshee-List] Smart Playlist plugin
- Date: Wed, 29 Mar 2006 14:57:45 -0600
On 3/29/06, Russ Brown <pickscrape gmail com> wrote:
> I don't know a great deal about it, but I'd have thought that one good
> way to go about doing this would be to implement smart playlists as
> views in the database. That way, you don't need to worry about changes
> to the track data, and smart playlists themselves don't take up any
> space (other than the space to store the view definition, which is
> peanuts).
>
> If you have a decent data model and sensible indexing, it will be very
> fast and changes will take effect immediately.
>
> Note that this also makes it relatively easy to create chained smart
> playlists such that iTunes can do: you can use the presence (or not) of
> a song in one playlist as criteria for another.
>
> I'm by no means an expert on sqlite, but views created for use as smart
> playlists could be stored in a different 'database' to the core banshee
> tables, to avoid name clashes.
Hi Russ. Thanks for the ideas.
The way I've started implementing it is by defining an adaptor class
around the PlaylistSource that has a query field associated with it.
I create a new database table (SmartPlaylists) that has PlaylistID and
Condition columns so I know which PlaylistSources are Smart. So
essentially I am doing a "view" on the database, just by storing the
SQL condition for the smart playlists. By wrapping a normal
PlaylistSource I effectively get a "view cache", and it's very cheap
to test changed/added songs against the Condition and add/remove them
if needed and I can incrementally change the GUI. This way of doing
it won't prevent us from chaining playlists.
Gabriel
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]