[mythtv-users] Multi-disc ordering in MythMusic

Andrew Berry andrewberry at sentex.net
Wed Jul 23 17:47:42 UTC 2008


Hi,

I have my iTunes library stored on a network server, and MythMusic is  
set to scan that directory for music to play. Everything almost works  
perfectly, except for CD sets with more than one disc. Instead of  
displaying and playing in disc order, it plays track 1 from every  
disc, track 2, etc. On import, I noticed that the disc_number and  
disc_count columns were empty, so I filled them in with some sql-fu as  
below, but MythMusic still doesn't seem to display properly. Anyone  
know how to make it work?

To set the disc_number, and I just replaced the appropriate number  
each time. It would probably be better to grab it from tags, but this  
was easy and works:

UPDATE music_songs SET disc_number = 1 WHERE filename REGEXP '1- 
[0-9]+ .*'

To then determine the number of discs in each album:

CREATE TEMPORARY TABLE max_disc SELECT album_id, MAX(disc_number) as  
disc_count FROM music_songs WHERE disc_number > 0 GROUP BY album_id;

UPDATE music_songs, max_disc SET music_songs.disc_count =  
max_disc.disc_count WHERE music_songs.album_id = max_disc.album_id;

Thanks,
--Andrew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2692 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20080723/78e22900/attachment.bin 


More information about the mythtv-users mailing list