Add a Platform Map editor to the UI (#104)

This commit is contained in:
Michael Green
2023-09-18 01:24:44 +10:00
committed by GitHub
parent 61d9dd16eb
commit 09dece08f3
21 changed files with 1870 additions and 750 deletions

View File

@@ -34,6 +34,14 @@ namespace gaseous_tools
}
}
public static string PlatformMappingFile
{
get
{
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".gaseous-server", "platformmap.json");
}
}
public static ConfigFile.Database DatabaseConfiguration
{
get

View File

@@ -14,3 +14,33 @@ ALTER TABLE `RomCollections`
ADD COLUMN `FolderStructure` INT NULL DEFAULT 0 AFTER `MaximumCollectionSizeInBytes`,
ADD COLUMN `IncludeBIOSFiles` BOOLEAN NULL DEFAULT 0 AFTER `FolderStructure`,
ADD COLUMN `AlwaysInclude` JSON NULL AFTER `IncludeBIOSFiles`;
CREATE TABLE `PlatformMap` (
`Id` BIGINT NOT NULL,
`RetroPieDirectoryName` VARCHAR(45) NULL,
`WebEmulator_Type` VARCHAR(45) NULL,
`WebEmulator_Core` VARCHAR(45) NULL,
PRIMARY KEY (`Id`),
UNIQUE INDEX `Id_UNIQUE` (`Id` ASC) VISIBLE);
CREATE TABLE `PlatformMap_AlternateNames` (
`Id` BIGINT NOT NULL,
`Name` VARCHAR(255) NOT NULL,
PRIMARY KEY (`Id`, `Name`));
CREATE TABLE `PlatformMap_Extensions` (
`Id` BIGINT NOT NULL,
`Extension` VARCHAR(45) NOT NULL,
PRIMARY KEY (`Id`, `Extension`));
CREATE TABLE `PlatformMap_UniqueExtensions` (
`Id` BIGINT NOT NULL,
`Extension` VARCHAR(45) NOT NULL,
PRIMARY KEY (`Id`, `Extension`));
CREATE TABLE `PlatformMap_Bios` (
`Id` BIGINT NOT NULL,
`Filename` VARCHAR(45) NOT NULL,
`Description` LONGTEXT NOT NULL,
`Hash` VARCHAR(45) NOT NULL,
PRIMARY KEY (`Id`, `Filename`, `Hash`));

View File

@@ -74,9 +74,7 @@ namespace gaseous_tools
// write log file
string JsonOutput = Newtonsoft.Json.JsonConvert.SerializeObject(logItem, serializerSettings);
StreamWriter jsonLogFile = File.AppendText(Config.LogFilePath);
jsonLogFile.WriteLine(JsonOutput);
jsonLogFile.Close();
File.AppendAllText(Config.LogFilePath, JsonOutput);
}
// quick clean before we go
@@ -116,7 +114,14 @@ namespace gaseous_tools
FileInfo fi = new FileInfo(file);
if (fi.LastAccessTime.AddDays(Config.LoggingConfiguration.LogRetention) < DateTime.Now)
{
fi.Delete();
try
{
fi.Delete();
}
catch
{
Log(LogType.Warning, "Log Cleanup", "Failed purging log " + fi.FullName);
}
}
}
}