[mythtv] MythMusic Patch Help

thor mythtv at lamedomainname.com
Tue Jul 8 17:27:05 EDT 2003

On Tuesday 08 July 2003 06:58 pm, m0j0.j0j0 wrote:
> Hi-
> When the MythMusic GUI (which is excellent now!) was reworked a while
> back, the "intelligent" playlist function was broken. Although this
> playlist was incredibly lame to begin with, after the change it was
> actually even worse and picked the lowest rated songs first. duh!

	I re-implemented the intelligent playlist stuff when I rewrote the GUI. Not 
suprising I didn't get it right.

> In the patch I wrote some code to grab the minimum and maximum values
> for a couple columns using only the songs selected in the current
> playlist. 

	This is going in the right direction, but a few comments:

		AllMusic already has all of the metadata, so you should need to be passing 
around a db pointer to load it. Part of the recent speedup in mythmusic comes 
from the fact that the database is only touched on startup and shutdown (with 
a couple of other fairly rare exceptions). If you need AllMusic to load 
and/or hold data differently, it should happen in the Loading thread.

		Similarily, the PlaylistsContainer has a pointer to AllMusic metadata, so it 
should just ask for information from that object (in memory) rather than 
querying the database.

		I may be missing some subtlety here (hey, I'm the guy who reversed the order 
in the first place), but why can't you do what you want to do but simpling 
changing the algebra of the existing code (rather than adding a lot of new db 
queries, temporary objects, etc. etc.).

	If you can simplify your improvement, I'd be more than happy to commit it.

> What is the difference between MusicNode::writeTree and
> Playlist::writeTree? So far I've only really updated
> Playlist::writeTree, but that seems to have made the playlist work as I
> had envisioned. Am I missing something here? Should I just make them
> both the same?

	The Playlist writes to the GenericTree only songs that are on a playlist. 
MusicNode writes out data for "All My Music", so you can actually play your 
whole collection (outside of a playlist) in linear, random, or "smart" order.

- thor

More information about the mythtv-dev mailing list