This commit is contained in:
Michael Green
2024-12-28 16:19:05 +11:00
parent c170d98a68
commit 1727a62150
6 changed files with 109 additions and 83 deletions

View File

@@ -25,6 +25,7 @@ namespace gaseous_server.Classes
}
string sql = "SELECT Platform.Id, Platform.`Name`, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT Game.Id, view_Games_Roms.PlatformId, COUNT(view_Games_Roms.Id) AS RomCount FROM Game LEFT JOIN AgeGroup ON Game.Id = AgeGroup.GameId LEFT JOIN view_Games_Roms ON Game.Id = view_Games_Roms.GameId WHERE (" + ageRestriction_Platform + ") GROUP BY Game.Id , view_Games_Roms.PlatformId HAVING RomCount > 0) Game JOIN Platform ON Game.PlatformId = Platform.Id GROUP BY Platform.`Name`;";
Console.WriteLine(sql);
DataTable dbResponse = db.ExecuteCMD(sql, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 300));

View File

@@ -287,8 +287,11 @@ ORDER BY Platform.`Name`;";
foreach (DataRow row in data.Rows)
{
HasheousClient.Models.Metadata.IGDB.Platform platform = Platforms.GetPlatform((long)row["PlatformId"]);
// get the user emulator configuration
PlatformMapping.UserEmulatorConfiguration? emulatorConfiguration = platformMapping.GetUserEmulator(UserId, GameId, (long)platform.Id);
// if no user configuration, get the platform emulator configuration
if (emulatorConfiguration == null)
{
if (platform.Id != 0)
@@ -303,18 +306,20 @@ ORDER BY Platform.`Name`;";
EnableBIOSFiles = platformMap.EnabledBIOSHashes
};
}
else
{
emulatorConfiguration = new PlatformMapping.UserEmulatorConfiguration
{
EmulatorType = "",
Core = "",
EnableBIOSFiles = new List<string>()
};
}
}
}
// if still no configuration, create a blank one
if (emulatorConfiguration == null)
{
emulatorConfiguration = new PlatformMapping.UserEmulatorConfiguration
{
EmulatorType = "",
Core = "",
EnableBIOSFiles = new List<string>()
};
}
long? LastPlayedRomId = null;
bool? LastPlayedIsMediagroup = false;
string? LastPlayedRomName = null;

View File

