Music hangs on Saving Music Library
This question has been posted before many times and never successfully answered. This is specific to Music.app with local files. Apple Music is turned off.
For context, my old iMac running Catalina with Music 1.0.6.10 has no problem with my music library which has about 275,000 tracks in it. (I work in radio so I have a lot of music).
This problem crops up when I try and restore/convert the Music to a new machine running Ventura.
Music seemingly hangs on quitting, showing "Saving music library..." for a very long time or forever. I've lost track after 24 hours and then force quit it. However, I find that when it's force quit, when it opens again, it has lost the location of my files.
If I get info on a song, I can see the path where it thinks the file is. But if I look on the disk, that file doesn't exist, BUT there is a file with the same name with the track number preceding it. So "Keep Organized" has updated the file name to include the track number, but the iTunes database didn't get saved after updating.
Songs that didn't have a track number in their info field are still found.
I've repeated this many times by restoring backups and trying again.
When I let the "Saving music library..." box do it's thing after 10 hours, I go and look at modification times for the files inside ~/Music/Music/Music\ Library.musiclibrary nothing has been updated.
This leads me to think it's a bug in the code that's causing this hang, and that it's related to "Keep Library Organized" and for some reason, the Music database isn't getting updated.