[mythtv] [PATCH] Add smart playlists to mythmusic

Isaac Richards ijr at case.edu
Wed Feb 2 09:07:06 UTC 2005

On Monday 31 January 2005 11:20 am, Paul wrote:
> This patch allows you to create playlists that are dynamically updated
> every time you select one by running a simple SQL query on the
> musicmetadata table. It allow you to, for example, create a playlist
> that contains all the tracks by a particular artist, all your favourite
> tracks, all the tracks from a genre etc. You can also create an order by
> clause which allows you to order the tracks how you like and limit the
> number of tracks in a playlist. Playlists can be grouped together by
> category. You could for example create categories called 'By Artist',
> 'By Genre' etc. that way you don't get one big list of playlists but
> several playlist grouped together by a category. The patch adds a few
> demo smartplaylists to get you started.
> I haven't been able to spend as much time on  testing as I would have
> liked but it seems to work OK for me. I think I have made all the query's
> utf8 friendly. As always if anybody spots any problems please let me know
> and I will try to fix it.
> One thing that is missing from the patch is support for the bool and date
> type fields. Which means you can't query the 'compilation' or 'last_played'
> fields which is no big loss. I will try and add them later.

This looks pretty good.  It'd be better if it didn't use Qt widgets directly, 
but, that's ok for now.

I do have one request before applying, though.  Since you're building all your 
queries manually, would you mind converting them to use 
QSqlDriver::formatValue() to do all the quoting/escaping, instead of doing 
that manually?  This should ensure that everything's done properly..


More information about the mythtv-dev mailing list