@@ -334,7 +334,7 @@ namespace gaseous_server.Classes.Metadata
switch (propertyTypeName.ToLower())
{
case "system.collections.generic.list":
var listArray = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(value.ToString());
var listArray = Newtonsoft.Json.JsonConvert.DeserializeObject<List<long>>(value.ToString());
property.SetValue(EndpointType, listArray);
break;

View File

@@ -345,99 +345,108 @@ namespace gaseous_server.Classes
try
{
MetadataSources metadataSource = (MetadataSources)Enum.Parse(typeof(MetadataSources), dr["GameIdType"].ToString());
Logging.Log(Logging.LogType.Information, "Metadata Refresh", "(" + StatusCounter + "/" + dt.Rows.Count + "): Refreshing metadata for game " + dr["name"] + " (" + dr["id"] + ") using source " + metadataSource.ToString());
HasheousClient.Models.Metadata.IGDB.Game game = Metadata.Games.GetGame(metadataSource, (long)dr["id"]);
// get supporting metadata
if (game != null)
MetadataSources metadataSource;
if (dr["GameIdType"] == DBNull.Value)
{
if (game.AgeRatings != null)
Logging.Log(Logging.LogType.Information, "Metadata Refresh", "(" + StatusCounter + "/" + dt.Rows.Count + "): Unable to refresh metadata for game " + dr["name"] + " (" + dr["id"] + ") - no source type specified");
}
else
{
metadataSource = (MetadataSources)Enum.Parse(typeof(MetadataSources), dr["GameIdType"].ToString());
Logging.Log(Logging.LogType.Information, "Metadata Refresh", "(" + StatusCounter + "/" + dt.Rows.Count + "): Refreshing metadata for game " + dr["name"] + " (" + dr["id"] + ") using source " + metadataSource.ToString());
HasheousClient.Models.Metadata.IGDB.Game game = Metadata.Games.GetGame(metadataSource, (long)dr["id"]);
// get supporting metadata
if (game != null)
{
foreach (long ageRatingId in game.AgeRatings)
if (game.AgeRatings != null)
{
AgeRating ageRating = Metadata.AgeRatings.GetAgeRating(metadataSource, ageRatingId);
if (ageRating.ContentDescriptions != null)
foreach (long ageRatingId in game.AgeRatings)
{
foreach (long ageRatingContentDescriptionId in ageRating.ContentDescriptions)
AgeRating ageRating = Metadata.AgeRatings.GetAgeRating(metadataSource, ageRatingId);
if (ageRating.ContentDescriptions != null)
{
Metadata.AgeRatingContentDescriptions.GetAgeRatingContentDescriptions(metadataSource, ageRatingContentDescriptionId);
foreach (long ageRatingContentDescriptionId in ageRating.ContentDescriptions)
{
Metadata.AgeRatingContentDescriptions.GetAgeRatingContentDescriptions(metadataSource, ageRatingContentDescriptionId);
}
}
}
}
}
if (game.AlternativeNames != null)
{
foreach (long alternateNameId in game.AlternativeNames)
if (game.AlternativeNames != null)
{
Metadata.AlternativeNames.GetAlternativeNames(metadataSource, alternateNameId);
foreach (long alternateNameId in game.AlternativeNames)
{
Metadata.AlternativeNames.GetAlternativeNames(metadataSource, alternateNameId);
}
}
}
if (game.Artworks != null)
{
foreach (long artworkId in game.Artworks)
if (game.Artworks != null)
{
Metadata.Artworks.GetArtwork(metadataSource, artworkId);
foreach (long artworkId in game.Artworks)
{
Metadata.Artworks.GetArtwork(metadataSource, artworkId);
}
}
}
if (game.Cover != null)
{
Metadata.Covers.GetCover(metadataSource, (long?)game.Cover);
}
if (game.GameModes != null)
{
foreach (long gameModeId in game.GameModes)
if (game.Cover != null)
{
Metadata.GameModes.GetGame_Modes(metadataSource, gameModeId);
Metadata.Covers.GetCover(metadataSource, (long?)game.Cover);
}
}
if (game.Genres != null)
{
foreach (long genreId in game.Genres)
if (game.GameModes != null)
{
Metadata.Genres.GetGenres(metadataSource, genreId);
foreach (long gameModeId in game.GameModes)
{
Metadata.GameModes.GetGame_Modes(metadataSource, gameModeId);
}
}
}
if (game.Videos != null)
{
foreach (long gameVideoId in game.Videos)
if (game.Genres != null)
{
Metadata.GamesVideos.GetGame_Videos(metadataSource, gameVideoId);
foreach (long genreId in game.Genres)
{
Metadata.Genres.GetGenres(metadataSource, genreId);
}
}
}
if (game.MultiplayerModes != null)
{
foreach (long multiplayerModeId in game.MultiplayerModes)
if (game.Videos != null)
{
Metadata.MultiplayerModes.GetGame_MultiplayerModes(metadataSource, multiplayerModeId);
foreach (long gameVideoId in game.Videos)
{
Metadata.GamesVideos.GetGame_Videos(metadataSource, gameVideoId);
}
}
}
if (game.PlayerPerspectives != null)
{
foreach (long playerPerspectiveId in game.PlayerPerspectives)
if (game.MultiplayerModes != null)
{
Metadata.PlayerPerspectives.GetGame_PlayerPerspectives(metadataSource, playerPerspectiveId);
foreach (long multiplayerModeId in game.MultiplayerModes)
{
Metadata.MultiplayerModes.GetGame_MultiplayerModes(metadataSource, multiplayerModeId);
}
}
}
if (game.ReleaseDates != null)
{
foreach (long releaseDateId in game.ReleaseDates)
if (game.PlayerPerspectives != null)
{
Metadata.ReleaseDates.GetReleaseDates(metadataSource, releaseDateId);
foreach (long playerPerspectiveId in game.PlayerPerspectives)
{
Metadata.PlayerPerspectives.GetGame_PlayerPerspectives(metadataSource, playerPerspectiveId);
}
}
}
if (game.Screenshots != null)
{
foreach (long screenshotId in game.Screenshots)
if (game.ReleaseDates != null)
{
Metadata.Screenshots.GetScreenshot(metadataSource, screenshotId);
foreach (long releaseDateId in game.ReleaseDates)
{
Metadata.ReleaseDates.GetReleaseDates(metadataSource, releaseDateId);
}
}
}
if (game.Themes != null)
{
foreach (long themeId in game.Themes)
if (game.Screenshots != null)
{
Metadata.Themes.GetGame_Themes(metadataSource, themeId);
foreach (long screenshotId in game.Screenshots)
{
Metadata.Screenshots.GetScreenshot(metadataSource, screenshotId);
}
}
if (game.Themes != null)
{
foreach (long themeId in game.Themes)
{
Metadata.Themes.GetGame_Themes(metadataSource, themeId);
}
}
}
}

View File

@@ -1901,8 +1901,9 @@ div[name="properties_profile_toc_item"]:hover {
button:not(.select2-selection__choice__remove):not(.select2-selection__clear):not(.ejs_menu_button):not(.bigbutton) {
background-color: var(--button-background);
background: var(--button-background-gradient);
color: var(--button-font-colour);
border-width: 1px;
border-width: 0px;
border-color: var(--button-border);
border-style: solid;
border-radius: var(--standard-radius);
@@ -1918,6 +1919,7 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
button:not(.select2-selection__choice__remove):not(.select2-selection__clear):not(.ejs_menu_button):hover {
background-color: var(--button-background-hover);
background: var(--button-background-hover);
border-color: var(--button-border-hover);
color: var(--button-font-colour-hover);
cursor: pointer;
@@ -1947,36 +1949,42 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
.redbutton {
background-color: var(--button-red-background) !important;
background: var(--button-red-background-gradient) !important;
border-color: var(--button-red-border) !important;
color: var(--button-red-font-colour) !important;
}
.redbutton:hover {
background-color: var(--button-red-background-hover) !important;
background: var(--button-red-background-hover) !important;
border-color: var(--button-red-border-hover) !important;
color: var(--button-red-font-colour-hover) !important;
}
.redbutton:disabled {
background-color: var(--button-red-background-disabled) !important;
background: var(--button-red-background-disabled) !important;
border-color: var(--button-red-border-disabled) !important;
color: var(--button-red-font-colour-disabled) !important;
}
.bluebutton {
background-color: var(--button-blue-background) !important;
background: var(--button-blue-background-gradient) !important;
border-color: var(--button-blue-border) !important;
color: var(--button-blue-font-colour) !important;
}
.bluebutton:hover {
background-color: var(--button-blue-background-hover) !important;
background: var(--button-blue-background-hover) !important;
border-color: var(--button-blue-border-hover) !important;
color: var(--button-blue-font-colour-hover) !important;
}
.bluebutton:disabled {
background-color: var(--button-blue-background-disabled) !important;
background: var(--button-blue-background-disabled) !important;
border-color: var(--button-blue-border-disabled) !important;
color: var(--button-blue-font-colour-disabled) !important;
}

View File

@@ -42,7 +42,8 @@
--input-font-colour: var(--page-font-colour);
/* button */
--button-background: rgb(85, 85, 85);
--button-background: rgb(110, 109, 109);
--button-background-gradient: linear-gradient(140deg, rgba(110, 109, 109, 1) 0%, rgba(85, 85, 85, 1) 100%);
--button-background-hover: rgb(136, 136, 136);
--button-background-disabled: var(--button-background-hover);
--button-border: rgb(85, 85, 85);
@@ -51,19 +52,21 @@
--button-font-colour: rgb(255, 255, 255);
--button-font-colour-hover: var(--button-font-colour);
--button-font-colour-disabled: var(--button-border-hover);
--button-red-background: darkred;
--button-red-background-hover: red;
--button-red-background: rgb(139, 0, 0);
--button-red-background-gradient: linear-gradient(140deg, rgba(255, 0, 0, 1) 0%, rgba(139, 0, 0, 1) 100%);
--button-red-background-hover: rgb(255, 0, 0);
--button-red-background-disabled: rgb(85, 85, 85);
--button-red-border: darkred;
--button-red-border-hover: red;
--button-red-border: rgb(139, 0, 0);
--button-red-border-hover: rgb(255, 0, 0);
--button-red-border-disabled: rgb(85, 85, 85);
--button-red-font-colour: rgb(255, 255, 255);
--button-red-font-colour-hover: var(--button-red-font-colour);
--button-red-font-colour-disabled: var(--button-red-font-colour);
--button-blue-background: rgb(0, 0, 170);
--button-blue-background-gradient: linear-gradient(140deg, rgba(0, 0, 255, 1) 0%, rgba(0, 0, 150, 1) 100%);
--button-blue-background-hover: rgb(0, 0, 255);
--button-blue-background-disabled: rgb(85, 85, 85);
--button-blue-border: rgb(0, 0, 170);
--button-blue-border: rgb(0, 0, 255);
--button-blue-border-hover: rgb(0, 0, 255);
--button-blue-border-disabled: rgb(85, 85, 85);
--button-blue-font-colour: rgb(255, 255, 255);