GNOME Bugzilla – Bug 639809
MediaExport plugin does not account for disc number when sorting
Last modified: 2012-08-12 17:54:40 UTC
Created attachment 178580 [details] [review]
Account for disc number when sorting.
The MediaExport plugin does not take into account the disc number, GST_TAG_ALBUM_VOLUME_NUMBER, when sorting. Class Rygel.MediaExport.SQLFactory looks at the track number when sorting. Indeed, MusicItem does not even have the disc number. As a result, multiple-disc sets are not sorted properly. The tracks from the different discs get grouped together by track number.
I see two ways to fix this. The first is to add disc_number to MusicItem and use it where necessary.
The second is more of a work around than anything. In fill_music_item() in rygel-media-export-item.vala, make track_number do double duty by reflecting both the track number and the disc number with something like:
dlna_info.info.tags.get_uint (TAG_TRACK_NUMBER, out tmp);
item.track_number = (int) tmp;
dlna_info.info.tags.get_uint (TAG_ALBUM_VOLUME_NUMBER, out tmp);
item.track_number += (int)(tmp * 1000);
In fact, I am attaching this second option as a patch against the gnome-2-32 branch since it at least get things sorted properly on my DLNA clients, and I really do not know VALA.
Hi, thanks for your patch. The first way can't be done since UPnP has no (easy) understanding of disc numbers.