Create libraries based on external unmanaged directories (#147)
* Library management is now complete * Library functions complete * Added default platform support
This commit is contained in:
@@ -81,16 +81,19 @@ namespace gaseous_server.Classes
|
||||
public static void DeleteRom(long RomId)
|
||||
{
|
||||
GameRomItem rom = GetRom(RomId);
|
||||
if (File.Exists(rom.Path))
|
||||
if (rom.Library.IsDefaultLibrary == true)
|
||||
{
|
||||
File.Delete(rom.Path);
|
||||
}
|
||||
if (File.Exists(rom.Path))
|
||||
{
|
||||
File.Delete(rom.Path);
|
||||
}
|
||||
|
||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "DELETE FROM Games_Roms WHERE Id = @id";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||
dbDict.Add("id", RomId);
|
||||
db.ExecuteCMD(sql, dbDict);
|
||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "DELETE FROM Games_Roms WHERE Id = @id";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||
dbDict.Add("id", RomId);
|
||||
db.ExecuteCMD(sql, dbDict);
|
||||
}
|
||||
}
|
||||
|
||||
private static GameRomItem BuildRom(DataRow romDR)
|
||||
@@ -113,7 +116,8 @@ namespace gaseous_server.Classes
|
||||
MediaLabel = (string)romDR["medialabel"],
|
||||
Path = (string)romDR["path"],
|
||||
Source = (gaseous_signature_parser.models.RomSignatureObject.RomSignatureObject.Game.Rom.SignatureSourceType)(Int32)romDR["metadatasource"],
|
||||
SignatureSourceGameTitle = (string)Common.ReturnValueIfNull(romDR["MetadataGameName"], "")
|
||||
SignatureSourceGameTitle = (string)Common.ReturnValueIfNull(romDR["MetadataGameName"], ""),
|
||||
Library = GameLibrary.GetLibrary((int)romDR["LibraryId"])
|
||||
};
|
||||
|
||||
// check for a web emulator and update the romItem
|
||||
@@ -153,6 +157,7 @@ namespace gaseous_server.Classes
|
||||
public string? Path { get; set; }
|
||||
public gaseous_signature_parser.models.RomSignatureObject.RomSignatureObject.Game.Rom.SignatureSourceType Source { get; set; }
|
||||
public string? SignatureSourceGameTitle { get; set;}
|
||||
public GameLibrary.LibraryItem Library { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user