I am using MediaTomb on a server and the uPnP plugin in foobar2000 to playback files from it. Unfortunately the track list reported by MediaTomb when selecting Albums does not seem to respect disc number. I inquired at the foobar2000 forums with the following post describing my problem:
Unfortunately, when I select an album from mediatomb in the UPnP browser, I am provided with a track list populated with Artist/album, Track no, Title / Track artist, Duration, and Date only. So the tracks come across ordered as Disc 1 Track 1, Disc 2 Track 1, Disc 3 Track 1, … It appears that only when I manually select one of the tracks for playback does the disc number for that track get loaded. After preloading them in this fashion I can re-sort the playlist by clicking the "Track no" column header and foobar2000 displays them in the correct order in the playlist (Disc 1 Track 1 -> X, Disc 2 Track 1 -> Y). Therefore for these multi-CD albums I have to manually preload each individual track to get the disc number field populated and play them back straight through. This is quite burdensome as I have some classical symphony sets of 10 CDs or more, which I am forced to manually preload 100s of tracks or hunt and peck to listen to them in the proper order. Is it possible to make the UPnP browser automatically populate the disc number in the playlist when albums are selected?
This was the uPnP plugin author's response:
There's no concept of discnumber in UPnP metadata land (except when foo_upnp is the server but this is a custom field), so it is likely that MediaTomb sorts the tracks by tracknumber like you describe ( Disc 1 Track 1, Disc 2 Track 1, Disc 3 Track 1). The UPnP Browser cannot change that as discnumber is not available, and it just displays the track in the order MediaTomb sort them. The discnumber you see when playing a track comes from foobar2000 http reader that extracted the tag.
The only solution I can see to have MediaTomb use the correct order, is to prepend the discnumber to the tracknumber in your files. Set track numbers to 101, 102, … 201, 202, …
You can also check if it is possible to configure MediaTomb with a custom sort order for albums, that would sort first by discnumber and then by tracknumber, but I doubt this is possible.
He seems to say the plugin is coded to simply list the tracks in the order provided by MediaTomb. Is it possible to make MediaTomb respect the disc number field in the metadata when reporting tracks in Album mode over uPnP?
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I believe it's possible with the aux property that is available via scripting. It's specifically mentioned in section 3.1.1 of the scripting documentation.
You will also need to have MediaTomb compiled with libextractor support which it most likely isn't by default. You then need to configure MediaTomb to extract the metadata you want via <library-options> in config.xml. This option is explained in detail in section 6.2 of the Mediatomb documentation.
Finally you will also need to modify the import.js script to make use of the extra metadata available. This is also explained in the scripting documentation.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think the aux property will help.
If a folder/container is of type "UPNP_CLASS_CONTAINER_MUSIC_ALBUM", mediatomb internally orders them by the track number stored in the database. There is nothing you can do against that.
You would have to modify the track number during import, prepending the disc number to the track number.. which might work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That now results in the album containing the track in this order:
1 - 01 ...
2 - 01 ...
1 - 02 ...
2 - 02 ...
...
i.e. as before, but now with disc and track number.
I'll have a look into the code to see whether I can make the album appear in the correct order. I also thought about modifying the track number but that means that for tracks on disc #2 and later you need the number of tracks on all earlier discs. I don't think that information is available, also the earlier tracks might not have been imported yet. You could of course just add a big number for each disc, say 100.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am using MediaTomb on a server and the uPnP plugin in foobar2000 to playback files from it. Unfortunately the track list reported by MediaTomb when selecting Albums does not seem to respect disc number. I inquired at the foobar2000 forums with the following post describing my problem:
This was the uPnP plugin author's response:
He seems to say the plugin is coded to simply list the tracks in the order provided by MediaTomb. Is it possible to make MediaTomb respect the disc number field in the metadata when reporting tracks in Album mode over uPnP?
Thank you.
I believe it's possible with the aux property that is available via scripting. It's specifically mentioned in section 3.1.1 of the scripting documentation.
You will also need to have MediaTomb compiled with libextractor support which it most likely isn't by default. You then need to configure MediaTomb to extract the metadata you want via <library-options> in config.xml. This option is explained in detail in section 6.2 of the Mediatomb documentation.
Finally you will also need to modify the import.js script to make use of the extra metadata available. This is also explained in the scripting documentation.
I don't think the aux property will help.
If a folder/container is of type "UPNP_CLASS_CONTAINER_MUSIC_ALBUM", mediatomb internally orders them by the track number stored in the database. There is nothing you can do against that.
You would have to modify the track number during import, prepending the disc number to the track number.. which might work.
I tried it, and I failed:
Mediatomb on Debian 7 is compiled with taglib support, as the compile info shows:
$ mediatomb --compile-info|grep tagl taglib: yes
My ogg files have a DISCNUMBER property as ogginfo shows:
The documentation__ told me to add this tag to the <id3> section::
__ http://mediatomb.cc/pages/documentation
This data should now be available in obj.aux['DISCNUMBER'] as
the
scripting docs
__ say::__ http://mediatomb.cc/pages/scripting
But I only got "undefined: ..." instead of the disc number.
This is probably because taglib's
tag class
__ only supports the defaulttags:
__ http://taglib.github.io/api/classTagLib_1_1Tag.html#a4fb9d5edf5cf9549f23b46e7a2572c4e
I tried it with an mp3 file, there it worked.
config.xml
import.js
That now results in the album containing the track in this order:
1 - 01 ...
2 - 01 ...
1 - 02 ...
2 - 02 ...
...
i.e. as before, but now with disc and track number.
I'll have a look into the code to see whether I can make the album appear in the correct order. I also thought about modifying the track number but that means that for tracks on disc #2 and later you need the number of tracks on all earlier discs. I don't think that information is available, also the earlier tracks might not have been imported yet. You could of course just add a big number for each disc, say 100.