Expand the dat file ingestor to handle more formats (#84)

* MAME DAT's can now be imported, beginning of DB updates

* Fixed various database bugs that occur during upgrade from earlier versions

* Removed collation and MySQL specific options from database scripts
This commit is contained in:
Michael Green
2023-09-06 07:52:11 +10:00
committed by GitHub
parent 6b391bc357
commit bd7124a5be
18 changed files with 574 additions and 554 deletions

View File

@@ -95,7 +95,7 @@ namespace gaseous_server.Classes
private static GameRomItem BuildRom(DataRow romDR)
{
GameRomItem romItem = new GameRomItem
GameRomItem romItem = new GameRomItem
{
Id = (long)romDR["id"],
PlatformId = (long)romDR["platformid"],
@@ -107,12 +107,13 @@ namespace gaseous_server.Classes
MD5 = (string)romDR["md5"],
SHA1 = (string)romDR["sha1"],
DevelopmentStatus = (string)romDR["developmentstatus"],
Flags = Newtonsoft.Json.JsonConvert.DeserializeObject<string[]>((string)romDR["flags"]),
Attributes = Newtonsoft.Json.JsonConvert.DeserializeObject<List<KeyValuePair<string, object>>>((string)Common.ReturnValueIfNull(romDR["attributes"], "[ ]")),
RomType = (int)romDR["romtype"],
RomTypeMedia = (string)romDR["romtypemedia"],
MediaLabel = (string)romDR["medialabel"],
Path = (string)romDR["path"],
Source = (GameRomItem.SourceType)(Int32)romDR["metadatasource"]
Source = (gaseous_signature_parser.models.RomSignatureObject.RomSignatureObject.Game.Rom.SignatureSourceType)(Int32)romDR["metadatasource"],
SignatureSourceGameTitle = (string)Common.ReturnValueIfNull(romDR["MetadataGameName"], "")
};
// check for a web emulator and update the romItem
@@ -145,17 +146,13 @@ namespace gaseous_server.Classes
public string? SHA1 { get; set; }
public string? DevelopmentStatus { get; set; }
public string[]? Flags { get; set; }
public List<KeyValuePair<string, object>>? Attributes { get; set;}
public int RomType { get; set; }
public string? RomTypeMedia { get; set; }
public string? MediaLabel { get; set; }
public string? Path { get; set; }
public SourceType Source { get; set; }
public enum SourceType
{
None = 0,
TOSEC = 1
}
public gaseous_signature_parser.models.RomSignatureObject.RomSignatureObject.Game.Rom.SignatureSourceType Source { get; set; }
public string? SignatureSourceGameTitle { get; set;}
}
}
}