1
0
mirror of synced 2024-11-23 23:21:06 +01:00

Adjust Score.ini Importer (#665)

Now accounts for multiple song paths
This commit is contained in:
DragonRatTiger / リュウコ 2024-07-28 03:45:49 -05:00 committed by GitHub
parent 27f896ba01
commit 0c6bc77eca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -12,12 +12,16 @@ namespace TJAPlayer3 {
SqliteConnection? connection = DBSaves.GetSavesDBConnection();
if (connection == null) {
Trace.TraceError("Could not establish a connection to Saves.db3 database. Aborting score import.");
Status = "";
return;
}
Status = "Searching for scores...";
string[] _scoreFiles = Directory.GetFiles(TJAPlayer3.ConfigIni.strSongsPath, "*.score.ini", SearchOption.AllDirectories);
Trace.TraceInformation($"{_scoreFiles.Length} score.ini files have been found. Beginning import.");
List<string> _scoreFiles = new List<string>();
foreach (string path in TJAPlayer3.ConfigIni.strSongsPath.Split(';', StringSplitOptions.RemoveEmptyEntries)) {
_scoreFiles.AddRange(Directory.GetFiles(path, "*.score.ini", SearchOption.AllDirectories));
}
Trace.TraceInformation($"{_scoreFiles.Count} score.ini files have been found. Beginning import.");
int importcount = 0;
Status = "Importing scores...";
@ -228,7 +232,7 @@ namespace TJAPlayer3 {
Trace.TraceWarning($"Failed to import {_score} into new database. More details:\n{ex}");
}
}
Trace.TraceInformation($"Imported {importcount} of {_scoreFiles.Length} scores from score.ini files.");
Trace.TraceInformation($"Imported {importcount} of {_scoreFiles.Count} scores from score.ini files.");
Status = "";
}

View File

@ -176,7 +176,6 @@ namespace TJAPlayer3 {
TJAPlayer3.actTextConsole.tPrint((int)(x * TJAPlayer3.Skin.Resolution[0] / 1280.0), (int)(y * TJAPlayer3.Skin.Resolution[1] / 720.0), CTextConsole.EFontType.White, this.list進行文字列[i]);
y += 24;
}
TJAPlayer3.actTextConsole.tPrint(x, y, CTextConsole.EFontType.White, this.str現在進行中);
//-----------------
#endregion
} else if (TJAPlayer3.ConfigIsNew && !bLanguageSelected) // Prompt language selection if Config.ini is newly generated