[mythtv] Heads up: Smart playlists in MythMusic

Kevin Kuphal kevin.kuphal at myrealbox.com
Mon Jan 26 17:57:36 EST 2004


Sounds good to me.  Moving to a WHERE clause is trivial (actually simplifies
the code inside MythMusic that I have).  Let me double check the recursive
playlists that thor brought up and if you want to shoot me an email offline,
we can swap code and make sure they interoperate before posting it here.

Kevin

> -----Original Message-----
> From: mythtv-dev-bounces at mythtv.org 
> [mailto:mythtv-dev-bounces at mythtv.org] On Behalf Of Steele Price
> Sent: Monday, January 26, 2004 4:44 PM
> To: Development of mythtv
> Subject: Re: [mythtv] Heads up: Smart playlists in MythMusic
> 
> 
> You are not stepping on any toes here, in fact your input is greatly 
> welcomed.
> 
> Embedding a WHERE clause is pretty safe here. If it's invalid 
> its just 
> going to barf it, so test for an invalid response.  If you 
> are worried 
> about SQL Injection, you can add a security test for that 
> which is alot 
> faster than the parser would be.
> 
> We disussed this at length in the irc channel a few weeks ago, the 
> concensus was to use a seperate table for these and to store 
> the WHERE 
> clause.
> 
> I would be really happy if we could maybe work on this 
> together.  I am 
> NOT a c++ guy, if you can do the c++ and the mythmusic diffs, 
> I can do 
> the database and PHP parts for mythweb (which are basically already 
> done... but need to be redone to accomodate for a seperate 
> table at the 
> lead developer of mythmusic's request)
> 
> Steele Price
> CTO
> Digital Dreamshop, LLC.
> http://xtcp.net
> 
> 
> Kevin Kuphal wrote:
> 
> >I hadn't seen mention of your work so I had no idea it was 
> in progress. 
> >Regarding the format, I only opted not to embed a SQL 
> statement so that 
> >whatever frontend didn't need to "know" the SQL necessary so that if 
> >something did change in the database, only the parser had to be 
> >modified (not both the graphical and/or web frontends).  Plus, it's 
> >probably just me, but embedding SQL just rubs me the wrong way.  By 
> >parsing I can double check the inputs from the frontends to be sure 
> >things are valid.
> >
> >I imagined exactly the type of frontend you mention as 
> iTunes does with 
> >any/all and then a series of statements.  I just hadn't 
> gotten to the 
> >frontend part yet and wanted to get at least the backend support in 
> >place so people could use it.
> >
> >If I've stepped on any toes here with this WIP, let me know, I'll be 
> >happy to let it go.
> >
> >Kevin
> >
> >  
> >
> >>-----Original Message-----
> >>From: mythtv-dev-bounces at mythtv.org
> >>[mailto:mythtv-dev-bounces at mythtv.org] On Behalf Of Steele Price
> >>Sent: Monday, January 26, 2004 2:36 PM
> >>To: Development of mythtv
> >>Subject: Re: [mythtv] Heads up: Smart playlists in MythMusic
> >>
> >>
> >>grrr......
> >>
> >>I already have mine setup to read a full where clause, not
> >>some strange 
> >>unknown protocol.
> >>
> >>I just parse the left 5 chars from the playlists field and
> >>resubmit the 
> >>query to get the intids from musicmetadata if it = 'WHERE'.
> >>
> >>If yours goes into cvs, I can just stop all my work and go with this
> >>method I suppose.  Though I would have to totally rethink the 
> >>frontend, 
> >>currently it looks pretty much the same as iTunes, where it 
> >>adds/subtracts rows for criteria and builds the where 
> clause for you.
> >>
> >>The frontend is done in PHP so it will work in mythweb, I
> >>just need to 
> >>convert it over to mythmusic.
> >>
> >>Steele Price
> >>CTO
> >>Digital Dreamshop
> >>http://xtcp.net
> >>
> >>
> >>
> >>Kevin Kuphal wrote:
> >>
> >>    
> >>
> >>>Just a heads up that I should be submitting a patch soon that adds
> >>>basic backend smart playlist support.  That is, right now, 
> >>>      
> >>>
> >>there is no
> >>    
> >>
> >>>GUI to configure it but you can edit the playlist entries in
> >>>      
> >>>
> >>the DB to
> >>    
> >>
> >>>configure.
> >>>
> >>>Right now a list is defined in place of the comma delimited list of
> >>>song Ids in the musicplaylist table like:
> >>>
> >>>smart:[any|all]:[field],[operand],[result];[...]
> >>>
> >>>any|all: Either any or all depending on whether you want all
> >>>      
> >>>
> >>conditions
> >>    
> >>
> >>>any|met
> >>>or any condition
> >>>field: any field from the musicmetadata table
> >>>operand: any valid SQL operator like =, <, >, LIKE, etc.
> >>>result: the value to test against.  Text must be quoted.
> >>>
> >>>So
> >>>
> >>>smart:all:artist,=,"Fuel";playcount,>,1
> >>>
> >>>Would generate a playlist at selection time with this SQL:
> >>>
> >>>SELECT intid FROM musicmetadata WHERE artist = "Fuel" AND
> >>>      
> >>>
> >>playcount >
> >>    
> >>
> >>>1;
> >>>
> >>>I have to do some more testing but it seems to work so far.
> >>>
> >>>Kevin
> >>>
> >>>
> >>> 
> >>>
> >>>-------------------------------------------------------------
> >>>      
> >>>
> >>----------
> >>    
> >>
> >>>-
> >>>
> >>>_______________________________________________
> >>>mythtv-dev mailing list
> >>>mythtv-dev at mythtv.org
> >>>http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> >>> 
> >>>
> >>>      
> >>>
> >>_______________________________________________
> >>mythtv-dev mailing list
> >>mythtv-dev at mythtv.org
> >>http://mythtv.org/cgi-> bin/mailman/listinfo/mythtv-dev
> >>
> >>    
> >>
> >
> >
> >  
> >
> >-------------------------------------------------------------
> ----------
> >-
> >
> >_______________________________________________
> >mythtv-dev mailing list
> >mythtv-dev at mythtv.org 
> >http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev
> >  
> >
> _______________________________________________
> 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