[mythtv] Re: [PATCH] Add smart playlists to mythmusic

Paul mythtv at dsl.pipex.com
Sat Feb 5 19:19:22 UTC 2005


Isaac wrote:

>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.
><snip>
>> 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..

>Isaac

Smart Playlist Patch v2

Both the quick playlists and the smartplaylist now use
QSqlDriver::formatValue().
I couldn't find any example code to work from in Myth or by searching the
web.
Not sure what the best way of getting a QSqlField for a field is but it all
seems to
work well.

On issue I did notice is the recent changes make to
MythThemedDialog::paintEvent()
causes the MythMusic screen to not redraw properly when returning from the
SmartPlaylist editor dialog. You can only see the outer edges around the
selection dialog
but it clearly has not redrawn itself. If I comment out the recent changes
the screen then
redraws properly.

Paul
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smartplaylist-v2.patch.tar.gz
Type: application/octet-stream
Size: 17098 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050205/63982fc6/smartplaylist-v2.patch.tar.obj


More information about the mythtv-dev mailing list