Here's a more detailed and deep-dive in to why I created mpd-dbcreate.
First of all, when I say it was "wrong"...it was wrong for me. My massive old collection was part of the problem. I could have fixed half the issues by modifying the actual media on my drive. Would this have been easier? No. We're talking TBs of stuff. There's also a .0005% chance I'd regret modifying the collection like this in the future. I don't really want to go around changing it. It's bad enough I'm finding 20 year old garbage in folders I'd long forgotten about. "Oh, I'll remove the converted version later." I know from experience with a collection this large that those things rarely get found. There are probably still things messed up from the great-crash-and-recovery of 2002 that I....still haven't found....23 years later. Or the great backup and reset of 2005...which was 20 years ago. I finally fixed my Powerman 5000 album from 6.3 filenames though.
I never adopted databases. I still use traditional folder organization. Make a folder for an album, drop the files in that folder. Almost the same as the wall of CDs; except I could output file lists and search for where tracks were. At one point the collection was growing faster than I could keep up with it, so I continued to use the method that didn't require anything except picking files off the filesystem. Tagging? Didn't matter. Album\# title.ext, the artist is in there too so you could literally get basic information that way. I literally used Winamp up until 2016 when I switched to Foobar2000 because of SACD/DSD.
mpd, on the other hand, pretty much relies on database. The front-end you interact with is completely decoupled from the actual playback engine. Most clients to play "local" files have to stream them to mpd; which can cause issues. Trust me...Cantata didn't do this a way my build liked and I spent 2 days chasing down what turned out to be a client checkbox. It's annoying...and this is literally the thing I absolutely hate with a media player...and mpd was in fact on my list of stuff I refused to use because of the database limitation.
But it's the only thing that does SACD playback on Linux so we're gonna have to make this work.
So the database I made wasn't...horrible. The lack of tags in media wasn't nearly the issue I expected it to be. A few problems here and there...but nothing I can't fix if I ever have to. But there were issues with the database that made it either difficult and annoying to use; or downright impossible. They were somewhat fringe areas; but I saw some of them enough that I had to do something.
This is one that is likely to apply to more people than just me, so I'll mention it first. I had a number of albums that were broken in the database in one way or another. Some of them had tracks that would not play; others showed tracks from the cue, then tracks from another source. Sometimes I could make a playlist for an ablum by combing them...sometimes I just couldn't listen to that album in mpd.
FILE "01 311 - Freeze Time.flac" WAVE
TRACK 01 AUDIO
TITLE "Freeze Time"
ISRC USCA19900069
INDEX 01 00:00:00
FILE "02 311 - Come Original.flac" WAVE
TRACK 02 AUDIO
TITLE "Come Original"
ISRC USCA19900070
INDEX 01 00:00:00
FILE "03 311 - Large In The Margin.flac" WAVE
TRACK 03 AUDIO
TITLE "Large In The Margin"
ISRC USCA19900073
INDEX 01 00:00:00
TRACK 04 AUDIO
TITLE "Flowing"
ISRC USCA19900071
INDEX 00 03:27:40
FILE "04 311 - Flowing.flac" WAVE
INDEX 01 00:00:00
TRACK 05 AUDIO
TITLE "Can't Fade Me"
ISRC USCA19900079
INDEX 00 03:11:63
FILE "05 311 - Can't Fade Me.flac" WAVE
INDEX 01 00:00:00
TRACK 06 AUDIO
TITLE "Life's Not A Race"
ISRC USCA19900075
INDEX 00 02:09:18
FILE "06 311 - Life's Not A Race.flac" WAVE
INDEX 01 00:00:00
TRACK 07 AUDIO
TITLE "Strong All Along"
ISRC USCA19900072
INDEX 00 04:25:60
FILE "07 311 - Strong All Along.flac" WAVE
INDEX 01 00:00:00
TRACK 08 AUDIO
TITLE "Sever"
ISRC USCA19900078
INDEX 00 03:28:24
FILE "08 311 - Sever.flac" WAVE
INDEX 01 00:00:00
FILE "09 311 - Eons.flac" WAVE
TRACK 09 AUDIO
TITLE "Eons"
ISRC USCA19900067
INDEX 01 00:00:00
FILE "10 311 - Evolution.flac" WAVE
TRACK 10 AUDIO
TITLE "Evolution"
ISRC USCA19900076
INDEX 01 00:00:00
TRACK 11 AUDIO
TITLE "Leaving Babylon"
ISRC USCA19900068
INDEX 00 04:17:10
FILE "11 311 - Leaving Babylon.flac" WAVE
INDEX 01 00:00:00
FILE "12 311 - Mindspin.flac" WAVE
TRACK 12 AUDIO
TITLE "Mindspin"
ISRC USCA19900074
INDEX 01 00:00:00
TRACK 13 AUDIO
TITLE "Livin' & Rockin'"
ISRC USCA19900077
INDEX 00 03:58:70
FILE "13 311 - Livin' & Rockin'.flac" WAVE
INDEX 01 00:00:00
TRACK 14 AUDIO
TITLE "Blizza (Bonus Track)"
ISRC USCA19905001
INDEX 00 02:43:00
FILE "14 311 - Blizza (Bonus Track).flac" WAVE
INDEX 01 00:00:00
So this is a "non-standard" CUE sheet. You usually don't need them for situations where your tracks are already split up...and technically the flac support will depend on the imaging software using it. What's worse is this CUE sheet is broken in such a way that mpd cannot parse it properly and half the tracks won't work; and once mpd sees a CUE, that's it. That's what it's going to use.
Deleting the CUE would be easy, but as I alluded to earlier; I don't want to go down that path. Plus this is just one of hundreds of broken albums, among thousands. I also don't want to just delete every single CUE sheet as some things...are actually in single file with CUE. So the best solution is to modify the behavior in mpd and create rules for when we use a CUE sheet and when we don't. Yes, rules. It is not a simple "if not equal skip" logic. We also have to account for multi-session discs that exist. Those CUE sheets will include the DATA track entry, bringing the total track count higher. A multi-session disc with 20 tracks will only have 19 media files.
the hide_playlist_targets does in fact solve half the problem; but at the expense of duplicates. Pretending I didn't know this existed (I didn't) let me make what I think is a cleaner solution.
Any other difference though, and mpd will use the CUE as normal. I get why they did it; but we don't really need the CUE for playback, at least I don't. I still get the occasional fringe case. But going from 20% problematic to <1% is a HUGE improvement.
While this one was more targeted toward the SACD/DVD-Audio crowd; I'm seeing a lot of DD+ and consumer Atmos floating around. So the idea of more multi-channel being in your collection is a possibly. If you've got a setup that can handle both, great; I made SACD/DVD-A improvements for --all.
However, for those of us who are stereo-only and only have 5.1 for downmixing experiments; I don't need them in my mpd. Okay, easy solution...pull them out. I can totally do that for the normal stuff. However SACD and DVD-Audio is not an option. They're a single image file. I'd have to reauthor the image. You know how much of a PITA it is to reauthor an SACD? Twice as hard as authoring one from scratch.
So this thing now examines the channel configuration and determines, based on argument input, what collection to build. Stereo will give you all the stereo content, multi-chanel gives you just multi-chnanel. Multi-channel is probably less useful than --all if you have a multi-channel setup; but it's there.
The SACD plugin appends channel and format information to the end of the album; so (2CH-DSD) for stereo DSD. It also puts 11 characters at the front of the track title that look like: MCH - 01 - that have the channel format and track number. This was pretty ugly in my mpd client. I also felt it was entirely unnecessary for track titles all around. I'm not complaining or going to question how or why Maxim did this. The Album modification I could have lived with. But since I'm doing this...we clean up both. We just take that information out. If you've got a stereo database; you don't need to be reminded In-A-Gadda-Da-Vida is 2CH...or that you're about to queue the 2CH version of Captian Fantastic.
But what about you -all people? You're not going to be left out lost in the field. If you've chosen --all; we append (Stereo) or (Multichannel) to the album tag. But only on SACD (and maybe DVD-A) stuff. Normal media files you'll have to modify the tag manually.
You lose the ability to live update within mpd. I think I might figure out how to setup some inter-process communication to tell mpd to reload the database. In fact if there is one incomaptibility...it's with database updating. A database created with mpd-dbcreate must be updated with mpd-dbcreate; and mpd-dbcreate shouldn't update an mpd database. They won't "understand" each others entries and duplicate things. The nice thing is the database is loaded in to memory; so you update it on disk then restart mpd.