[mythtv-users] [PATCH] Mythweb -- Mythmusic playlist functionality AND Request for SQL help

thor mythtv at lamedomainname.com
Wed Oct 27 20:39:18 UTC 2004


On Wednesday 27 October 2004 02:45 pm, Christopher Flynn wrote:

> Perhaps I should take this over to the devlist but it almost seems
> silly to only allow for one playlist. I also think the database should
> be changed a little. we need a lookup table that consists of the
> playlistid and the songid (intid) we could then drop the songlist
> field and have individual entries that would have the playlist that
> the song belongs to and then the song itself.

 You can have as many playlists as you want (ie. rows in the playlist table). 
The default_playlist_storage (or whatever it's called, doing this from 
memory) is just for the state of the interface the last time the user was 
selecting songs. Similarily the backup_playlist_storage allows one level of 
recall in the interface (you can swap a playlist to "current", edit it, save 
it back, and the state of the playlist before a stored one was made current 
will be restored).

 Note that the playlist string (e.g. "37,4,21,1") can also have negative 
numbers (eg. "22,19,-34,-6"). Negative numbers refer to a playlist id (so you 
can have playlists on a playlist, and playlists within playlists within 
playlists, etc., etc.).

 One could conceivably design a better database schema to handle this. Over 
the past few years, many people have said something along the lines of, "a 
string of comma separated numbers seems like a silly way to do this, anyone 
mind if I come up with a better one?".  No one yet has.

- thor

 


More information about the mythtv-users mailing list