Skip to content

Commit

Permalink
Update Song.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
DanTheMan827 authored Jan 13, 2025
1 parent 7813576 commit 297bcae
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions AmpHelper.Library/Song.cs
Original file line number Diff line number Diff line change
Expand Up @@ -758,20 +758,23 @@ public static void AddSong(DirectoryInfo unpackedPath, string[] songNames, Conso

ValidateSong(songPath, songName, true);

var moggSong = MoggSong.FromMoggsong(Path.Combine(songPath, $"{songName}.moggsong"));
moggSong.MoggPath = $"{songName}.mogg";
moggSong.MidiPath = $"{songName}.mid";

var donorSong = moggSong.DonorSong ?? "tut0";

foreach (var ext in new string[] { $"mid_{platform}", $"png.dta_dta_{platform}", $"png_{platform}" })
{
var donorFile = Path.Combine(paths.Songs, "tut0", $"tut0.{ext}");
var donorFile = Path.Combine(paths.Songs, donorSong, $"{donorSong}.{ext}");
var destFile = Path.Combine(paths.Songs, songName, $"{songName}.{ext}");

if (!File.Exists(destFile))
{
File.Copy(donorFile, destFile);
}
}

var moggSong = MoggSong.FromMoggsong(Path.Combine(songPath, $"{songName}.moggsong"));
moggSong.MoggPath = $"{songName}.mogg";
moggSong.MidiPath = $"{songName}.mid";

var dtx = moggSong.ToDtx();

using (var dtbStream = File.Create(Path.Combine(songPath, $"{songName}.moggsong_dta_{platform}")))
Expand Down

0 comments on commit 297bcae

Please sign in to comment.