[Banshee-List] Help get us to a release/Last steps in porting smart playlists



Banshees!

There are just a few more things to do to have smart playlists
completely ported.  I would love it if somebody else wanted to do
them; it would be good to have others at least somewhat familiar with
the Hyena.Query and SmartPlaylist code, and would help us get trunk
released sooner.

So, if you're feeling up to it, please volunteer to tackle these - one
per person at a time please.  I've tried to give a detailed
description of the work to be done and relevant files - but by all
means e-mail me or contact me on irc (gabuag) if you need help.

1) Autorefresh for Time-based Smart Playlists

For smart playlists that have LastAdded or LastPlayed as a condition
or sort order, we need to automatically refresh them every minute or
so.  To implement this, implement TimeDependent on SmartPlaylistSource
by doing search of its ConditionTree for a QueryTermNode with a Field
== BansheeQuery.LastPlayedField etc, and also check its Order
property.  Then uncomment/fix up the timeout code in that file,
Banshee.SmartPlaylist.Gui/Editor.cs, and SmartPlaylistCore.cs.

2) Implement Limit by File Size/Duration

Limiting a smart playlist by the # of songs is easy, we just add a
LIMIT # to the SQL query.  My idea to simply, generically limit by
other fields is fill the smart playlist without a limit, then select
the ID and limit-column from that, adding up the limit column until it
reaches the threshold, then execute one delete command for the
remaining rows.  This is half-implemented in  the PruneSql method in
Hyena.Query/QueryOrder.cs.  The result of that method needs to be
executed on the database in SmartPlaylistSource's RateLimitedReload
method if (!Limit.RowBased).  The PruneSql method should probably be
moved to QueryLimit.cs.  The tricky part is making this work for Smart
Playlists but keeping Hyena free of any smart playlist/Banshee
specifics - might mean passing table/column names to the PruneSql
method.

3) Refresh Dependents When Reloaded

I implemented SmartPlaylistSource's DependsOn (SmartPlaylistSource
other_source) method - it does a depth-first scan of the
ConditionTree, similar to what will need to be done for task (1).
When a SmartPlaylistSource is Reloaded, it needs to reload the
SmartPlaylistSources that depend on it.  Right now, when a
DatabaseTrackInfo is updated, it causes the Library to reload, which
in turn reloads all its children - so this fix would need to work with
that - ideally reloading the smart playlists in the right order (eg
reload ones that have dependents first - see DependencyComparer in
SmartPlaylistCore - and maybe move it to SmartPlaylistSource), and
only having the dependents reload when the Library isn't already going
to reload them.

4) Implement 'New Smart Playlist From Search'

This is also largely done - see Banshee.Gui/SourceActions.cs - but
it's currently commented out.  The only real issue with this is when
you type in a search, if you don't specify a particular field to
search against, Banshee searches all the default fields.  But our
Banshee.SmartPlaylist.Gui/Editor.cs does not handle QueryTermNode's
that don't have a field.  Fix this by adding an entry to the
field-dropdowns in the editor for the default fields in
Hyena.Gui/Hyena.Query.Gui/QueryTermBox.cs.  You should probably add a
DefaultFieldsLabel property to Hyena/Hyena.Query/QueryFieldSet.cs -
and set it in Banshee.Services/Banshee.Query/BansheeQuery.cs - and use
that as the label in QueryTermBox.  With all that done, SourceActions
should probably trigger an UpdateActions whenever the user's search
changes - b/c it's cleared the action should not be sensitive.

General note:  Hyena* related files are in src/Libraries/Hyena*,
Banshee-specific GUI code is in src/Core/Banshee.ThickClient, and
Banshee non-GUI code is in src/Core/Banshee.Services/

Hope some of you are up to the challenge!

Gabriel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]