Resolved many database errors (#377)

* Resolved missing table errors.
* These were due to some dynamically created tables being queried before
they were created.
  * These tables are now created at start up.
* Resolved many "INSERT" errors that were polluting the logs:
* These were due to a race condition where sometimes the database would
return the data as not being in the database causing Gaseous to try to
insert it - even though the data was already there.
This commit is contained in:
Michael Green
2024-06-26 15:00:09 +10:00
committed by GitHub
parent ccf9afd561
commit 787bb47bd3
8 changed files with 341 additions and 241 deletions

View File

@@ -7,7 +7,7 @@ using Microsoft.CodeAnalysis.Elfie.Model.Strings;
namespace gaseous_server.Classes.Metadata namespace gaseous_server.Classes.Metadata
{ {
public class Covers public class Covers
{ {
const string fieldList = "fields alpha_channel,animated,checksum,game,game_localization,height,image_id,url,width;"; const string fieldList = "fields alpha_channel,animated,checksum,game,game_localization,height,image_id,url,width;";
@@ -70,7 +70,7 @@ namespace gaseous_server.Classes.Metadata
returnValue = await GetObjectFromServer(WhereClause, ImagePath); returnValue = await GetObjectFromServer(WhereClause, ImagePath);
Storage.NewCacheValue(returnValue); Storage.NewCacheValue(returnValue);
forceImageDownload = true; forceImageDownload = true;
break; break;
case Storage.CacheStatus.Expired: case Storage.CacheStatus.Expired:
try try
{ {
@@ -135,6 +135,6 @@ namespace gaseous_server.Classes.Metadata
return result; return result;
} }
} }
} }

View File

@@ -5,8 +5,8 @@ using IGDB.Models;
namespace gaseous_server.Classes.Metadata namespace gaseous_server.Classes.Metadata
{ {
public class Games public class Games
{ {
const string fieldList = "fields age_ratings,aggregated_rating,aggregated_rating_count,alternative_names,artworks,bundles,category,checksum,collection,collections,cover,created_at,dlcs,expanded_games,expansions,external_games,first_release_date,follows,forks,franchise,franchises,game_engines,game_localizations,game_modes,genres,hypes,involved_companies,keywords,language_supports,multiplayer_modes,name,parent_game,platforms,player_perspectives,ports,rating,rating_count,release_dates,remakes,remasters,screenshots,similar_games,slug,standalone_expansions,status,storyline,summary,tags,themes,total_rating,total_rating_count,updated_at,url,version_parent,version_title,videos,websites;"; const string fieldList = "fields age_ratings,aggregated_rating,aggregated_rating_count,alternative_names,artworks,bundles,category,checksum,collection,collections,cover,created_at,dlcs,expanded_games,expansions,external_games,first_release_date,follows,forks,franchise,franchises,game_engines,game_localizations,game_modes,genres,hypes,involved_companies,keywords,language_supports,multiplayer_modes,name,parent_game,platforms,player_perspectives,ports,rating,rating_count,release_dates,remakes,remasters,screenshots,similar_games,slug,standalone_expansions,status,storyline,summary,tags,themes,total_rating,total_rating_count,updated_at,url,version_parent,version_title,videos,websites;";
public Games() public Games()
@@ -15,9 +15,9 @@ namespace gaseous_server.Classes.Metadata
} }
public class InvalidGameId : Exception public class InvalidGameId : Exception
{ {
public InvalidGameId(long Id) : base("Unable to find Game by id " + Id) public InvalidGameId(long Id) : base("Unable to find Game by id " + Id)
{} { }
} }
public static Game? GetGame(long Id, bool getAllMetadata, bool followSubGames, bool forceRefresh) public static Game? GetGame(long Id, bool getAllMetadata, bool followSubGames, bool forceRefresh)
@@ -125,17 +125,17 @@ namespace gaseous_server.Classes.Metadata
private static void UpdateSubClasses(Game Game, bool getAllMetadata, bool followSubGames, bool forceRefresh) private static void UpdateSubClasses(Game Game, bool getAllMetadata, bool followSubGames, bool forceRefresh)
{ {
// required metadata // required metadata
if (Game.Cover != null) // if (Game.Cover != null)
{ // {
try // try
{ // {
Cover GameCover = Covers.GetCover(Game.Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(Game), forceRefresh); // Cover GameCover = Covers.GetCover(Game.Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(Game), forceRefresh);
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
Logging.Log(Logging.LogType.Critical, "Game Metadata", "Unable to fetch cover artwork.", ex); // Logging.Log(Logging.LogType.Critical, "Game Metadata", "Unable to fetch cover artwork.", ex);
} // }
} // }
if (Game.Genres != null) if (Game.Genres != null)
{ {
@@ -285,7 +285,7 @@ namespace gaseous_server.Classes.Metadata
{ {
try try
{ {
Screenshot GameScreenshot = Screenshots.GetScreenshot(ScreenshotId, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(Game), forceRefresh); Screenshot GameScreenshot = Screenshots.GetScreenshot(ScreenshotId, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(Game), forceRefresh);
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -347,7 +347,7 @@ namespace gaseous_server.Classes.Metadata
// get missing metadata from parent if this is a port // get missing metadata from parent if this is a port
if (result.Category == Category.Port) if (result.Category == Category.Port)
{ {
if (result.Summary == null) if (result.Summary == null)
{ {
if (result.ParentGame != null) if (result.ParentGame != null)
@@ -364,7 +364,7 @@ namespace gaseous_server.Classes.Metadata
return result; return result;
} }
public static void AssignAllGamesToPlatformIdZero() public static void AssignAllGamesToPlatformIdZero()
{ {
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString); Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
@@ -428,7 +428,7 @@ namespace gaseous_server.Classes.Metadata
} }
string sql = "SELECT Game.Id, Game.`Name`, Game.Slug, Relation_Game_Platforms.PlatformsId AS PlatformsId, Game.Summary FROM gaseous.Game JOIN Relation_Game_Platforms ON Game.Id = Relation_Game_Platforms.GameId WHERE " + whereClause + ";"; string sql = "SELECT Game.Id, Game.`Name`, Game.Slug, Relation_Game_Platforms.PlatformsId AS PlatformsId, Game.Summary FROM gaseous.Game JOIN Relation_Game_Platforms ON Game.Id = Relation_Game_Platforms.GameId WHERE " + whereClause + ";";
// get Game metadata // get Game metadata
Game[]? results = new Game[0]; Game[]? results = new Game[0];
@@ -439,7 +439,8 @@ namespace gaseous_server.Classes.Metadata
DataTable data = db.ExecuteCMD(sql, dbDict); DataTable data = db.ExecuteCMD(sql, dbDict);
foreach (DataRow row in data.Rows) foreach (DataRow row in data.Rows)
{ {
Game game = new Game{ Game game = new Game
{
Id = (long)row["Id"], Id = (long)row["Id"],
Name = (string)Common.ReturnValueIfNull(row["Name"], ""), Name = (string)Common.ReturnValueIfNull(row["Name"], ""),
Slug = (string)Common.ReturnValueIfNull(row["Slug"], ""), Slug = (string)Common.ReturnValueIfNull(row["Slug"], ""),
@@ -476,12 +477,12 @@ namespace gaseous_server.Classes.Metadata
searchBody = "where platforms = (" + PlatformId + ") & name ~ \"" + SearchString + "\";"; searchBody = "where platforms = (" + PlatformId + ") & name ~ \"" + SearchString + "\";";
break; break;
} }
// check search cache // check search cache
Game[]? games = Communications.GetSearchCache<Game[]?>(searchFields, searchBody); Game[]? games = Communications.GetSearchCache<Game[]?>(searchFields, searchBody);
if (games == null) if (games == null)
{ {
// cache miss // cache miss
// get Game metadata // get Game metadata
Communications comms = new Communications(); Communications comms = new Communications();
@@ -513,7 +514,7 @@ namespace gaseous_server.Classes.Metadata
foreach (DataRow row in data.Rows) foreach (DataRow row in data.Rows)
{ {
KeyValuePair<long, string> valuePair = new KeyValuePair<long, string>((long)row["PlatformId"], (string)row["Name"]); KeyValuePair<long, string> valuePair = new KeyValuePair<long, string>((long)row["PlatformId"], (string)row["Name"]);
platforms.Add(valuePair); platforms.Add(valuePair);
} }
return platforms; return platforms;
@@ -533,7 +534,7 @@ namespace gaseous_server.Classes.Metadata
{ {
} }
public MinimalGameItem(Game gameObject) public MinimalGameItem(Game gameObject)
{ {
this.Id = gameObject.Id; this.Id = gameObject.Id;

View File

@@ -7,19 +7,19 @@ using Microsoft.Extensions.Caching.Memory;
namespace gaseous_server.Classes.Metadata namespace gaseous_server.Classes.Metadata
{ {
public class Storage public class Storage
{ {
public enum CacheStatus public enum CacheStatus
{ {
NotPresent, NotPresent,
Current, Current,
Expired Expired
} }
public static CacheStatus GetCacheStatus(string Endpoint, string Slug) public static CacheStatus GetCacheStatus(string Endpoint, string Slug)
{ {
return _GetCacheStatus(Endpoint, "slug", Slug); return _GetCacheStatus(Endpoint, "slug", Slug);
} }
public static CacheStatus GetCacheStatus(string Endpoint, long Id) public static CacheStatus GetCacheStatus(string Endpoint, long Id)
{ {
@@ -47,124 +47,124 @@ namespace gaseous_server.Classes.Metadata
} }
private static CacheStatus _GetCacheStatus(string Endpoint, string SearchField, object SearchValue) private static CacheStatus _GetCacheStatus(string Endpoint, string SearchField, object SearchValue)
{ {
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString); Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
string sql = "SELECT lastUpdated FROM " + Endpoint + " WHERE " + SearchField + " = @" + SearchField; string sql = "SELECT lastUpdated FROM " + Endpoint + " WHERE " + SearchField + " = @" + SearchField;
Dictionary<string, object> dbDict = new Dictionary<string, object>(); Dictionary<string, object> dbDict = new Dictionary<string, object>();
dbDict.Add("Endpoint", Endpoint); dbDict.Add("Endpoint", Endpoint);
dbDict.Add(SearchField, SearchValue); dbDict.Add(SearchField, SearchValue);
DataTable dt = db.ExecuteCMD(sql, dbDict); DataTable dt = db.ExecuteCMD(sql, dbDict);
if (dt.Rows.Count == 0) if (dt.Rows.Count == 0)
{ {
// no data stored for this item, or lastUpdated // no data stored for this item, or lastUpdated
return CacheStatus.NotPresent; return CacheStatus.NotPresent;
} }
else else
{ {
DateTime CacheExpiryTime = DateTime.UtcNow.AddHours(-168); DateTime CacheExpiryTime = DateTime.UtcNow.AddHours(-168);
if ((DateTime)dt.Rows[0]["lastUpdated"] < CacheExpiryTime) if ((DateTime)dt.Rows[0]["lastUpdated"] < CacheExpiryTime)
{ {
return CacheStatus.Expired; return CacheStatus.Expired;
} }
else else
{ {
return CacheStatus.Current; return CacheStatus.Current;
} }
} }
} }
public static void NewCacheValue(object ObjectToCache, bool UpdateRecord = false) public static void NewCacheValue(object ObjectToCache, bool UpdateRecord = false)
{ {
// get the object type name // get the object type name
string ObjectTypeName = ObjectToCache.GetType().Name; string ObjectTypeName = ObjectToCache.GetType().Name;
// build dictionary // build dictionary
string objectJson = Newtonsoft.Json.JsonConvert.SerializeObject(ObjectToCache); string objectJson = Newtonsoft.Json.JsonConvert.SerializeObject(ObjectToCache);
Dictionary<string, object?> objectDict = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object?>>(objectJson); Dictionary<string, object?> objectDict = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object?>>(objectJson);
objectDict.Add("dateAdded", DateTime.UtcNow); objectDict.Add("dateAdded", DateTime.UtcNow);
objectDict.Add("lastUpdated", DateTime.UtcNow); objectDict.Add("lastUpdated", DateTime.UtcNow);
// generate sql // generate sql
string fieldList = ""; string fieldList = "";
string valueList = ""; string valueList = "";
string updateFieldValueList = ""; string updateFieldValueList = "";
foreach (KeyValuePair<string, object?> key in objectDict) foreach (KeyValuePair<string, object?> key in objectDict)
{ {
if (fieldList.Length > 0) if (fieldList.Length > 0)
{ {
fieldList = fieldList + ", "; fieldList = fieldList + ", ";
valueList = valueList + ", "; valueList = valueList + ", ";
} }
fieldList = fieldList + key.Key; fieldList = fieldList + key.Key;
valueList = valueList + "@" + key.Key; valueList = valueList + "@" + key.Key;
if ((key.Key != "id") && (key.Key != "dateAdded")) if ((key.Key != "id") && (key.Key != "dateAdded"))
{ {
if (updateFieldValueList.Length > 0) if (updateFieldValueList.Length > 0)
{ {
updateFieldValueList = updateFieldValueList + ", "; updateFieldValueList = updateFieldValueList + ", ";
} }
updateFieldValueList += key.Key + " = @" + key.Key; updateFieldValueList += key.Key + " = @" + key.Key;
} }
// check property type // check property type
Type objectType = ObjectToCache.GetType(); Type objectType = ObjectToCache.GetType();
if (objectType != null) if (objectType != null)
{ {
PropertyInfo objectProperty = objectType.GetProperty(key.Key); PropertyInfo objectProperty = objectType.GetProperty(key.Key);
if (objectProperty != null) if (objectProperty != null)
{ {
string compareName = objectProperty.PropertyType.Name.ToLower().Split("`")[0]; string compareName = objectProperty.PropertyType.Name.ToLower().Split("`")[0];
var objectValue = objectProperty.GetValue(ObjectToCache); var objectValue = objectProperty.GetValue(ObjectToCache);
if (objectValue != null) if (objectValue != null)
{ {
string newObjectValue; string newObjectValue;
Dictionary<string, object> newDict; Dictionary<string, object> newDict;
switch (compareName) switch (compareName)
{ {
case "identityorvalue": case "identityorvalue":
newObjectValue = Newtonsoft.Json.JsonConvert.SerializeObject(objectValue); newObjectValue = Newtonsoft.Json.JsonConvert.SerializeObject(objectValue);
newDict = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(newObjectValue); newDict = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(newObjectValue);
objectDict[key.Key] = newDict["Id"]; objectDict[key.Key] = newDict["Id"];
break; break;
case "identitiesorvalues": case "identitiesorvalues":
newObjectValue = Newtonsoft.Json.JsonConvert.SerializeObject(objectValue); newObjectValue = Newtonsoft.Json.JsonConvert.SerializeObject(objectValue);
newDict = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(newObjectValue); newDict = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(newObjectValue);
newObjectValue = Newtonsoft.Json.JsonConvert.SerializeObject(newDict["Ids"]); newObjectValue = Newtonsoft.Json.JsonConvert.SerializeObject(newDict["Ids"]);
objectDict[key.Key] = newObjectValue; objectDict[key.Key] = newObjectValue;
StoreRelations(ObjectTypeName, key.Key, (long)objectDict["Id"], newObjectValue); StoreRelations(ObjectTypeName, key.Key, (long)objectDict["Id"], newObjectValue);
break; break;
case "int32[]": case "int32[]":
newObjectValue = Newtonsoft.Json.JsonConvert.SerializeObject(objectValue); newObjectValue = Newtonsoft.Json.JsonConvert.SerializeObject(objectValue);
objectDict[key.Key] = newObjectValue; objectDict[key.Key] = newObjectValue;
break; break;
} }
} }
} }
} }
} }
string sql = ""; string sql = "";
if (UpdateRecord == false) if (UpdateRecord == false)
{ {
sql = "INSERT INTO " + ObjectTypeName + " (" + fieldList + ") VALUES (" + valueList + ")"; sql = "INSERT INTO " + ObjectTypeName + " (" + fieldList + ") VALUES (" + valueList + ")";
}
else
{
sql = "UPDATE " + ObjectTypeName + " SET " + updateFieldValueList + " WHERE Id = @Id";
} }
else
{
sql = "UPDATE " + ObjectTypeName + " SET " + updateFieldValueList + " WHERE Id = @Id";
}
// execute sql // execute sql
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString); Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
db.ExecuteCMD(sql, objectDict); db.ExecuteCMD(sql, objectDict);
} }
public static T GetCacheValue<T>(T EndpointType, string SearchField, object SearchValue) public static T GetCacheValue<T>(T EndpointType, string SearchField, object SearchValue)
{ {
string Endpoint = EndpointType.GetType().Name; string Endpoint = EndpointType.GetType().Name;
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString); Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
@@ -178,20 +178,20 @@ namespace gaseous_server.Classes.Metadata
DataTable dt = db.ExecuteCMD(sql, dbDict); DataTable dt = db.ExecuteCMD(sql, dbDict);
if (dt.Rows.Count == 0) if (dt.Rows.Count == 0)
{ {
// no data stored for this item // no data stored for this item
throw new Exception("No record found that matches endpoint " + Endpoint + " with search value " + SearchValue); throw new Exception("No record found that matches endpoint " + Endpoint + " with search value " + SearchValue);
} }
else else
{ {
DataRow dataRow = dt.Rows[0]; DataRow dataRow = dt.Rows[0];
object returnObject = BuildCacheObject<T>(EndpointType, dataRow); object returnObject = BuildCacheObject<T>(EndpointType, dataRow);
return (T)returnObject; return (T)returnObject;
} }
} }
public static T BuildCacheObject<T>(T EndpointType, DataRow dataRow) public static T BuildCacheObject<T>(T EndpointType, DataRow dataRow)
{ {
foreach (PropertyInfo property in EndpointType.GetType().GetProperties()) foreach (PropertyInfo property in EndpointType.GetType().GetProperties())
{ {
if (dataRow.Table.Columns.Contains(property.Name)) if (dataRow.Table.Columns.Contains(property.Name))
@@ -428,11 +428,35 @@ namespace gaseous_server.Classes.Metadata
} }
} }
public static void CreateRelationsTables<T>()
{
string PrimaryTable = typeof(T).Name;
foreach (PropertyInfo property in typeof(T).GetProperties())
{
string SecondaryTable = property.Name;
if (property.PropertyType.Name == "IdentitiesOrValues`1")
{
string TableName = "Relation_" + PrimaryTable + "_" + SecondaryTable;
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
string sql = "SELECT * FROM information_schema.tables WHERE table_schema = '" + Config.DatabaseConfiguration.DatabaseName + "' AND table_name = '" + TableName + "';";
DataTable data = db.ExecuteCMD(sql);
if (data.Rows.Count == 0)
{
// table doesn't exist, create it
sql = "CREATE TABLE `" + Config.DatabaseConfiguration.DatabaseName + "`.`" + TableName + "` (`" + PrimaryTable + "Id` BIGINT NOT NULL, `" + SecondaryTable + "Id` BIGINT NOT NULL, PRIMARY KEY (`" + PrimaryTable + "Id`, `" + SecondaryTable + "Id`), INDEX `idx_PrimaryColumn` (`" + PrimaryTable + "Id` ASC) VISIBLE);";
db.ExecuteCMD(sql);
}
}
}
}
private class MemoryCacheObject private class MemoryCacheObject
{ {
public object Object { get; set; } public object Object { get; set; }
public DateTime CreationTime { get; } = DateTime.UtcNow; public DateTime CreationTime { get; } = DateTime.UtcNow;
public DateTime ExpiryTime public DateTime ExpiryTime
{ {
get get
{ {

View File

@@ -73,7 +73,8 @@ namespace gaseous_server.Controllers
private static async Task<List<GaseousGame>> _SearchForGame(long PlatformId, string SearchString) private static async Task<List<GaseousGame>> _SearchForGame(long PlatformId, string SearchString)
{ {
string searchBody = ""; string searchBody = "";
string searchFields = "fields cover,first_release_date,name,platforms,slug; "; // string searchFields = "fields cover,first_release_date,name,platforms,slug; ";
string searchFields = "fields *; ";
searchBody += "search \"" + SearchString + "\";"; searchBody += "search \"" + SearchString + "\";";
searchBody += "where platforms = (" + PlatformId + ");"; searchBody += "where platforms = (" + PlatformId + ");";
searchBody += "limit 100;"; searchBody += "limit 100;";
@@ -86,12 +87,12 @@ namespace gaseous_server.Controllers
// get Game metadata from data source // get Game metadata from data source
Communications comms = new Communications(); Communications comms = new Communications();
var results = await comms.APIComm<Game>(IGDBClient.Endpoints.Games, searchFields, searchBody); var results = await comms.APIComm<Game>(IGDBClient.Endpoints.Games, searchFields, searchBody);
List<GaseousGame> games = new List<GaseousGame>(); List<GaseousGame> games = new List<GaseousGame>();
foreach (Game game in results.ToList()) foreach (Game game in results.ToList())
{ {
Storage.CacheStatus cacheStatus = Storage.GetCacheStatus("Game", (long)game.Id); Storage.CacheStatus cacheStatus = Storage.GetCacheStatus("Game", (long)game.Id);
switch(cacheStatus) switch (cacheStatus)
{ {
case Storage.CacheStatus.NotPresent: case Storage.CacheStatus.NotPresent:
Storage.NewCacheValue(game, false); Storage.NewCacheValue(game, false);

View File

@@ -16,7 +16,7 @@ namespace gaseous_server.Models
{ {
var targetType = this.GetType(); var targetType = this.GetType();
var sourceType = game.GetType(); var sourceType = game.GetType();
foreach(var prop in targetType.GetProperties(BindingFlags.Instance | BindingFlags.Public| BindingFlags.SetProperty)) foreach (var prop in targetType.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty))
{ {
// check whether source object has the the property // check whether source object has the the property
var sp = sourceType.GetProperty(prop.Name); var sp = sourceType.GetProperty(prop.Name);
@@ -39,7 +39,11 @@ namespace gaseous_server.Models
{ {
if (this.Cover.Id != null) if (this.Cover.Id != null)
{ {
IGDB.Models.Cover cover = Covers.GetCover(Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(this), false); // IGDB.Models.Cover cover = Covers.GetCover(Cover.Id, Config.LibraryConfiguration.LibraryMetadataDirectory_Game(this), false);
IGDB.Models.Cover cover = new IGDB.Models.Cover()
{
Id = this.Cover.Id
};
return cover; return cover;
} }

View File

@@ -36,6 +36,9 @@ db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.Conn
// set up db // set up db
db.InitDB(); db.InitDB();
// create relation tables if they don't exist
Storage.CreateRelationsTables<IGDB.Models.Game>();
Storage.CreateRelationsTables<IGDB.Models.Platform>();
// populate db with static data for lookups // populate db with static data for lookups
AgeRatings.PopulateAgeMap(); AgeRatings.PopulateAgeMap();
@@ -273,7 +276,7 @@ using (var scope = app.Services.CreateScope())
{ {
var roleManager = scope.ServiceProvider.GetRequiredService<RoleStore>(); var roleManager = scope.ServiceProvider.GetRequiredService<RoleStore>();
var roles = new[] { "Admin", "Gamer", "Player" }; var roles = new[] { "Admin", "Gamer", "Player" };
foreach (var role in roles) foreach (var role in roles)
{ {
if (await roleManager.FindByNameAsync(role, CancellationToken.None) == null) if (await roleManager.FindByNameAsync(role, CancellationToken.None) == null)
@@ -303,11 +306,11 @@ app.Use(async (context, next) =>
string correlationId = Guid.NewGuid().ToString(); string correlationId = Guid.NewGuid().ToString();
CallContext.SetData("CorrelationId", correlationId); CallContext.SetData("CorrelationId", correlationId);
CallContext.SetData("CallingProcess", context.Request.Method + ": " + context.Request.Path); CallContext.SetData("CallingProcess", context.Request.Method + ": " + context.Request.Path);
string userIdentity; string userIdentity;
try try
{ {
userIdentity = context.User.Claims.Where(x=>x.Type==System.Security.Claims.ClaimTypes.NameIdentifier).FirstOrDefault().Value; userIdentity = context.User.Claims.Where(x => x.Type == System.Security.Claims.ClaimTypes.NameIdentifier).FirstOrDefault().Value;
} }
catch catch
{ {
@@ -329,7 +332,7 @@ app.Use(async (context, next) =>
// - the server will not start while the RecoverAccount.txt file exists // - the server will not start while the RecoverAccount.txt file exists
string PasswordRecoveryFile = Path.Combine(Config.LibraryConfiguration.LibraryRootDirectory, "RecoverAccount.txt"); string PasswordRecoveryFile = Path.Combine(Config.LibraryConfiguration.LibraryRootDirectory, "RecoverAccount.txt");
if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("recoveraccount"))) if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("recoveraccount")))
{ {
if (File.Exists(PasswordRecoveryFile)) if (File.Exists(PasswordRecoveryFile))
{ {
// password has already been set - do nothing and just exit // password has already been set - do nothing and just exit
@@ -345,7 +348,7 @@ if (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("recoveraccount")))
string password = new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray()); string password = new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray());
File.WriteAllText(PasswordRecoveryFile, password); File.WriteAllText(PasswordRecoveryFile, password);
// reset the password // reset the password
using (var scope = app.Services.CreateScope()) using (var scope = app.Services.CreateScope())
{ {

View File

@@ -39,7 +39,7 @@ function ajaxCall(endpoint, method, successFunction, errorFunction, body) {
function getQueryString(stringName, type) { function getQueryString(stringName, type) {
const urlParams = new URLSearchParams(window.location.search); const urlParams = new URLSearchParams(window.location.search);
var myParam = urlParams.get(stringName); var myParam = urlParams.get(stringName);
switch (type) { switch (type) {
case "int": case "int":
@@ -63,9 +63,9 @@ function getQueryString(stringName, type) {
function setCookie(cname, cvalue, exdays) { function setCookie(cname, cvalue, exdays) {
const d = new Date(); const d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000)); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
if (exdays) { if (exdays) {
let expires = "expires="+ d.toUTCString(); let expires = "expires=" + d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
} else { } else {
document.cookie = cname + "=" + cvalue + ";path=/"; document.cookie = cname + "=" + cvalue + ";path=/";
@@ -76,14 +76,14 @@ function getCookie(cname) {
let name = cname + "="; let name = cname + "=";
let decodedCookie = decodeURIComponent(document.cookie); let decodedCookie = decodeURIComponent(document.cookie);
let ca = decodedCookie.split(';'); let ca = decodedCookie.split(';');
for(let i = 0; i <ca.length; i++) { for (let i = 0; i < ca.length; i++) {
let c = ca[i]; let c = ca[i];
while (c.charAt(0) == ' ') { while (c.charAt(0) == ' ') {
c = c.substring(1); c = c.substring(1);
} }
if (c.indexOf(name) == 0) { if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length); return c.substring(name.length, c.length);
} }
} }
return ""; return "";
} }
@@ -207,7 +207,7 @@ function createTableRow(isHeader, row, rowClass, cellClass) {
} }
var newCell = document.createElement(cellType); var newCell = document.createElement(cellType);
if (typeof(row[i]) != "object") { if (typeof (row[i]) != "object") {
newCell.innerHTML = row[i]; newCell.innerHTML = row[i];
newCell.className = cellClass; newCell.className = cellClass;
} else { } else {
@@ -258,7 +258,7 @@ function DropDownRenderGameOption(state) {
if (state.cover) { if (state.cover) {
response = $( response = $(
'<table class="dropdown-div"><tr><td class="dropdown-cover"><img src="/api/v1.1/Games/' + state.id + '/cover/image/cover_small/' + state.cover.imageId + '.jpg" /></td><td class="dropdown-label"><span class="dropdown-title">' + state.text + '</span><span class="dropdown-releasedate">' + releaseDate + '</span></td></tr></table>' '<table class="dropdown-div"><tr><td class="dropdown-cover"><img src="/api/v1.1/Games/' + state.id + '/cover/image/cover_small/' + state.id + '.jpg" class="game_tile_small_search" /></td><td class="dropdown-label"><span class="dropdown-title">' + state.text + '</span><span class="dropdown-releasedate">' + releaseDate + '</span></td></tr></table>'
); );
} else { } else {
response = $( response = $(
@@ -317,8 +317,8 @@ function CreateEditableTable(TableName, Headers) {
var addButton = document.createElement('button'); var addButton = document.createElement('button');
addButton.value = 'Add Row'; addButton.value = 'Add Row';
addButton.innerHTML = 'Add Row'; addButton.innerHTML = 'Add Row';
$(addButton).click(function() { $(addButton).click(function () {
eTable.appendChild(AddEditableTableRow(Headers)); eTable.appendChild(AddEditableTableRow(Headers));
}); });
@@ -463,10 +463,10 @@ function SetPreference(Setting, Value) {
ajaxCall( ajaxCall(
'/api/v1.1/Account/Preferences', '/api/v1.1/Account/Preferences',
'POST', 'POST',
function(result) { function (result) {
SetPreference_Local(Setting, Value); SetPreference_Local(Setting, Value);
}, },
function(error) { function (error) {
SetPreference_Local(Setting, Value); SetPreference_Local(Setting, Value);
}, },
JSON.stringify(model) JSON.stringify(model)
@@ -478,12 +478,12 @@ function SetPreference_Batch(model) {
ajaxCall( ajaxCall(
'/api/v1.1/Account/Preferences', '/api/v1.1/Account/Preferences',
'POST', 'POST',
function(result) { function (result) {
for (var i = 0; i < model.length; i++) { for (var i = 0; i < model.length; i++) {
SetPreference_Local(model[i].setting, model[i].value.toString()); SetPreference_Local(model[i].setting, model[i].value.toString());
} }
}, },
function(error) { function (error) {
for (var i = 0; i < model.length; i++) { for (var i = 0; i < model.length; i++) {
SetPreference_Local(model[i].setting, model[i].value.toString()); SetPreference_Local(model[i].setting, model[i].value.toString());
} }
@@ -509,11 +509,11 @@ function SetPreference_Local(Setting, Value) {
} }
} }
function Uint8ToString(u8a){ function Uint8ToString(u8a) {
var CHUNK_SZ = 0x8000; var CHUNK_SZ = 0x8000;
var c = []; var c = [];
for (var i=0; i < u8a.length; i+=CHUNK_SZ) { for (var i = 0; i < u8a.length; i += CHUNK_SZ) {
c.push(String.fromCharCode.apply(null, u8a.subarray(i, i+CHUNK_SZ))); c.push(String.fromCharCode.apply(null, u8a.subarray(i, i + CHUNK_SZ)));
} }
return c.join(""); return c.join("");
} }

View File

@@ -23,21 +23,29 @@ h3 {
border-bottom-width: 1px; border-bottom-width: 1px;
/*border-image: linear-gradient(to right, blue 25%, yellow 25%, yellow 50%,red 50%, red 75%, teal 75%) 5;*/ /*border-image: linear-gradient(to right, blue 25%, yellow 25%, yellow 50%,red 50%, red 75%, teal 75%) 5;*/
border-image: linear-gradient(to right, rgba(255,0,0,1) 0%, rgba(251,255,0,1) 16%, rgba(0,255,250,1) 30%, rgba(0,16,255,1) 46%, rgba(250,0,255,1) 62%, rgba(255,0,0,1) 78%, rgba(255,237,0,1) 90%, rgba(20,255,0,1) 100%) 5; border-image: linear-gradient(to right, rgba(255, 0, 0, 1) 0%, rgba(251, 255, 0, 1) 16%, rgba(0, 255, 250, 1) 30%, rgba(0, 16, 255, 1) 46%, rgba(250, 0, 255, 1) 62%, rgba(255, 0, 0, 1) 78%, rgba(255, 237, 0, 1) 90%, rgba(20, 255, 0, 1) 100%) 5;
} }
/* The Modal (background) */ /* The Modal (background) */
.modal { .modal {
display: none; /* Hidden by default */ display: none;
position: fixed; /* Stay in place */ /* Hidden by default */
z-index: 100; /* Sit on top */ position: fixed;
/* Stay in place */
z-index: 100;
/* Sit on top */
left: 0; left: 0;
top: 0; top: 0;
width: 100%; /* Full width */ width: 100%;
height: 100%; /* Full height */ /* Full width */
overflow: none; /* Enable scroll if needed */ height: 100%;
background-color: rgb(0,0,0); /* Fallback color */ /* Full height */
background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ overflow: none;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
backdrop-filter: blur(8px); backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
filter: drop-shadow(5px 5px 10px #000); filter: drop-shadow(5px 5px 10px #000);
@@ -47,22 +55,28 @@ h3 {
/* Modal Content/Box */ /* Modal Content/Box */
.modal-content { .modal-content {
background-color: #383838; background-color: #383838;
margin: 10% auto; /* 15% from the top and centered */ margin: 10% auto;
/* 15% from the top and centered */
padding: 10px; padding: 10px;
border: 1px solid #888; border: 1px solid #888;
border-radius: 10px; border-radius: 10px;
width: 700px; /* Could be more or less, depending on screen size */ width: 700px;
/* Could be more or less, depending on screen size */
min-height: 358px; min-height: 358px;
} }
.modal-content-sub { .modal-content-sub {
background-color: #383838; background-color: #383838;
margin: 20% auto; /* 20% from the top and centered */ margin: 20% auto;
/* 20% from the top and centered */
padding: 10px; padding: 10px;
border: 1px solid #888; border: 1px solid #888;
border-radius: 10px; border-radius: 10px;
width: 300px; /* Could be more or less, depending on screen size */ width: 300px;
/* Could be more or less, depending on screen size */
min-height: 110px; min-height: 110px;
} }
#modal-heading { #modal-heading {
margin-block: 5px; margin-block: 5px;
border-bottom-style: solid; border-bottom-style: solid;
@@ -70,8 +84,9 @@ h3 {
border-bottom-width: 3px; border-bottom-width: 3px;
/*border-image: linear-gradient(to right, blue 25%, yellow 25%, yellow 50%,red 50%, red 75%, teal 75%) 5;*/ /*border-image: linear-gradient(to right, blue 25%, yellow 25%, yellow 50%,red 50%, red 75%, teal 75%) 5;*/
border-image: linear-gradient(to right, rgba(255,0,0,1) 0%, rgba(251,255,0,1) 16%, rgba(0,255,250,1) 30%, rgba(0,16,255,1) 46%, rgba(250,0,255,1) 62%, rgba(255,0,0,1) 78%, rgba(255,237,0,1) 90%, rgba(20,255,0,1) 100%) 5; border-image: linear-gradient(to right, rgba(255, 0, 0, 1) 0%, rgba(251, 255, 0, 1) 16%, rgba(0, 255, 250, 1) 30%, rgba(0, 16, 255, 1) 46%, rgba(250, 0, 255, 1) 62%, rgba(255, 0, 0, 1) 78%, rgba(255, 237, 0, 1) 90%, rgba(20, 255, 0, 1) 100%) 5;
} }
#modal-content { #modal-content {
height: 100%; height: 100%;
} }
@@ -268,7 +283,7 @@ h3 {
} }
#games_filter { #games_filter {
width: 200px; width: 200px;
/* border-style: solid; /* border-style: solid;
border-width: 1px; border-width: 1px;
@@ -296,7 +311,11 @@ h3 {
z-index: 1; z-index: 1;
} }
input[type='text'], input[type='number'], input[type="email"], input[type="password"], input[type="datetime-local"] { input[type='text'],
input[type='number'],
input[type="email"],
input[type="password"],
input[type="datetime-local"] {
background-color: #2b2b2b; background-color: #2b2b2b;
color: white; color: white;
padding: 4px; padding: 4px;
@@ -313,7 +332,11 @@ input[type='text'], input[type='number'], input[type="email"], input[type="passw
height: 21px; height: 21px;
} }
input[type='text']:hover, input[type='number']:hover, input[type="email"]:hover, input[type="password"]:hover, input[type="datetime-local"]:hover { input[type='text']:hover,
input[type='number']:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="datetime-local"]:hover {
border-color: #939393; border-color: #939393;
} }
@@ -351,9 +374,7 @@ input[name='filter_panel_range_max'] {
background: #555; background: #555;
} }
.text_link { .text_link {}
}
.text_link:hover { .text_link:hover {
cursor: pointer; cursor: pointer;
@@ -390,9 +411,9 @@ input[name='filter_panel_range_max'] {
background-color: rgba(0, 22, 56, 0.8); background-color: rgba(0, 22, 56, 0.8);
backdrop-filter: blur(8px); backdrop-filter: blur(8px);
-webkit-backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44); 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); -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);
} }
.games_pager_number { .games_pager_number {
@@ -525,13 +546,13 @@ input[name='filter_panel_range_max'] {
overflow-y: auto; overflow-y: auto;
/* display: flex; */ /* display: flex; */
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
#games_library_alpha_pager { #games_library_alpha_pager {
width: 50px; width: 50px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.games_library_alpha_pager_letter { .games_library_alpha_pager_letter {
@@ -604,6 +625,12 @@ input[name='filter_panel_range_max'] {
border: 1px solid #2b2b2b; border: 1px solid #2b2b2b;
} }
.game_tile_small_search {
min-height: 50px;
min-width: 50px;
width: 80px;
}
.game_tile_row { .game_tile_row {
padding: 5px; padding: 5px;
display: block; display: block;
@@ -706,9 +733,9 @@ input[name='filter_panel_range_max'] {
} }
.game_tile_image_shadow { .game_tile_image_shadow {
box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44); 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); -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);
} }
.game_tile_image_row { .game_tile_image_row {
@@ -720,11 +747,13 @@ input[name='filter_panel_range_max'] {
background-color: transparent; background-color: transparent;
} }
.game_tile_image, .unknown { .game_tile_image,
.unknown {
background-color: transparent; background-color: transparent;
} }
.game_tile_image_row, .unknown { .game_tile_image_row,
.unknown {
background-color: transparent; background-color: transparent;
} }
@@ -790,9 +819,9 @@ input[name='filter_panel_range_max'] {
max-width: 250px; max-width: 250px;
max-height: 350px; max-height: 350px;
width: 100%; width: 100%;
box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44); 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); -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);
} }
.gamegenrelabel { .gamegenrelabel {
@@ -842,9 +871,9 @@ input[name='filter_panel_range_max'] {
padding: 10px; padding: 10px;
/*height: 350px;*/ /*height: 350px;*/
margin-bottom: 20px; margin-bottom: 20px;
box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44); 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); -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);
} }
#gamescreenshots_main { #gamescreenshots_main {
@@ -903,11 +932,16 @@ iframe {
background-color: #383838; background-color: #383838;
color: black; color: black;
text-align: center; text-align: center;
user-select: none; /* standard syntax */ user-select: none;
-webkit-user-select: none; /* webkit (safari, chrome) browsers */ /* standard syntax */
-moz-user-select: none; /* mozilla browsers */ -webkit-user-select: none;
-khtml-user-select: none; /* webkit (konqueror) browsers */ /* webkit (safari, chrome) browsers */
-ms-user-select: none; /* IE10+ */ -moz-user-select: none;
/* mozilla browsers */
-khtml-user-select: none;
/* webkit (konqueror) browsers */
-ms-user-select: none;
/* IE10+ */
} }
.gamescreenshots_arrows:hover { .gamescreenshots_arrows:hover {
@@ -981,9 +1015,7 @@ iframe {
background-color: rgba(56, 56, 56, 0.9); background-color: rgba(56, 56, 56, 0.9);
} }
#gamesummarytext_label { #gamesummarytext_label {}
}
.line-clamp-4 { .line-clamp-4 {
overflow: hidden; overflow: hidden;
@@ -1057,9 +1089,9 @@ th {
-webkit-border-radius: 5px 5px 5px 5px; -webkit-border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px; -moz-border-radius: 5px 5px 5px 5px;
border: 1px solid #19d348; border: 1px solid #19d348;
box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44); 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); -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);
} }
.romstart:hover { .romstart:hover {
@@ -1084,9 +1116,9 @@ th {
border-color: white; border-color: white;
background-color: blue; background-color: blue;
outline-color: blue; outline-color: blue;
box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44); 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); -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);
} }
.properties_button:hover { .properties_button:hover {
@@ -1115,14 +1147,18 @@ th {
height: 100%; height: 100%;
} }
div[name="properties_toc_item"],div[name="properties_user_toc_item"],div[name="properties_profile_toc_item"] { div[name="properties_toc_item"],
div[name="properties_user_toc_item"],
div[name="properties_profile_toc_item"] {
padding: 10px; padding: 10px;
border-bottom-width: 1px; border-bottom-width: 1px;
border-bottom-style: solid; border-bottom-style: solid;
border-bottom-color: #2b2b2b; border-bottom-color: #2b2b2b;
} }
div[name="properties_toc_item"]:hover,div[name="properties_user_toc_item"]:hover,div[name="properties_profile_toc_item"]:hover { div[name="properties_toc_item"]:hover,
div[name="properties_user_toc_item"]:hover,
div[name="properties_profile_toc_item"]:hover {
background-color: #2b2b2b; background-color: #2b2b2b;
cursor: pointer; cursor: pointer;
} }
@@ -1150,7 +1186,8 @@ div[name="properties_toc_item"]:hover,div[name="properties_user_toc_item"]:hover
border-radius: 5px; border-radius: 5px;
} }
.select2-container--default:hover, .select2-selection--multiple:hover { .select2-container--default:hover,
.select2-selection--multiple:hover {
border-color: #939393; border-color: #939393;
} }
@@ -1197,7 +1234,8 @@ div[name="properties_toc_item"]:hover,div[name="properties_user_toc_item"]:hover
border-radius: 5px; border-radius: 5px;
} }
.select2-selection--single:hover, .select2-selection__rendered:hover { .select2-selection--single:hover,
.select2-selection__rendered:hover {
border-color: #939393; border-color: #939393;
} }
@@ -1302,9 +1340,7 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
background-color: #555; background-color: #555;
} }
#emulator { #emulator {}
}
.emulator_partscreen { .emulator_partscreen {
margin: 0 auto; margin: 0 auto;
@@ -1377,15 +1413,14 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
margin-left: 15px; margin-left: 15px;
} }
.rom_checkbox_box { .rom_checkbox_box {}
}
.rom_checkbox_box_hidden { .rom_checkbox_box_hidden {
display: none; display: none;
} }
#rom_edit, #rom_edit_delete { #rom_edit,
#rom_edit_delete {
float: right; float: right;
} }
@@ -1398,9 +1433,9 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
} }
#game { #game {
box-shadow: 5px 5px 19px 0px rgba(0,0,0,0.44); 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); -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);
} }
#gametitle_criticrating { #gametitle_criticrating {
@@ -1440,7 +1475,7 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
width: 1000px; width: 1000px;
height: 90%; height: 90%;
margin: 25px auto; margin: 25px auto;
/* overflow-x: scroll;*/ /* overflow-x: scroll;*/
position: relative; position: relative;
} }
@@ -1468,7 +1503,8 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
} }
.bgalt1 { .bgalt1 {
background-color: transparent;; background-color: transparent;
;
} }
.logs_table_cell_150px { .logs_table_cell_150px {
@@ -1520,13 +1556,33 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
background-color: #383838; background-color: #383838;
} }
.string { color: lightblue; } .string {
.number { color: lightblue; } color: lightblue;
.boolean { color: lightblue; } }
.null { color: magenta; }
.key { color: greenyellow; } .number {
.brace { color: #888; } color: lightblue;
.square { color: #fff000; } }
.boolean {
color: lightblue;
}
.null {
color: magenta;
}
.key {
color: greenyellow;
}
.brace {
color: #888;
}
.square {
color: #fff000;
}
.tagBox { .tagBox {
position: absolute; position: absolute;
@@ -1557,12 +1613,16 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
} }
.loginwindow { .loginwindow {
position: fixed; /* Stay in place */ position: fixed;
/* Stay in place */
left: 0; left: 0;
top: 0; top: 0;
width: 100%; /* Full width */ width: 100%;
height: 100%; /* Full height */ /* Full width */
overflow: auto; /* Enable scroll if needed */ height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
/*background-color: rgb(0,0,0); /* Fallback color */ /*background-color: rgb(0,0,0); /* Fallback color */
/*background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ /*background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
/*backdrop-filter: blur(8px); /*backdrop-filter: blur(8px);
@@ -1575,11 +1635,13 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
.loginwindow-content { .loginwindow-content {
position: relative; position: relative;
background-color: #383838; background-color: #383838;
margin: 15% auto; /* 15% from the top and centered */ margin: 15% auto;
/* 15% from the top and centered */
padding: 10px; padding: 10px;
border: 1px solid #888; border: 1px solid #888;
border-radius: 10px; border-radius: 10px;
width: 350px; /* Could be more or less, depending on screen size */ width: 350px;
/* Could be more or less, depending on screen size */
min-height: 250px; min-height: 250px;
} }
@@ -1615,7 +1677,8 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
} }
/* Links inside the dropdown */ /* Links inside the dropdown */
.dropdown-content a, .dropdown-content span { .dropdown-content a,
.dropdown-content span {
color: black; color: black;
padding: 12px 16px; padding: 12px 16px;
text-decoration: none; text-decoration: none;
@@ -1625,12 +1688,16 @@ button:not(.select2-selection__choice__remove):not(.ejs_menu_button):disabled {
.dropdown-content span { .dropdown-content span {
cursor: auto; cursor: auto;
} }
/* Change color of dropdown links on hover */ /* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #ddd;} .dropdown-content a:hover {
background-color: #ddd;
}
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */ /* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
.show {display:block;} .show {
display: block;
}
.dropdownroleitem { .dropdownroleitem {
text-transform: capitalize; text-transform: capitalize;