Miscellaneous bug fixes (#220)

This commit is contained in:
Michael Green
2023-12-09 15:50:39 +11:00
committed by GitHub
parent 84017639eb
commit 7b241ee13e
4 changed files with 59 additions and 23 deletions

View File

@@ -399,6 +399,8 @@ namespace Authentication
}
public int SetPreferences(TUser user, List<UserPreferenceViewModel> model)
{
if (model != null)
{
List<UserPreferenceViewModel> userPreferences = GetPreferences(user);
@@ -430,5 +432,10 @@ namespace Authentication
return model.Count;
}
else
{
return 0;
}
}
}
}

View File

@@ -45,6 +45,11 @@ namespace gaseous_server
DataRow row = data.Rows[0];
LibraryItem library = new LibraryItem((int)row["Id"], (string)row["Name"], (string)row["Path"], (long)row["DefaultPlatform"], Convert.ToBoolean((int)row["DefaultLibrary"]));
if (!Directory.Exists(library.Path))
{
Directory.CreateDirectory(library.Path);
}
return library;
}
}
@@ -61,6 +66,15 @@ namespace gaseous_server
{
LibraryItem library = new LibraryItem((int)row["Id"], (string)row["Name"], (string)row["Path"], (long)row["DefaultPlatform"], Convert.ToBoolean((int)row["DefaultLibrary"]));
libraryItems.Add(library);
if (library.IsDefaultLibrary == true)
{
// check directory exists
if (!Directory.Exists(library.Path))
{
Directory.CreateDirectory(library.Path);
}
}
}
return libraryItems;
@@ -143,6 +157,11 @@ namespace gaseous_server
_Path = Path;
_DefaultPlatformId = DefaultPlatformId;
_IsDefaultLibrary = IsDefaultLibrary;
if (!Directory.Exists(Path))
{
Directory.CreateDirectory(Path);
}
}
int _Id = 0;

View File

@@ -402,6 +402,9 @@ gaseous_server.Classes.Metadata.Platforms.GetPlatform(0);
// extract platform map if not present
PlatformMapping.ExtractPlatformMap();
// force load platform map into cache
var platformMap = PlatformMapping.PlatformMap;
// add background tasks
ProcessQueue.QueueItems.Add(new ProcessQueue.QueueItem(
ProcessQueue.QueueItemType.SignatureIngestor,

View File

@@ -66,4 +66,11 @@ CREATE TABLE `User_Settings` (
PRIMARY KEY (`Id`, `Setting`));
ALTER TABLE `ServerLogs`
ADD FULLTEXT INDEX `ft_message` USING BTREE (`Message`) VISIBLE;
ADD FULLTEXT INDEX `ft_message` (`Message`) VISIBLE;
CREATE TABLE `Relation_Game_Platforms` (
`GameId` BIGINT NOT NULL,
`PlatformsId` BIGINT NOT NULL,
PRIMARY KEY (`GameId`, `PlatformsId`),
INDEX `idx_PrimaryColumn` (`GameId` ASC) VISIBLE
);