Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NotImplementedLife committed Jul 30, 2023
1 parent abc76f1 commit 129454f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 34 additions & 1 deletion MainForm.RequestFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,47 @@ private void OkButton_Click(object sender, EventArgs e) => ExceptionGuard.Run(()

foreach (var mi in MusicInfos.Items)
{
if (mi.UniqueId == 0) continue;
var songId = mi.Id;

if(MusicAttributes.GetByUniqueId(mi.UniqueId)==null)
{
Logger.Info($"Added missing music_attribute entry for {mi.UniqueId}.{songId}");

MusicAttributes.Items.Add(new MusicAttribute
{
Id = songId,
UniqueId = mi.UniqueId,
New = false
});
}

if(MusicOrders.GetByUniqueId(mi.UniqueId)==null)
{
Logger.Info($"Added missing music_order entry for {mi.UniqueId}.{songId}");
MusicOrders.Items.Add(new MusicOrder
{
Genre = mi.Genre,
Id = songId,
UniqueId = mi.UniqueId
});
}

if (WordList.GetBySong(songId) == null)
{
Logger.Info($"Added missing word title entry for {mi.UniqueId}.{songId}");
WordList.Items.Add(new Word { Key = $"song_{songId}", JapaneseText = "" });
}
if (WordList.GetBySongSub(songId) == null)
{
Logger.Info($"Added missing word subtitle entry for {mi.UniqueId}.{songId}");
WordList.Items.Add(new Word { Key = $"song_sub_{songId}", JapaneseText = "" });
}
if (WordList.GetBySongDetail(songId) == null)
WordList.Items.Add(new Word { Key = $"song_detail_{songId}", JapaneseText = "" });
{
Logger.Info($"Added missing word detail entry for {mi.UniqueId}.{songId}");
WordList.Items.Add(new Word { Key = $"song_detail_{songId}", JapaneseText = "" });
}
}

Logger.Info($"Setting LoadedMusicBox DataSource");
Expand Down
2 changes: 2 additions & 0 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ private void LoadedMusicBox_SelectedIndexChanged(object sender, EventArgs e) =>
Logger.Info($"Selection Changed MusicItem: {item}");
LoadMusicInfo(item);
indexChanging = false;
SoundViewTab.SelectedTab = SoundViewerSimple;
});

private void EditorTable_Resize(object sender, EventArgs e) => ExceptionGuard.Run(() =>
Expand All @@ -119,6 +120,7 @@ private void NewSoundsBox_SelectedIndexChanged(object sender, EventArgs e) => Ex
LoadedMusicBox.SelectedItem = null;
var item = NewSoundsBox.SelectedItem as NewSongData;
LoadNewSongData(item);
SoundViewTab.SelectedTab = SoundViewerSimple;
});

#endregion
Expand Down

0 comments on commit 129454f

Please sign in to comment.