dennis48309 / OGXboxSoundtrackEditor

A soundtrack editor for the OG Xbox.
4 stars 2 forks source link

ST.DB corruption after doing deletes and appends #5

Open instinctualjealousy opened 2 years ago

instinctualjealousy commented 2 years ago

I'd rather not re-corrupt my database, and backups aren't working (I'd love it if they did so I could start testing this better). Reason I went radio silent for a while is because I had a horrible corruption (from a clean, new ST.DB) after micromanaging my songs a bit. I don't EXACTLY know what causes it, but it's as if the information gets offset from the track data increasingly so (where track names for each track get pushed further and further backwards, this has the humorous effect of making tracks first have no title, until they start having garbage titles from reading portions of the ST.DB that aren't supposed to be read as text). Curiously, you can only see the corruption on the Xbox and not in the software in my experience.

I used 1.3 alpha back then. Same version today for the first time in a year and had a corruption happen, thankfully early on.

After this, I babied it:

Everything turned out fine this time. I think it's related to deleting tracks on an already existing soundtrack (then adding new tracks to the same soundtrack), and/or moving on to a new soundtrack after doing it.

I'll send off an affected ST.DB file if I make this happen again (unintentionally) or intentionally (after a backup).

dennis48309 commented 1 year ago

I am back after a long hiatus to complete this project. I'm going to do some testing myself with the Xbox Dashboard to check a few things. I might have made a mistake reordering songs or giving them new IDs, need to check the source as well. For each soundtrack, Xbox stores songs in groups of 6.

dennis48309 commented 1 year ago

It seems that the Xbox Dashboard rebuilds the Song Groups when you delete files. I tested with a brand new soundtrack of 7 songs, ended up with 2 Song Groups, 1 of which has 6 songs and the other has 1. I deleted one song with the dashboard and there is now only 1 Song Group. I just have to go through my code now to figure out where it's messing up, I assume it's messing up song IDs or something.

dennis48309 commented 1 year ago

It looks like I forgot to call FtpChanges() at the end of the method to delete songs, so the ST.db wasn't being updated but the .wma files were still being deleted.