WIP
This commit is contained in:
@@ -112,7 +112,7 @@ namespace gaseous_server.Classes
|
|||||||
{
|
{
|
||||||
//string sql = "SELECT DISTINCT <ITEMNAME>.Id, <ITEMNAME>.`Name`, COUNT(view_Games.Id) AS GameCount FROM <ITEMNAME> LEFT JOIN Relation_Game_<ITEMNAME>s ON Relation_Game_<ITEMNAME>s.<ITEMNAME>sId = <ITEMNAME>.Id LEFT JOIN view_Games ON view_Games.Id = Relation_Game_<ITEMNAME>s.GameId WHERE (" + AgeRestriction_Generic + ") GROUP BY <ITEMNAME>.Id HAVING GameCount > 0 ORDER BY <ITEMNAME>.`Name`;";
|
//string sql = "SELECT DISTINCT <ITEMNAME>.Id, <ITEMNAME>.`Name`, COUNT(view_Games.Id) AS GameCount FROM <ITEMNAME> LEFT JOIN Relation_Game_<ITEMNAME>s ON Relation_Game_<ITEMNAME>s.<ITEMNAME>sId = <ITEMNAME>.Id LEFT JOIN view_Games ON view_Games.Id = Relation_Game_<ITEMNAME>s.GameId WHERE (" + AgeRestriction_Generic + ") GROUP BY <ITEMNAME>.Id HAVING GameCount > 0 ORDER BY <ITEMNAME>.`Name`;";
|
||||||
|
|
||||||
string sql = "SELECT <ITEMNAME>.Id, <ITEMNAME>.`Name`, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT Game.Id, AgeGroup.AgeGroupId, 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 + ") GROUP BY Game.Id HAVING RomCount > 0) Game JOIN Relation_Game_<ITEMNAME>s ON Game.Id = Relation_Game_<ITEMNAME>s.GameId JOIN <ITEMNAME> ON Relation_Game_<ITEMNAME>s.<ITEMNAME>sId = <ITEMNAME>.Id GROUP BY <ITEMNAME>.`Name` ORDER BY <ITEMNAME>.`Name`;";
|
string sql = "SELECT <ITEMNAME>.Id, <ITEMNAME>.`Name`, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT view_Games_Roms.GameIdType, Game.Id, AgeGroup.AgeGroupId, 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 + ") GROUP BY Game.Id HAVING RomCount > 0) Game JOIN Relation_Game_<ITEMNAME>s ON Game.Id = Relation_Game_<ITEMNAME>s.GameId AND Game.GameIdType = Relation_Game_<ITEMNAME>s.GameSourceId JOIN <ITEMNAME> ON Relation_Game_<ITEMNAME>s.<ITEMNAME>sId = <ITEMNAME>.Id GROUP BY <ITEMNAME>.`Name` ORDER BY <ITEMNAME>.`Name`;";
|
||||||
sql = sql.Replace("<ITEMNAME>", Name);
|
sql = sql.Replace("<ITEMNAME>", Name);
|
||||||
DataTable dbResponse = db.ExecuteCMD(sql, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 300));
|
DataTable dbResponse = db.ExecuteCMD(sql, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 300));
|
||||||
|
|
||||||
|
@@ -138,7 +138,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
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 AND Game.SourceId = Relation_Game_Platforms.GameSourceId WHERE " + whereClause + ";";
|
||||||
|
|
||||||
|
|
||||||
// get Game metadata
|
// get Game metadata
|
||||||
|
@@ -93,7 +93,9 @@ namespace gaseous_server.Classes
|
|||||||
JOIN
|
JOIN
|
||||||
GameLibraries ON Games_Roms.LibraryId = GameLibraries.Id
|
GameLibraries ON Games_Roms.LibraryId = GameLibraries.Id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
Platform ON Games_Roms.PlatformId = Platform.Id LEFT JOIN view_GamesWithRoms ON view_GamesWithRoms.MetadataMapId = Games_Roms.MetadataMapId
|
Platform ON Games_Roms.PlatformId = Platform.Id AND Platform.SourceId = @platformsource
|
||||||
|
LEFT JOIN
|
||||||
|
view_GamesWithRoms ON view_GamesWithRoms.MetadataMapId = Games_Roms.MetadataMapId
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
GameState ON (Games_Roms.Id = GameState.RomId AND GameState.UserId = @userid AND GameState.IsMediaGroup = 0) " + UserJoin + @"
|
GameState ON (Games_Roms.Id = GameState.RomId AND GameState.UserId = @userid AND GameState.IsMediaGroup = 0) " + UserJoin + @"
|
||||||
WHERE
|
WHERE
|
||||||
@@ -106,6 +108,7 @@ namespace gaseous_server.Classes
|
|||||||
sqlCount = "SELECT COUNT(Games_Roms.Id) AS RomCount FROM Games_Roms WHERE Games_Roms.MetadataMapId = @id AND Games_Roms.PlatformId = @platformid" + NameSearchWhere + ";";
|
sqlCount = "SELECT COUNT(Games_Roms.Id) AS RomCount FROM Games_Roms WHERE Games_Roms.MetadataMapId = @id AND Games_Roms.PlatformId = @platformid" + NameSearchWhere + ";";
|
||||||
|
|
||||||
dbDict.Add("platformid", PlatformId);
|
dbDict.Add("platformid", PlatformId);
|
||||||
|
dbDict.Add("platformsource", (int)HasheousClient.Models.MetadataSources.None);
|
||||||
}
|
}
|
||||||
DataTable romDT = db.ExecuteCMD(sql, dbDict, new Database.DatabaseMemoryCacheOptions(true, (int)TimeSpan.FromMinutes(1).Ticks));
|
DataTable romDT = db.ExecuteCMD(sql, dbDict, new Database.DatabaseMemoryCacheOptions(true, (int)TimeSpan.FromMinutes(1).Ticks));
|
||||||
|
|
||||||
|
@@ -113,7 +113,7 @@ namespace gaseous_server.Controllers.v1_1
|
|||||||
}
|
}
|
||||||
|
|
||||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT view_Games.Id, view_Games.AgeGroupId, Relation_Game_SimilarGames.SimilarGamesId FROM view_Games JOIN Relation_Game_SimilarGames ON view_Games.Id = Relation_Game_SimilarGames.GameId AND Relation_Game_SimilarGames.SimilarGamesId IN (SELECT Id FROM view_Games) WHERE view_Games.Id = @id AND (view_Games.AgeGroupId <= @agegroupid" + IncludeUnrated + ")";
|
string sql = "SELECT view_Games.Id, view_Games.AgeGroupId, Relation_Game_SimilarGames.SimilarGamesId FROM view_Games JOIN Relation_Game_SimilarGames ON view_Games.Id = Relation_Game_SimilarGames.GameId AND view_Games.GameIdType = Relation_Game_SimilarGames.GameSourceId AND Relation_Game_SimilarGames.SimilarGamesId IN (SELECT Id FROM view_Games) WHERE view_Games.Id = @id AND (view_Games.AgeGroupId <= @agegroupid" + IncludeUnrated + ")";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", MetadataMapId);
|
dbDict.Add("id", MetadataMapId);
|
||||||
dbDict.Add("agegroupid", (int)user.SecurityProfile.AgeRestrictionPolicy.MaximumAgeRestriction);
|
dbDict.Add("agegroupid", (int)user.SecurityProfile.AgeRestrictionPolicy.MaximumAgeRestriction);
|
||||||
@@ -542,13 +542,13 @@ FROM
|
|||||||
AND GameState.UserId = @userid
|
AND GameState.UserId = @userid
|
||||||
GROUP BY RomMediaGroup.GameId) RomGroupSavedStates ON Game.MetadataMapId = RomGroupSavedStates.GameId
|
GROUP BY RomMediaGroup.GameId) RomGroupSavedStates ON Game.MetadataMapId = RomGroupSavedStates.GameId
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
Relation_Game_Genres ON Game.Id = Relation_Game_Genres.GameId
|
Relation_Game_Genres ON Game.Id = Relation_Game_Genres.GameId AND Relation_Game_Genres.GameSourceId = Game.GameIdType
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
Relation_Game_GameModes ON Game.Id = Relation_Game_GameModes.GameId
|
Relation_Game_GameModes ON Game.Id = Relation_Game_GameModes.GameId AND Relation_Game_GameModes.GameSourceId = Game.GameIdType
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
Relation_Game_PlayerPerspectives ON Game.Id = Relation_Game_PlayerPerspectives.GameId
|
Relation_Game_PlayerPerspectives ON Game.Id = Relation_Game_PlayerPerspectives.GameId AND Relation_Game_PlayerPerspectives.GameSourceId = Game.GameIdType
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
Relation_Game_Themes ON Game.Id = Relation_Game_Themes.GameId
|
Relation_Game_Themes ON Game.Id = Relation_Game_Themes.GameId AND Relation_Game_Themes.GameSourceId = Game.GameIdType
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
Favourites ON Game.MetadataMapId = Favourites.GameId AND Favourites.UserId = @userid " + whereClause + " " + havingClause + " " + orderByClause;
|
Favourites ON Game.MetadataMapId = Favourites.GameId AND Favourites.UserId = @userid " + whereClause + " " + havingClause + " " + orderByClause;
|
||||||
|
|
||||||
|
@@ -414,3 +414,67 @@ FROM (
|
|||||||
AND `Game`.`Id` = `view_MetadataMap`.`MetadataSourceId`
|
AND `Game`.`Id` = `view_MetadataMap`.`MetadataSourceId`
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE OR REPLACE VIEW `view_Games` AS
|
||||||
|
SELECT
|
||||||
|
`a`.`ROMGameId` AS `ROMGameId`,
|
||||||
|
`a`.`Id` AS `Id`,
|
||||||
|
`a`.`GameIdType` AS `GameIdType`,
|
||||||
|
`a`.`AgeRatings` AS `AgeRatings`,
|
||||||
|
`a`.`AggregatedRating` AS `AggregatedRating`,
|
||||||
|
`a`.`AggregatedRatingCount` AS `AggregatedRatingCount`,
|
||||||
|
`a`.`AlternativeNames` AS `AlternativeNames`,
|
||||||
|
`a`.`Artworks` AS `Artworks`,
|
||||||
|
`a`.`Bundles` AS `Bundles`,
|
||||||
|
`a`.`Category` AS `Category`,
|
||||||
|
`a`.`Checksum` AS `Checksum`,
|
||||||
|
`a`.`Collection` AS `Collection`,
|
||||||
|
`a`.`Cover` AS `Cover`,
|
||||||
|
`a`.`CreatedAt` AS `CreatedAt`,
|
||||||
|
`a`.`Dlcs` AS `Dlcs`,
|
||||||
|
`a`.`Expansions` AS `Expansions`,
|
||||||
|
`a`.`ExternalGames` AS `ExternalGames`,
|
||||||
|
`a`.`FirstReleaseDate` AS `FirstReleaseDate`,
|
||||||
|
`a`.`Follows` AS `Follows`,
|
||||||
|
`a`.`Franchise` AS `Franchise`,
|
||||||
|
`a`.`Franchises` AS `Franchises`,
|
||||||
|
`a`.`GameEngines` AS `GameEngines`,
|
||||||
|
`a`.`GameModes` AS `GameModes`,
|
||||||
|
`a`.`Genres` AS `Genres`,
|
||||||
|
`a`.`Hypes` AS `Hypes`,
|
||||||
|
`a`.`InvolvedCompanies` AS `InvolvedCompanies`,
|
||||||
|
`a`.`Keywords` AS `Keywords`,
|
||||||
|
`a`.`MultiplayerModes` AS `MultiplayerModes`,
|
||||||
|
`a`.`Name` AS `Name`,
|
||||||
|
`a`.`ParentGame` AS `ParentGame`,
|
||||||
|
`a`.`Platforms` AS `Platforms`,
|
||||||
|
`a`.`PlayerPerspectives` AS `PlayerPerspectives`,
|
||||||
|
`a`.`Rating` AS `Rating`,
|
||||||
|
`a`.`RatingCount` AS `RatingCount`,
|
||||||
|
`a`.`ReleaseDates` AS `ReleaseDates`,
|
||||||
|
`a`.`Screenshots` AS `Screenshots`,
|
||||||
|
`a`.`SimilarGames` AS `SimilarGames`,
|
||||||
|
`a`.`Slug` AS `Slug`,
|
||||||
|
`a`.`StandaloneExpansions` AS `StandaloneExpansions`,
|
||||||
|
`a`.`Status` AS `Status`,
|
||||||
|
`a`.`StoryLine` AS `StoryLine`,
|
||||||
|
`a`.`Summary` AS `Summary`,
|
||||||
|
`a`.`Tags` AS `Tags`,
|
||||||
|
`a`.`Themes` AS `Themes`,
|
||||||
|
`a`.`TotalRating` AS `TotalRating`,
|
||||||
|
`a`.`TotalRatingCount` AS `TotalRatingCount`,
|
||||||
|
`a`.`UpdatedAt` AS `UpdatedAt`,
|
||||||
|
`a`.`Url` AS `Url`,
|
||||||
|
`a`.`VersionParent` AS `VersionParent`,
|
||||||
|
`a`.`VersionTitle` AS `VersionTitle`,
|
||||||
|
`a`.`Videos` AS `Videos`,
|
||||||
|
`a`.`Websites` AS `Websites`,
|
||||||
|
`a`.`dateAdded` AS `dateAdded`,
|
||||||
|
`a`.`lastUpdated` AS `lastUpdated`,
|
||||||
|
`a`.`NameThe` AS `NameThe`,
|
||||||
|
`b`.`AgeGroupId` AS `AgeGroupId`
|
||||||
|
FROM (
|
||||||
|
`view_GamesWithRoms` `a`
|
||||||
|
LEFT JOIN `AgeGroup` `b` ON (`b`.`GameId` = `a`.`Id`)
|
||||||
|
)
|
||||||
|
ORDER BY `a`.`NameThe`;
|
@@ -2929,7 +2929,7 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
|||||||
.platform_item {
|
.platform_item {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-basis: 45%;
|
/* flex-basis: 45%; */
|
||||||
border-radius: var(--standard-radius);
|
border-radius: var(--standard-radius);
|
||||||
/* background-color: var(--section-header-background); */
|
/* background-color: var(--section-header-background); */
|
||||||
background: linear-gradient(90deg, rgba(200, 200, 200, 0.7469362745098039) 0%, rgba(133, 133, 133, 1) 50%);
|
background: linear-gradient(90deg, rgba(200, 200, 200, 0.7469362745098039) 0%, rgba(133, 133, 133, 1) 50%);
|
||||||
@@ -2991,6 +2991,7 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
|||||||
.platform_name {
|
.platform_name {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 75px;
|
max-width: 75px;
|
||||||
|
height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.platform_edit_button_container {
|
.platform_edit_button_container {
|
||||||
|
Reference in New Issue
Block a user