1
0
mirror of synced 2024-11-27 15:30:49 +01:00

Don't actually change song IDs for TJA

This commit is contained in:
goaaats 2022-02-07 13:30:40 +01:00
parent 25b558cdb9
commit 0efa910b58
No known key found for this signature in database
GPG Key ID: 49E2AA8C6A76498B

View File

@ -373,20 +373,21 @@ public class MusicPatch
song.genreNo = 7;
}
var tempId = song.id;
if (isTjaSong)
{
song.id = song.songName?.text + song.songSubtitle?.text + song.songDetail?.text;
if (string.IsNullOrEmpty(song.id))
tempId = song.songName?.text + song.songSubtitle?.text + song.songDetail?.text;
if (string.IsNullOrEmpty(tempId))
throw new Exception($"Song at {directory} does not have name, subtitle or detail text");
song.id += song.fumenOffsetPos + song.previewPos;
tempId += song.fumenOffsetPos + song.previewPos;
}
song.SongName = song.id;
song.FolderPath = directory;
// Clip off the last bit of the hash to make sure that the number is positive. This will lead to more collisions, but we should be fine.
song.uniqueId = (int)(MurmurHash2.Hash(song.id) & 0xFFFF_FFF);
song.uniqueId = (int)(MurmurHash2.Hash(tempId) & 0xFFFF_FFF);
if (song.uniqueId <= SaveDataMax)
song.uniqueId += SaveDataMax;