[mythtv] [PATCH] MythMusic smart playlist update

Stutty stutty at gmail.com
Wed Apr 6 06:29:21 UTC 2005


Just on may way out the door, (been waiting for this patch for a
while! - currently hacked my version to support a 'within' field i.e.
within X days of lastplayed, etc.).

Sorry can't answer your questions or give any feedback yet :(, but
have a question of my own:

Can you make it support empty playlists, I quiet often would like to
create playlists before I have anything stored in them? For instance
due to the date added issue, to start with there won't be anything in
my 'Recently Added' playlist.

I also sync the mythdatabase to my ipod, which may match songs where
myth doesn't (okay mainly the date fields again).

Thanks,

will try the patch tonight,

Paul

On Apr 5, 2005 6:34 PM, Paul <mythtv at dsl.pipex.com> wrote:
> Add the two missing  field types (boolean and date) to the smart playlist
> editor. Adds the compilation_artist (string), compilation (boolean),
> lastplayed (date) and date_added (date) fields.
> 
> Adds a dialog to enter the date value. Allows for an explicit date or a
> dynamic date that will be updated every time the smart playlist is run.
> eg. '$DATE - 30 days' will be replaced with the current date minus 30 days.
> Allows you to create playlists like "Tracks that have been imported in the
> last 30 days" or "Tracks that haven't been played in over a year" for
> example.
> 
> Changes Metadata::dumpToDatabase(...) to update the date_added field when
> a track is inserted into the database. The field is already there in the DB
> we might as well use it :-)
> 
> The libmyth patch adds the MythRadioButton widget used by the
> date dialog and also updates the MythListBox widget to change the
> selected item color when it looses/gains focus to make it a little
> easier to work out which widget has the current focus. Also changes
> MythListBox to allow you to use LEFT/RIGHT arrow key presses
> to move focus to previous/next widget. This fixes a problem in the
> MythTV Select Phrase dialog among others where if you where
> using a remote that doesn't have TAB bound to a key the focus could
> get stuck on the ListBox with no way to move focus on to the other widgets.
> 
> Two questions for any MySQL experts out there.
> 
> 1. What's the best way to extract the date part of a timestamp/datetime
> field. From reading the docs I see that MySQL 4.1.1 now has a DATE( )
> function to do it. But what is the best way to do it in earlier versions.
> The
> best I could come up with is FROM_DAYS(TO_DAYS(date_added)).
> Just curious to know if that is the best way or not.
> 
> 2. From reading the MySQL docs it would appear that using a timestamp for
> the lastplayed field in the MythMusic DB would not be the best field type to
> use
> because it looks like timestamp fields always get updated to the current
> date and time whenever an update takes place on a record unless the
> timestamp
> field is explicitly changed in the update.
> If I have understood the docs correctly that would mean that simply changing
> the rating field, for example, would also change the lastplayed field. Is
> this correct?
> 
> 
> Paul
> 
> 
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> 
> 
> 
>


More information about the mythtv-dev mailing list