Compare commits
4 Commits
v1.7.0-pre
...
branch-v1.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
df58fb8817 | ||
![]() |
0e4cfccee0 | ||
![]() |
014c33d46c | ||
![]() |
1dd6a8f71a |
@@ -267,7 +267,7 @@ namespace gaseous_server.Classes
|
|||||||
if (games.Length == 1)
|
if (games.Length == 1)
|
||||||
{
|
{
|
||||||
// exact match!
|
// exact match!
|
||||||
determinedGame = Metadata.Games.GetGame((long)games[0].Id, false, false);
|
determinedGame = Metadata.Games.GetGame((long)games[0].Id, false, false, false);
|
||||||
Logging.Log(Logging.LogType.Information, "Import Game", " IGDB game: " + determinedGame.Name);
|
Logging.Log(Logging.LogType.Information, "Import Game", " IGDB game: " + determinedGame.Name);
|
||||||
GameFound = true;
|
GameFound = true;
|
||||||
break;
|
break;
|
||||||
@@ -425,7 +425,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
// get metadata
|
// get metadata
|
||||||
IGDB.Models.Platform platform = gaseous_server.Classes.Metadata.Platforms.GetPlatform(rom.PlatformId);
|
IGDB.Models.Platform platform = gaseous_server.Classes.Metadata.Platforms.GetPlatform(rom.PlatformId);
|
||||||
IGDB.Models.Game game = gaseous_server.Classes.Metadata.Games.GetGame(rom.GameId, false, false);
|
IGDB.Models.Game game = gaseous_server.Classes.Metadata.Games.GetGame(rom.GameId, false, false, false);
|
||||||
|
|
||||||
// build path
|
// build path
|
||||||
string platformSlug = "Unknown Platform";
|
string platformSlug = "Unknown Platform";
|
||||||
|
@@ -21,7 +21,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
Config.IGDB.Secret
|
Config.IGDB.Secret
|
||||||
);
|
);
|
||||||
|
|
||||||
public static Game? GetGame(long Id, bool followSubGames, bool forceRefresh)
|
public static Game? GetGame(long Id, bool getAllMetadata, bool followSubGames, bool forceRefresh)
|
||||||
{
|
{
|
||||||
if (Id == 0)
|
if (Id == 0)
|
||||||
{
|
{
|
||||||
@@ -45,14 +45,14 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Task<Game> RetVal = _GetGame(SearchUsing.id, Id, followSubGames, forceRefresh);
|
Task<Game> RetVal = _GetGame(SearchUsing.id, Id, getAllMetadata, followSubGames, forceRefresh);
|
||||||
return RetVal.Result;
|
return RetVal.Result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Game GetGame(string Slug, bool followSubGames, bool forceRefresh)
|
public static Game GetGame(string Slug, bool getAllMetadata, bool followSubGames, bool forceRefresh)
|
||||||
{
|
{
|
||||||
Task<Game> RetVal = _GetGame(SearchUsing.slug, Slug, followSubGames, forceRefresh);
|
Task<Game> RetVal = _GetGame(SearchUsing.slug, Slug, getAllMetadata, followSubGames, forceRefresh);
|
||||||
return RetVal.Result;
|
return RetVal.Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
return Storage.BuildCacheObject<Game>(new Game(), dataRow);
|
return Storage.BuildCacheObject<Game>(new Game(), dataRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<Game> _GetGame(SearchUsing searchUsing, object searchValue, bool followSubGames = false, bool forceRefresh = false)
|
private static async Task<Game> _GetGame(SearchUsing searchUsing, object searchValue, bool getAllMetadata = true, bool followSubGames = false, bool forceRefresh = false)
|
||||||
{
|
{
|
||||||
// check database first
|
// check database first
|
||||||
Storage.CacheStatus? cacheStatus = new Storage.CacheStatus();
|
Storage.CacheStatus? cacheStatus = new Storage.CacheStatus();
|
||||||
@@ -99,12 +99,12 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
case Storage.CacheStatus.NotPresent:
|
case Storage.CacheStatus.NotPresent:
|
||||||
returnValue = await GetObjectFromServer(WhereClause);
|
returnValue = await GetObjectFromServer(WhereClause);
|
||||||
Storage.NewCacheValue(returnValue);
|
Storage.NewCacheValue(returnValue);
|
||||||
UpdateSubClasses(returnValue, followSubGames);
|
UpdateSubClasses(returnValue, getAllMetadata, followSubGames);
|
||||||
return returnValue;
|
return returnValue;
|
||||||
case Storage.CacheStatus.Expired:
|
case Storage.CacheStatus.Expired:
|
||||||
returnValue = await GetObjectFromServer(WhereClause);
|
returnValue = await GetObjectFromServer(WhereClause);
|
||||||
Storage.NewCacheValue(returnValue, true);
|
Storage.NewCacheValue(returnValue, true);
|
||||||
UpdateSubClasses(returnValue, followSubGames);
|
UpdateSubClasses(returnValue, getAllMetadata, followSubGames);
|
||||||
return returnValue;
|
return returnValue;
|
||||||
case Storage.CacheStatus.Current:
|
case Storage.CacheStatus.Current:
|
||||||
return Storage.GetCacheValue<Game>(returnValue, "id", (long)searchValue);
|
return Storage.GetCacheValue<Game>(returnValue, "id", (long)searchValue);
|
||||||
@@ -113,7 +113,14 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void UpdateSubClasses(Game Game, bool followSubGames)
|
private static void UpdateSubClasses(Game Game, bool getAllMetadata, bool followSubGames)
|
||||||
|
{
|
||||||
|
if (Game.Cover != null)
|
||||||
|
{
|
||||||
|
Cover GameCover = Covers.GetCover(Game.Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(Game));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getAllMetadata == true)
|
||||||
{
|
{
|
||||||
if (Game.AgeRatings != null)
|
if (Game.AgeRatings != null)
|
||||||
{
|
{
|
||||||
@@ -152,7 +159,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
|
|
||||||
foreach (long gameId in gamesToFetch)
|
foreach (long gameId in gamesToFetch)
|
||||||
{
|
{
|
||||||
Game relatedGame = GetGame(gameId, false, false);
|
Game relatedGame = GetGame(gameId, false, true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,11 +168,6 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
Collection GameCollection = Collections.GetCollections(Game.Collection.Id);
|
Collection GameCollection = Collections.GetCollections(Game.Collection.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Game.Cover != null)
|
|
||||||
{
|
|
||||||
Cover GameCover = Covers.GetCover(Game.Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(Game));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Game.ExternalGames != null)
|
if (Game.ExternalGames != null)
|
||||||
{
|
{
|
||||||
foreach (long ExternalGameId in Game.ExternalGames.Ids)
|
foreach (long ExternalGameId in Game.ExternalGames.Ids)
|
||||||
@@ -227,6 +229,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private enum SearchUsing
|
private enum SearchUsing
|
||||||
{
|
{
|
||||||
|
@@ -17,7 +17,7 @@ namespace gaseous_server.Classes
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Logging.Log(Logging.LogType.Information, "Metadata Refresh", "Refreshing metadata for game " + dr["name"] + " (" + dr["id"] + ")");
|
Logging.Log(Logging.LogType.Information, "Metadata Refresh", "Refreshing metadata for game " + dr["name"] + " (" + dr["id"] + ")");
|
||||||
Metadata.Games.GetGame((long)dr["id"], true, forceRefresh);
|
Metadata.Games.GetGame((long)dr["id"], true, true, forceRefresh);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@@ -56,7 +56,7 @@ namespace gaseous_server.Classes
|
|||||||
IGDB.Models.Platform platform = Classes.Metadata.Platforms.GetPlatform(PlatformId);
|
IGDB.Models.Platform platform = Classes.Metadata.Platforms.GetPlatform(PlatformId);
|
||||||
|
|
||||||
// ensure metadata for gameid is present
|
// ensure metadata for gameid is present
|
||||||
IGDB.Models.Game game = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game game = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "UPDATE Games_Roms SET PlatformId=@platformid, GameId=@gameid WHERE Id = @id";
|
string sql = "UPDATE Games_Roms SET PlatformId=@platformid, GameId=@gameid WHERE Id = @id";
|
||||||
|
@@ -136,7 +136,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, forceRefresh);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, forceRefresh, false, forceRefresh);
|
||||||
|
|
||||||
if (gameObject != null)
|
if (gameObject != null)
|
||||||
{
|
{
|
||||||
@@ -162,7 +162,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
if (gameObject.AlternativeNames != null)
|
if (gameObject.AlternativeNames != null)
|
||||||
{
|
{
|
||||||
@@ -193,7 +193,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
if (gameObject.AgeRatings != null)
|
if (gameObject.AgeRatings != null)
|
||||||
{
|
{
|
||||||
@@ -303,7 +303,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
List<Artwork> artworks = new List<Artwork>();
|
List<Artwork> artworks = new List<Artwork>();
|
||||||
if (gameObject.Artworks != null)
|
if (gameObject.Artworks != null)
|
||||||
@@ -332,7 +332,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -365,7 +365,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -420,7 +420,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
if (gameObject != null)
|
if (gameObject != null)
|
||||||
{
|
{
|
||||||
IGDB.Models.Cover coverObject = Covers.GetCover(gameObject.Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(gameObject));
|
IGDB.Models.Cover coverObject = Covers.GetCover(gameObject.Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(gameObject));
|
||||||
@@ -452,7 +452,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
string coverFilePath = Path.Combine(Config.LibraryConfiguration.LibraryMetadataDirectory_Game(gameObject), "Cover.png");
|
string coverFilePath = Path.Combine(Config.LibraryConfiguration.LibraryMetadataDirectory_Game(gameObject), "Cover.png");
|
||||||
if (System.IO.File.Exists(coverFilePath)) {
|
if (System.IO.File.Exists(coverFilePath)) {
|
||||||
@@ -492,7 +492,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
if (gameObject != null)
|
if (gameObject != null)
|
||||||
{
|
{
|
||||||
List<IGDB.Models.Genre> genreObjects = new List<Genre>();
|
List<IGDB.Models.Genre> genreObjects = new List<Genre>();
|
||||||
@@ -528,7 +528,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
if (gameObject != null)
|
if (gameObject != null)
|
||||||
{
|
{
|
||||||
List<Dictionary<string, object>> icObjects = new List<Dictionary<string, object>>();
|
List<Dictionary<string, object>> icObjects = new List<Dictionary<string, object>>();
|
||||||
@@ -571,7 +571,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
if (gameObject != null)
|
if (gameObject != null)
|
||||||
{
|
{
|
||||||
List<Dictionary<string, object>> icObjects = new List<Dictionary<string, object>>();
|
List<Dictionary<string, object>> icObjects = new List<Dictionary<string, object>>();
|
||||||
@@ -611,7 +611,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
InvolvedCompany involvedCompany = Classes.Metadata.InvolvedCompanies.GetInvolvedCompanies(CompanyId);
|
InvolvedCompany involvedCompany = Classes.Metadata.InvolvedCompanies.GetInvolvedCompanies(CompanyId);
|
||||||
Company company = Classes.Metadata.Companies.GetCompanies(involvedCompany.Company.Id);
|
Company company = Classes.Metadata.Companies.GetCompanies(involvedCompany.Company.Id);
|
||||||
@@ -655,7 +655,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
List<Classes.Roms.GameRomItem> roms = Classes.Roms.GetRoms(GameId);
|
List<Classes.Roms.GameRomItem> roms = Classes.Roms.GetRoms(GameId);
|
||||||
|
|
||||||
@@ -676,7 +676,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
||||||
if (rom.GameId == GameId)
|
if (rom.GameId == GameId)
|
||||||
@@ -702,7 +702,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
||||||
if (rom.GameId == GameId)
|
if (rom.GameId == GameId)
|
||||||
@@ -729,7 +729,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
||||||
if (rom.GameId == GameId)
|
if (rom.GameId == GameId)
|
||||||
@@ -757,7 +757,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
||||||
if (rom.GameId != GameId)
|
if (rom.GameId != GameId)
|
||||||
@@ -792,7 +792,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
||||||
if (rom.GameId != GameId || rom.Name != FileName)
|
if (rom.GameId != GameId || rom.Name != FileName)
|
||||||
@@ -864,7 +864,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
List<Screenshot> screenshots = new List<Screenshot>();
|
List<Screenshot> screenshots = new List<Screenshot>();
|
||||||
if (gameObject.Screenshots != null)
|
if (gameObject.Screenshots != null)
|
||||||
@@ -893,7 +893,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
if (gameObject != null) {
|
if (gameObject != null) {
|
||||||
IGDB.Models.Screenshot screenshotObject = Screenshots.GetScreenshot(ScreenshotId, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(gameObject));
|
IGDB.Models.Screenshot screenshotObject = Screenshots.GetScreenshot(ScreenshotId, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(gameObject));
|
||||||
if (screenshotObject != null)
|
if (screenshotObject != null)
|
||||||
@@ -924,7 +924,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
IGDB.Models.Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
IGDB.Models.Screenshot screenshotObject = Screenshots.GetScreenshot(ScreenshotId, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(gameObject));
|
IGDB.Models.Screenshot screenshotObject = Screenshots.GetScreenshot(ScreenshotId, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(gameObject));
|
||||||
|
|
||||||
@@ -967,7 +967,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false);
|
Game gameObject = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
List<GameVideo> videos = new List<GameVideo>();
|
List<GameVideo> videos = new List<GameVideo>();
|
||||||
if (gameObject.Videos != null)
|
if (gameObject.Videos != null)
|
||||||
|
@@ -114,7 +114,7 @@ app.MapControllers();
|
|||||||
Config.LibraryConfiguration.InitLibrary();
|
Config.LibraryConfiguration.InitLibrary();
|
||||||
|
|
||||||
// insert unknown platform and game if not present
|
// insert unknown platform and game if not present
|
||||||
gaseous_server.Classes.Metadata.Games.GetGame(0, false, false);
|
gaseous_server.Classes.Metadata.Games.GetGame(0, false, false, false);
|
||||||
gaseous_server.Classes.Metadata.Platforms.GetPlatform(0);
|
gaseous_server.Classes.Metadata.Platforms.GetPlatform(0);
|
||||||
|
|
||||||
// organise library
|
// organise library
|
||||||
|
@@ -87,7 +87,15 @@
|
|||||||
],
|
],
|
||||||
"WebEmulator": {
|
"WebEmulator": {
|
||||||
"Type": "EmulatorJS",
|
"Type": "EmulatorJS",
|
||||||
"Core": "segaMD"
|
"Core": "segaMD",
|
||||||
|
"Bios": [
|
||||||
|
{
|
||||||
|
"hash": "45e298905a08f9cfb38fd504cd6dbc84",
|
||||||
|
"description": "MegaDrive TMSS startup ROM",
|
||||||
|
"filename": "bios_MD.bin",
|
||||||
|
"region": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -98,7 +106,9 @@
|
|||||||
"N64"
|
"N64"
|
||||||
],
|
],
|
||||||
"KnownFileExtensions": [
|
"KnownFileExtensions": [
|
||||||
".Z64"
|
".Z64",
|
||||||
|
".V64",
|
||||||
|
".N64"
|
||||||
],
|
],
|
||||||
"WebEmulator": {
|
"WebEmulator": {
|
||||||
"Type": "EmulatorJS",
|
"Type": "EmulatorJS",
|
||||||
@@ -110,20 +120,32 @@
|
|||||||
"IGDBName": "Nintendo Entertainment System",
|
"IGDBName": "Nintendo Entertainment System",
|
||||||
"AlternateNames": [
|
"AlternateNames": [
|
||||||
"Nintendo Entertainment System",
|
"Nintendo Entertainment System",
|
||||||
"NES"
|
"NES",
|
||||||
|
"Nintendo Famicom & Entertainment System"
|
||||||
],
|
],
|
||||||
"KnownFileExtensions": [
|
"KnownFileExtensions": [
|
||||||
".NES",
|
".NES",
|
||||||
".FDS",
|
".NEZ",
|
||||||
".FIG",
|
".UNF",
|
||||||
".MGD",
|
".UNIF"
|
||||||
".SFC",
|
|
||||||
".SMC",
|
|
||||||
".SWC"
|
|
||||||
],
|
],
|
||||||
"WebEmulator": {
|
"WebEmulator": {
|
||||||
"Type": "EmulatorJS",
|
"Type": "EmulatorJS",
|
||||||
"Core": "nes"
|
"Core": "nes",
|
||||||
|
"Bios": [
|
||||||
|
{
|
||||||
|
"hash": "ca30b50f880eb660a320674ed365ef7a",
|
||||||
|
"description": "Family Computer Disk System BIOS - Required for Famicom Disk System emulation",
|
||||||
|
"filename": "disksys.rom",
|
||||||
|
"region": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hash": "7f98d77d7a094ad7d069b74bd553ec98",
|
||||||
|
"description": "Game Genie add-on cartridge - Required for Game Genei Add-on emulation (Only supported on the fceumm core)",
|
||||||
|
"filename": "gamegenie.nes",
|
||||||
|
"region": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -135,7 +157,10 @@
|
|||||||
"Super Nintendo",
|
"Super Nintendo",
|
||||||
"SNES"
|
"SNES"
|
||||||
],
|
],
|
||||||
"KnownFileExtensions": [],
|
"KnownFileExtensions": [
|
||||||
|
".SFC",
|
||||||
|
".SMC"
|
||||||
|
],
|
||||||
"WebEmulator": {
|
"WebEmulator": {
|
||||||
"Type": "EmulatorJS",
|
"Type": "EmulatorJS",
|
||||||
"Core": "snes"
|
"Core": "snes"
|
||||||
|
@@ -88,24 +88,21 @@
|
|||||||
<Folder Include="Classes\" />
|
<Folder Include="Classes\" />
|
||||||
<Folder Include="Classes\SignatureIngestors\" />
|
<Folder Include="Classes\SignatureIngestors\" />
|
||||||
<Folder Include="Support\" />
|
<Folder Include="Support\" />
|
||||||
<Folder Include="wwwroot\" />
|
|
||||||
<Folder Include="Classes\Metadata\" />
|
<Folder Include="Classes\Metadata\" />
|
||||||
<Folder Include="Assets\" />
|
<Folder Include="Assets\" />
|
||||||
<Folder Include="Assets\Ratings\" />
|
<Folder Include="Assets\Ratings\" />
|
||||||
<Folder Include="Assets\Ratings\ESRB\" />
|
<Folder Include="Assets\Ratings\ESRB\" />
|
||||||
<Folder Include="Assets\Ratings\ACB\" />
|
<Folder Include="Assets\Ratings\ACB\" />
|
||||||
<Folder Include="Assets\Ratings\PEGI\" />
|
<Folder Include="Assets\Ratings\PEGI\" />
|
||||||
<Folder Include="wwwroot\scripts\" />
|
|
||||||
<Folder Include="wwwroot\images\" />
|
|
||||||
<Folder Include="wwwroot\styles\" />
|
|
||||||
<Folder Include="wwwroot\pages\" />
|
|
||||||
<Folder Include="Assets\Ratings\CERO\" />
|
<Folder Include="Assets\Ratings\CERO\" />
|
||||||
<Folder Include="Assets\Ratings\USK\" />
|
<Folder Include="Assets\Ratings\USK\" />
|
||||||
<Folder Include="Assets\Ratings\GRAC\" />
|
<Folder Include="Assets\Ratings\GRAC\" />
|
||||||
<Folder Include="Assets\Ratings\CLASS_IND\" />
|
<Folder Include="Assets\Ratings\CLASS_IND\" />
|
||||||
<Folder Include="wwwroot\fonts\" />
|
</ItemGroup>
|
||||||
<Folder Include="wwwroot\pages\dialogs\" />
|
<ItemGroup>
|
||||||
<Folder Include="wwwroot\pages\settings\" />
|
<None Include="wwwroot\**">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\gaseous-tools\gaseous-tools.csproj">
|
<ProjectReference Include="..\gaseous-tools\gaseous-tools.csproj">
|
||||||
@@ -120,7 +117,6 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Remove="Support\PlatformMap.json" />
|
<Content Remove="Support\PlatformMap.json" />
|
||||||
<Content Remove="wwwroot\pages\settings\" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Support\PlatformMap.json" Condition="'$(ExcludeConfigFilesFromBuildOutput)'!='true'">
|
<EmbeddedResource Include="Support\PlatformMap.json" Condition="'$(ExcludeConfigFilesFromBuildOutput)'!='true'">
|
||||||
|
Submodule gaseous-server/wwwroot/emulators/EmulatorJS updated: 328a02bbb6...8c5def77a0
@@ -2,6 +2,19 @@
|
|||||||
<div id="bgImage_Opacity"></div>
|
<div id="bgImage_Opacity"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- The Modal -->
|
||||||
|
<div id="myModalProgress" class="modal">
|
||||||
|
|
||||||
|
<!-- Modal content -->
|
||||||
|
<div class="modal-content-sub">
|
||||||
|
<div id="modal-content-sub-progress">
|
||||||
|
<h1>In Progress...</h1>
|
||||||
|
<progress style="width: 100%;"></progress>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="gamepage">
|
<div id="gamepage">
|
||||||
<div id="gametitle">
|
<div id="gametitle">
|
||||||
<h1 id="gametitle_label"></h1>
|
<h1 id="gametitle_label"></h1>
|
||||||
@@ -62,8 +75,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">var gameId = getQueryString('id', 'int');
|
||||||
var gameId = getQueryString('id', 'int');
|
|
||||||
var gameData;
|
var gameData;
|
||||||
var artworks = null;
|
var artworks = null;
|
||||||
var artworksPosition = 0;
|
var artworksPosition = 0;
|
||||||
@@ -344,7 +356,7 @@
|
|||||||
|
|
||||||
var newRow = [
|
var newRow = [
|
||||||
['<input type="checkbox" name="rom_checkbox" data-romid="' + result[i].id + '" />', 'rom_checkbox_box_hidden', 'rom_edit_checkbox'],
|
['<input type="checkbox" name="rom_checkbox" data-romid="' + result[i].id + '" />', 'rom_checkbox_box_hidden', 'rom_edit_checkbox'],
|
||||||
'<a href="/api/v1/Games/' + gameId + '/roms/' + result[i].id + '/' + encodeURIComponent(result[i].name) +'" class="romlink">' + result[i].name + '</a>',
|
'<a href="/api/v1/Games/' + gameId + '/roms/' + result[i].id + '/' + encodeURIComponent(result[i].name) + '" class="romlink">' + result[i].name + '</a>',
|
||||||
formatBytes(result[i].size, 2),
|
formatBytes(result[i].size, 2),
|
||||||
result[i].romTypeMedia,
|
result[i].romTypeMedia,
|
||||||
result[i].mediaLabel,
|
result[i].mediaLabel,
|
||||||
@@ -545,29 +557,47 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
var remapCallCounter = 0;
|
var remapCallCounter = 0;
|
||||||
|
var remapCallCounterMax = 0;
|
||||||
function remapTitles() {
|
function remapTitles() {
|
||||||
var fixplatform = $('#rom_edit_fixplatform').select2('data');
|
var fixplatform = $('#rom_edit_fixplatform').select2('data');
|
||||||
var fixgame = $('#rom_edit_fixgame').select2('data');
|
var fixgame = $('#rom_edit_fixgame').select2('data');
|
||||||
|
|
||||||
if (fixplatform[0] && fixgame[0]) {
|
if (fixplatform[0] && fixgame[0]) {
|
||||||
var rom_checks = document.getElementsByName('rom_checkbox');
|
var rom_checks = document.getElementsByName('rom_checkbox');
|
||||||
|
|
||||||
|
for (var i = 0; i < rom_checks.length; i++) {
|
||||||
|
if (rom_checks[i].checked == true) {
|
||||||
|
remapCallCounterMax += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (remapCallCounterMax > 0) {
|
||||||
|
showProgress();
|
||||||
|
|
||||||
for (var i = 0; i < rom_checks.length; i++) {
|
for (var i = 0; i < rom_checks.length; i++) {
|
||||||
if (rom_checks[i].checked == true) {
|
if (rom_checks[i].checked == true) {
|
||||||
var romId = rom_checks[i].getAttribute('data-romid');
|
var romId = rom_checks[i].getAttribute('data-romid');
|
||||||
remapCallCounter += 1;
|
remapCallCounter += 1;
|
||||||
|
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + romId + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
|
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + romId + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
|
||||||
remapTitlesCallback();
|
remapTitlesCallback();
|
||||||
|
}, function (result) {
|
||||||
|
remapTitlesCallback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function remapTitlesCallback() {
|
function remapTitlesCallback() {
|
||||||
remapCallCounter = remapCallCounter - 1;
|
remapCallCounter = remapCallCounter - 1;
|
||||||
|
|
||||||
if (remapCallCounter <= 0) {
|
if (remapCallCounter <= 0) {
|
||||||
|
closeProgress();
|
||||||
loadRoms(true);
|
loadRoms(true);
|
||||||
remapCallCounter = 0;
|
remapCallCounter = 0;
|
||||||
|
remapCallCounterMax = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -589,6 +619,8 @@
|
|||||||
var rom_checks = document.getElementsByName('rom_checkbox');
|
var rom_checks = document.getElementsByName('rom_checkbox');
|
||||||
for (var i = 0; i < rom_checks.length; i++) {
|
for (var i = 0; i < rom_checks.length; i++) {
|
||||||
if (rom_checks[i].checked == true) {
|
if (rom_checks[i].checked == true) {
|
||||||
|
remapCallCounterMax += 1;
|
||||||
|
|
||||||
var romId = rom_checks[i].getAttribute('data-romid');
|
var romId = rom_checks[i].getAttribute('data-romid');
|
||||||
remapCallCounter += 1;
|
remapCallCounter += 1;
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + romId, 'DELETE', function (result) {
|
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + romId, 'DELETE', function (result) {
|
||||||
@@ -597,4 +629,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
|
function showProgress() {
|
||||||
|
// Get the modal
|
||||||
|
var submodal = document.getElementById("myModalProgress");
|
||||||
|
|
||||||
|
// When the user clicks on the button, open the modal
|
||||||
|
submodal.style.display = "block";
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeProgress() {
|
||||||
|
// Get the modal
|
||||||
|
var submodal = document.getElementById("myModalProgress");
|
||||||
|
|
||||||
|
submodal.style.display = "none";
|
||||||
|
}
|
||||||
|
</script>
|
@@ -1,4 +1,4 @@
|
|||||||
function ajaxCall(endpoint, method, successFunction) {
|
function ajaxCall(endpoint, method, successFunction, errorFunction) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
|
||||||
// Our sample url to make request
|
// Our sample url to make request
|
||||||
@@ -11,14 +11,18 @@
|
|||||||
// Function to call when to
|
// Function to call when to
|
||||||
// request is ok
|
// request is ok
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
var x = JSON.stringify(data);
|
//var x = JSON.stringify(data);
|
||||||
console.log(x);
|
//console.log(x);
|
||||||
successFunction(data);
|
successFunction(data);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Error handling
|
// Error handling
|
||||||
error: function (error) {
|
error: function (error) {
|
||||||
console.log(`Error ${error}`);
|
console.log(`Error ${error}`);
|
||||||
|
|
||||||
|
if (errorFunction) {
|
||||||
|
errorFunction(error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -211,3 +215,7 @@ function DropDownRenderGameOption(state) {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sleep(ms) {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
|
}
|
@@ -771,3 +771,15 @@ button:disabled {
|
|||||||
-webkit-box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44);
|
-webkit-box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44);
|
||||||
-moz-box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44);
|
-moz-box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#rom_edit_progressbar {
|
||||||
|
width: 100%;
|
||||||
|
height: 10px;
|
||||||
|
background-color: lightgray;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#rom_edit_progressbar_progress {
|
||||||
|
height: 10px;
|
||||||
|
background-color: cyan;
|
||||||
|
}
|
Reference in New Issue
Block a user