diff --git a/gaseous-server/Classes/Collections.cs b/gaseous-server/Classes/Collections.cs index bf998d5..c6d7747 100644 --- a/gaseous-server/Classes/Collections.cs +++ b/gaseous-server/Classes/Collections.cs @@ -58,7 +58,7 @@ namespace gaseous_server.Classes public static CollectionItem NewCollection(CollectionItem item) { Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString); - string sql = "INSERT INTO RomCollections (`Name`, Description, Platforms, Genres, Players, PlayerPerspectives, Themes, MinimumRating, MaximumRating, MaximumRomsPerPlatform, MaximumBytesPerPlatform, MaximumCollectionSizeInBytes, FolderStructure, IncludeBIOSFiles, BuiltStatus) VALUES (@name, @description, @platforms, @genres, @players, @playerperspectives, @themes, @minimumrating, @maximumrating, @maximumromsperplatform, @maximumbytesperplatform, @maximumcollectionsizeinbytes, @folderstructure, @includebiosfiles, @builtstatus); SELECT CAST(LAST_INSERT_ID() AS SIGNED);"; + string sql = "INSERT INTO RomCollections (`Name`, Description, Platforms, Genres, Players, PlayerPerspectives, Themes, MinimumRating, MaximumRating, MaximumRomsPerPlatform, MaximumBytesPerPlatform, MaximumCollectionSizeInBytes, FolderStructure, IncludeBIOSFiles, AlwaysInclude, BuiltStatus) VALUES (@name, @description, @platforms, @genres, @players, @playerperspectives, @themes, @minimumrating, @maximumrating, @maximumromsperplatform, @maximumbytesperplatform, @maximumcollectionsizeinbytes, @folderstructure, @includebiosfiles, @alwaysinclude, @builtstatus); SELECT CAST(LAST_INSERT_ID() AS SIGNED);"; Dictionary dbDict = new Dictionary(); dbDict.Add("name", item.Name); dbDict.Add("description", item.Description); @@ -74,6 +74,7 @@ namespace gaseous_server.Classes dbDict.Add("maximumcollectionsizeinbytes", Common.ReturnValueIfNull(item.MaximumCollectionSizeInBytes, -1)); dbDict.Add("folderstructure", Common.ReturnValueIfNull(item.FolderStructure, CollectionItem.FolderStructures.Gaseous)); dbDict.Add("includebiosfiles", Common.ReturnValueIfNull(item.IncludeBIOSFiles, 0)); + dbDict.Add("alwaysinclude", Newtonsoft.Json.JsonConvert.SerializeObject(Common.ReturnValueIfNull(item.AlwaysInclude, new List()))); dbDict.Add("builtstatus", CollectionItem.CollectionBuildStatus.WaitingForBuild); DataTable romDT = db.ExecuteCMD(sql, dbDict); long CollectionId = (long)romDT.Rows[0][0]; @@ -85,10 +86,10 @@ namespace gaseous_server.Classes return collectionItem; } - public static CollectionItem EditCollection(long Id, CollectionItem item) + public static CollectionItem EditCollection(long Id, CollectionItem item, bool ForceRebuild = true) { Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString); - string sql = "UPDATE RomCollections SET `Name`=@name, Description=@description, Platforms=@platforms, Genres=@genres, Players=@players, PlayerPerspectives=@playerperspectives, Themes=@themes, MinimumRating=@minimumrating, MaximumRating=@maximumrating, MaximumRomsPerPlatform=@maximumromsperplatform, MaximumBytesPerPlatform=@maximumbytesperplatform, MaximumCollectionSizeInBytes=@maximumcollectionsizeinbytes, FolderStructure=@folderstructure, IncludeBIOSFiles=@includebiosfiles, BuiltStatus=@builtstatus WHERE Id=@id"; + string sql = "UPDATE RomCollections SET `Name`=@name, Description=@description, Platforms=@platforms, Genres=@genres, Players=@players, PlayerPerspectives=@playerperspectives, Themes=@themes, MinimumRating=@minimumrating, MaximumRating=@maximumrating, MaximumRomsPerPlatform=@maximumromsperplatform, MaximumBytesPerPlatform=@maximumbytesperplatform, MaximumCollectionSizeInBytes=@maximumcollectionsizeinbytes, FolderStructure=@folderstructure, IncludeBIOSFiles=@includebiosfiles, AlwaysInclude=@alwaysinclude, BuiltStatus=@builtstatus WHERE Id=@id"; Dictionary dbDict = new Dictionary(); dbDict.Add("id", Id); dbDict.Add("name", item.Name); @@ -105,19 +106,37 @@ namespace gaseous_server.Classes dbDict.Add("maximumcollectionsizeinbytes", Common.ReturnValueIfNull(item.MaximumCollectionSizeInBytes, -1)); dbDict.Add("folderstructure", Common.ReturnValueIfNull(item.FolderStructure, CollectionItem.FolderStructures.Gaseous)); dbDict.Add("includebiosfiles", Common.ReturnValueIfNull(item.IncludeBIOSFiles, 0)); - dbDict.Add("builtstatus", CollectionItem.CollectionBuildStatus.WaitingForBuild); - db.ExecuteCMD(sql, dbDict); - + dbDict.Add("alwaysinclude", Newtonsoft.Json.JsonConvert.SerializeObject(Common.ReturnValueIfNull(item.AlwaysInclude, new List()))); + string CollectionZipFile = Path.Combine(Config.LibraryConfiguration.LibraryCollectionsDirectory, Id + ".zip"); - if (File.Exists(CollectionZipFile)) + if (ForceRebuild == true) { - Logging.Log(Logging.LogType.Warning, "Collections", "Deleting existing build of collection: " + item.Name); - File.Delete(CollectionZipFile); + dbDict.Add("builtstatus", CollectionItem.CollectionBuildStatus.WaitingForBuild); + if (File.Exists(CollectionZipFile)) + { + Logging.Log(Logging.LogType.Warning, "Collections", "Deleting existing build of collection: " + item.Name); + File.Delete(CollectionZipFile); + } } - + else + { + if (File.Exists(CollectionZipFile)) + { + dbDict.Add("builtstatus", CollectionItem.CollectionBuildStatus.Completed); + } + else + { + dbDict.Add("builtstatus", CollectionItem.CollectionBuildStatus.NoStatus); + } + } + db.ExecuteCMD(sql, dbDict); + CollectionItem collectionItem = GetCollection(Id); - StartCollectionItemBuild(Id); + if (collectionItem.BuildStatus == CollectionItem.CollectionBuildStatus.WaitingForBuild) + { + StartCollectionItemBuild(Id); + } return collectionItem; } @@ -166,9 +185,32 @@ namespace gaseous_server.Classes List collectionPlatformItems = new List(); // get platforms + List platformids = new List(); + platformids.AddRange(collectionItem.Platforms); + + List? DynamicPlatforms = new List(); + DynamicPlatforms.AddRange(collectionItem.Platforms); + List platforms = new List(); - if (collectionItem.Platforms.Count > 0) { - foreach (long PlatformId in collectionItem.Platforms) { + + // add platforms with an inclusion status + foreach (CollectionItem.AlwaysIncludeItem alwaysIncludeItem in collectionItem.AlwaysInclude) + { + if ( + alwaysIncludeItem.InclusionState == CollectionItem.AlwaysIncludeStatus.AlwaysInclude || + alwaysIncludeItem.InclusionState == CollectionItem.AlwaysIncludeStatus.AlwaysExclude + ) + { + if (!platformids.Contains(alwaysIncludeItem.PlatformId)) + { + platformids.Add(alwaysIncludeItem.PlatformId); + } + } + } + + // add dynamic platforms + if (DynamicPlatforms.Count > 0) { + foreach (long PlatformId in platformids) { platforms.Add(Platforms.GetPlatform(PlatformId)); } } else { @@ -184,64 +226,114 @@ namespace gaseous_server.Classes long TotalRomSize = 0; long TotalGameCount = 0; - List games = GamesController.GetGames("", - platform.Id.ToString(), - string.Join(",", collectionItem.Genres), - string.Join(",", collectionItem.Players), - string.Join(",", collectionItem.PlayerPerspectives), - string.Join(",", collectionItem.Themes), - collectionItem.MinimumRating, - collectionItem.MaximumRating - ); + bool isDynamic = false; + if (DynamicPlatforms.Contains((long)platform.Id)) + { + isDynamic = true; + } + else if (DynamicPlatforms.Count == 0) + { + isDynamic = true; + } + + List games = new List(); + if (isDynamic == true) + { + games = GamesController.GetGames("", + platform.Id.ToString(), + string.Join(",", collectionItem.Genres), + string.Join(",", collectionItem.Players), + string.Join(",", collectionItem.PlayerPerspectives), + string.Join(",", collectionItem.Themes), + collectionItem.MinimumRating, + collectionItem.MaximumRating + ); + } CollectionContents.CollectionPlatformItem collectionPlatformItem = new CollectionContents.CollectionPlatformItem(platform); collectionPlatformItem.Games = new List(); - foreach (Game game in games) { - CollectionContents.CollectionPlatformItem.CollectionGameItem collectionGameItem = new CollectionContents.CollectionPlatformItem.CollectionGameItem(game); + // add titles with an inclusion status + foreach (CollectionItem.AlwaysIncludeItem alwaysIncludeItem in collectionItem.AlwaysInclude) + { + if ( + ( + alwaysIncludeItem.InclusionState == CollectionItem.AlwaysIncludeStatus.AlwaysInclude || + alwaysIncludeItem.InclusionState == CollectionItem.AlwaysIncludeStatus.AlwaysExclude + ) && alwaysIncludeItem.PlatformId == platform.Id + ) + { + Game AlwaysIncludeGame = Games.GetGame(alwaysIncludeItem.GameId, false, false, false); + CollectionContents.CollectionPlatformItem.CollectionGameItem gameItem = new CollectionContents.CollectionPlatformItem.CollectionGameItem(AlwaysIncludeGame); + gameItem.InclusionStatus = new CollectionItem.AlwaysIncludeItem(); + gameItem.InclusionStatus.PlatformId = alwaysIncludeItem.PlatformId; + gameItem.InclusionStatus.GameId = alwaysIncludeItem.GameId; + gameItem.InclusionStatus.InclusionState = alwaysIncludeItem.InclusionState; + gameItem.Roms = Roms.GetRoms((long)gameItem.Id, (long)platform.Id); - List gameRoms = Roms.GetRoms((long)game.Id, (long)platform.Id); - - bool AddGame = false; - - // calculate total rom size for the game - long GameRomSize = 0; - foreach (Roms.GameRomItem gameRom in gameRoms) { - GameRomSize += gameRom.Size; + collectionPlatformItem.Games.Add(gameItem); } - if (collectionItem.MaximumBytesPerPlatform > 0) { - if ((TotalRomSize + GameRomSize) < collectionItem.MaximumBytesPerPlatform) { - AddGame = true; + } + + foreach (Game game in games) { + bool gameAlreadyInList = false; + foreach (CollectionContents.CollectionPlatformItem.CollectionGameItem existingGame in collectionPlatformItem.Games) + { + if (existingGame.Id == game.Id) + { + gameAlreadyInList = true; } } - else + + if (gameAlreadyInList == false) { - AddGame = true; - } + CollectionContents.CollectionPlatformItem.CollectionGameItem collectionGameItem = new CollectionContents.CollectionPlatformItem.CollectionGameItem(game); - if (AddGame == true) { - TotalRomSize += GameRomSize; + List gameRoms = Roms.GetRoms((long)game.Id, (long)platform.Id); + + bool AddGame = false; - bool AddRoms = false; - - if (collectionItem.MaximumRomsPerPlatform > 0) { - if (TotalGameCount < collectionItem.MaximumRomsPerPlatform) { - AddRoms = true; + // calculate total rom size for the game + long GameRomSize = 0; + foreach (Roms.GameRomItem gameRom in gameRoms) { + GameRomSize += gameRom.Size; + } + if (collectionItem.MaximumBytesPerPlatform > 0) { + if ((TotalRomSize + GameRomSize) < collectionItem.MaximumBytesPerPlatform) { + AddGame = true; } } - else + else { - AddRoms = true; + AddGame = true; } - if (AddRoms == true) { - TotalGameCount += 1; - collectionGameItem.Roms = gameRoms; - collectionPlatformItem.Games.Add(collectionGameItem); + if (AddGame == true) { + TotalRomSize += GameRomSize; + + bool AddRoms = false; + + if (collectionItem.MaximumRomsPerPlatform > 0) { + if (TotalGameCount < collectionItem.MaximumRomsPerPlatform) { + AddRoms = true; + } + } + else + { + AddRoms = true; + } + + if (AddRoms == true) { + TotalGameCount += 1; + collectionGameItem.Roms = gameRoms; + collectionPlatformItem.Games.Add(collectionGameItem); + } } } } + collectionPlatformItem.Games.Sort((x, y) => x.Name.CompareTo(y.Name)); + if (collectionPlatformItem.Games.Count > 0) { bool AddPlatform = false; @@ -264,6 +356,8 @@ namespace gaseous_server.Classes } } + collectionPlatformItems.Sort((x, y) => x.Name.CompareTo(y.Name)); + CollectionContents collectionContents = new CollectionContents(); collectionContents.Collection = collectionPlatformItems; @@ -361,30 +455,46 @@ namespace gaseous_server.Classes foreach (CollectionContents.CollectionPlatformItem.CollectionGameItem collectionGameItem in collectionPlatformItem.Games) { - string ZipGamePath = ""; - switch (collectionItem.FolderStructure) + bool includeGame = false; + if (collectionGameItem.InclusionStatus == null) { - case CollectionItem.FolderStructures.Gaseous: - // create game directory - ZipGamePath = Path.Combine(ZipPlatformPath, collectionGameItem.Slug); - if (!Directory.Exists(ZipGamePath)) - { - Directory.CreateDirectory(ZipGamePath); - } - break; - - case CollectionItem.FolderStructures.RetroPie: - ZipGamePath = ZipPlatformPath; - break; - } - - // copy in roms - foreach (Roms.GameRomItem gameRomItem in collectionGameItem.Roms) + includeGame = true; + } + else { - if (File.Exists(gameRomItem.Path)) + if (collectionGameItem.InclusionStatus.InclusionState == CollectionItem.AlwaysIncludeStatus.AlwaysInclude) { - Logging.Log(Logging.LogType.Information, "Collections", "Copying ROM: " + gameRomItem.Name); - File.Copy(gameRomItem.Path, Path.Combine(ZipGamePath, gameRomItem.Name)); + includeGame = true; + } + } + + if (includeGame == true) + { + string ZipGamePath = ""; + switch (collectionItem.FolderStructure) + { + case CollectionItem.FolderStructures.Gaseous: + // create game directory + ZipGamePath = Path.Combine(ZipPlatformPath, collectionGameItem.Slug); + if (!Directory.Exists(ZipGamePath)) + { + Directory.CreateDirectory(ZipGamePath); + } + break; + + case CollectionItem.FolderStructures.RetroPie: + ZipGamePath = ZipPlatformPath; + break; + } + + // copy in roms + foreach (Roms.GameRomItem gameRomItem in collectionGameItem.Roms) + { + if (File.Exists(gameRomItem.Path)) + { + Logging.Log(Logging.LogType.Information, "Collections", "Copying ROM: " + gameRomItem.Name); + File.Copy(gameRomItem.Path, Path.Combine(ZipGamePath, gameRomItem.Name)); + } } } } @@ -434,6 +544,7 @@ namespace gaseous_server.Classes string strPlayers = (string)Common.ReturnValueIfNull(row["Players"], "[ ]"); string strPlayerPerspectives = (string)Common.ReturnValueIfNull(row["PlayerPerspectives"], "[ ]"); string strThemes = (string)Common.ReturnValueIfNull(row["Themes"], "[ ]"); + string strAlwaysInclude = (string)Common.ReturnValueIfNull(row["AlwaysInclude"], "[ ]"); CollectionItem item = new CollectionItem(); item.Id = (long)row["Id"]; @@ -451,6 +562,7 @@ namespace gaseous_server.Classes item.MaximumCollectionSizeInBytes = (long)Common.ReturnValueIfNull(row["MaximumCollectionSizeInBytes"], (long)-1); item.FolderStructure = (CollectionItem.FolderStructures)(int)Common.ReturnValueIfNull(row["FolderStructure"], 0); item.IncludeBIOSFiles = (bool)row["IncludeBIOSFiles"]; + item.AlwaysInclude = Newtonsoft.Json.JsonConvert.DeserializeObject>(strAlwaysInclude); item.BuildStatus = (CollectionItem.CollectionBuildStatus)(int)Common.ReturnValueIfNull(row["BuiltStatus"], 0); return item; @@ -478,6 +590,7 @@ namespace gaseous_server.Classes public long? MaximumCollectionSizeInBytes { get; set; } public FolderStructures FolderStructure { get; set; } = FolderStructures.Gaseous; public bool IncludeBIOSFiles { get; set; } = true; + public List AlwaysInclude { get; set; } [JsonIgnore] public CollectionBuildStatus BuildStatus @@ -546,6 +659,20 @@ namespace gaseous_server.Classes Gaseous = 0, RetroPie = 1 } + + public class AlwaysIncludeItem + { + public long PlatformId { get; set; } + public long GameId { get; set; } + public AlwaysIncludeStatus InclusionState { get; set; } + } + + public enum AlwaysIncludeStatus + { + None = 0, + AlwaysInclude = 1, + AlwaysExclude = 2 + } } public class CollectionContents { @@ -661,6 +788,8 @@ namespace gaseous_server.Classes public string Slug { get; set; } public long Cover { get; set;} + public CollectionItem.AlwaysIncludeItem InclusionStatus { get; set; } + public List Roms { get; set; } public long RomSize { diff --git a/gaseous-server/Controllers/CollectionsController.cs b/gaseous-server/Controllers/CollectionsController.cs index a8917da..ed8a24d 100644 --- a/gaseous-server/Controllers/CollectionsController.cs +++ b/gaseous-server/Controllers/CollectionsController.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO.Compression; using System.Linq; using System.Threading.Tasks; +using gaseous_server.Classes; using Microsoft.AspNetCore.Mvc; namespace gaseous_server.Controllers @@ -82,14 +83,14 @@ namespace gaseous_server.Controllers [ProducesResponseType(StatusCodes.Status404NotFound)] public ActionResult GetCollectionRomsPreview(Classes.Collections.CollectionItem Item) { - //try - //{ + try + { return Ok(Classes.Collections.GetCollectionContent(Item)); - //} - //catch (Exception ex) - //{ - // return NotFound(ex); - //} + } + catch (Exception ex) + { + return NotFound(ex); + } } /// @@ -159,7 +160,43 @@ namespace gaseous_server.Controllers { try { - return Ok(Classes.Collections.EditCollection(CollectionId, Item)); + return Ok(Classes.Collections.EditCollection(CollectionId, Item, true)); + } + catch + { + return NotFound(); + } + } + + /// + /// Edits an existing collection + /// + /// + /// + /// + [HttpPatch] + [Route("{CollectionId}/AlwaysInclude")] + [ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status404NotFound)] + public ActionResult EditCollectionAlwaysInclude(long CollectionId, [FromQuery]bool Rebuild, [FromBody]Collections.CollectionItem.AlwaysIncludeItem Inclusion) + { + try + { + Collections.CollectionItem collectionItem = Classes.Collections.GetCollection(CollectionId); + bool ItemFound = false; + foreach (Collections.CollectionItem.AlwaysIncludeItem includeItem in collectionItem.AlwaysInclude) + { + if (includeItem.PlatformId == Inclusion.PlatformId && includeItem.GameId == Inclusion.GameId) + { + ItemFound = true; + } + } + if (ItemFound == false) + { + collectionItem.AlwaysInclude.Add(Inclusion); + } + + return Ok(Classes.Collections.EditCollection(CollectionId, collectionItem, Rebuild)); } catch { diff --git a/gaseous-server/wwwroot/pages/dialogs/collectionaddgame.html b/gaseous-server/wwwroot/pages/dialogs/collectionaddgame.html new file mode 100644 index 0000000..6c28ffe --- /dev/null +++ b/gaseous-server/wwwroot/pages/dialogs/collectionaddgame.html @@ -0,0 +1,74 @@ +

+ Select collection to add game to: +

+ + + + + + + + + +
+ +
+ + + + +
+ + \ No newline at end of file diff --git a/gaseous-server/wwwroot/pages/dialogs/collectionedit.html b/gaseous-server/wwwroot/pages/dialogs/collectionedit.html index ed9a8b1..1185d03 100644 --- a/gaseous-server/wwwroot/pages/dialogs/collectionedit.html +++ b/gaseous-server/wwwroot/pages/dialogs/collectionedit.html @@ -254,6 +254,8 @@ $('#collection_includebios').select2(); if (modalVariables) { + var modalAlwaysInclude = []; + // edit mode ajaxCall( '/api/v1/Collections/' + modalVariables, @@ -270,6 +272,8 @@ $('#collection_directorylayout').val(result.folderStructure).trigger('change'); } $('#collection_includebios').val(result.includeBIOSFiles.toString()).trigger('change'); + modalAlwaysInclude = result.alwaysInclude; + console.log(JSON.stringify(modalAlwaysInclude)); // fill select2 controls $.ajax( @@ -372,6 +376,25 @@ var players = GetDropDownIds('#collection_players'); var playerperspectives = GetDropDownIds('#collection_playerperspectives'); var themes = GetDropDownIds('#collection_themes'); + var alwaysInclude = []; + var alwaysIncludeSelections = document.getElementsByName('collections_preview_always'); + if (alwaysIncludeSelections.length > 0) { + for (var i = 0; i < alwaysIncludeSelections.length; i++) { + if (alwaysIncludeSelections[i].value != "None") { + var alwaysIncludeItem = { + "platformId": Number(alwaysIncludeSelections[i].getAttribute('data-platform')), + "gameId": Number(alwaysIncludeSelections[i].getAttribute('data-game')), + "inclusionState": alwaysIncludeSelections[i].value + }; + alwaysInclude.push(alwaysIncludeItem); + } + } + } else { + alwaysInclude = modalAlwaysInclude; + } + + modalAlwaysInclude = alwaysInclude; + console.log(JSON.stringify(modalAlwaysInclude)); var item = { "name": document.getElementById('collection_name').value, @@ -387,7 +410,8 @@ "maximumBytesPerPlatform": GetNumberFieldValue('collection_maxplatformsize'), "maximumCollectionSizeInBytes": GetNumberFieldValue('collection_maxcollectionsize'), "folderStructure": GetNumberFieldValue('collection_directorylayout', "Standard"), - "includeBIOSFiles": GetBooleanFieldValue('collection_includebios') + "includeBIOSFiles": GetBooleanFieldValue('collection_includebios'), + "alwaysInclude": alwaysInclude } return item; @@ -451,6 +475,7 @@ } function DisplayPreview(data, targetDiv) { + console.log(JSON.stringify(data)); var container = document.getElementById(targetDiv); container.innerHTML = ''; @@ -494,7 +519,48 @@ var gameTitleCell = document.createElement('th'); gameTitleCell.setAttribute('colspan', 2); gameTitleCell.className = 'collections_preview_gametitlecell'; - gameTitleCell.innerHTML = gameItem.name; + + // game always include popup + var gameTitleInclusion = document.createElement('select'); + gameTitleInclusion.id = 'collections_preview_always_' + platformItem.id + '_' + gameItem.id; + gameTitleInclusion.name = 'collections_preview_always'; + gameTitleInclusion.setAttribute('data-platform', platformItem.id); + gameTitleInclusion.setAttribute('data-game', gameItem.id); + gameTitleInclusion.style.float = 'right'; + + var gameTitleInclusionOptions = [ + { + "value": "None", + "text": "Automatic" + }, + { + "value": "AlwaysInclude", + "text": "Always Include" + }, + { + "value": "AlwaysExclude", + "text": "Always Exclude" + } + ]; + for (var i = 0; i < gameTitleInclusionOptions.length; i++) { + var gameTitleInclusionOption = document.createElement('option'); + gameTitleInclusionOption.value = gameTitleInclusionOptions[i].value; + gameTitleInclusionOption.innerHTML = gameTitleInclusionOptions[i].text; + + if (gameItem.inclusionStatus) { + if (gameItem.inclusionStatus.inclusionState == gameTitleInclusionOptions[i].value) { + gameTitleInclusionOption.selected = 'selected'; + } + } + + gameTitleInclusion.appendChild(gameTitleInclusionOption); + } + gameTitleCell.appendChild(gameTitleInclusion); + + // game title label + var gameTitleLabel = document.createElement('span'); + gameTitleLabel.innerHTML = gameItem.name; + gameTitleCell.appendChild(gameTitleLabel); gameItemRow.appendChild(gameTitleCell); @@ -541,7 +607,7 @@ container.appendChild(collectionTable); var collectionSize = document.getElementById('collectionedit_previewbox_size'); - collectionSize.innerHTML = "Collection size: " + formatBytes(data.collectionProjectedSizeBytes); + collectionSize.innerHTML = "Estimated uncompressed collection size: " + formatBytes(data.collectionProjectedSizeBytes); } } diff --git a/gaseous-server/wwwroot/pages/game.html b/gaseous-server/wwwroot/pages/game.html index 2d8b2e6..9a684b6 100644 --- a/gaseous-server/wwwroot/pages/game.html +++ b/gaseous-server/wwwroot/pages/game.html @@ -368,7 +368,7 @@ var platformRow = document.createElement('tr'); var platformHeader = document.createElement('th'); platformHeader.setAttribute('colspan', 6); - platformHeader.innerHTML = result[i].platform.name; + platformHeader.innerHTML = '' + result[i].platform.name; platformRow.appendChild(platformHeader); newTable.appendChild(platformRow); } @@ -666,4 +666,9 @@ submodal.style.display = "none"; } + + function ShowCollectionDialog(platformId) { + modalVariables = platformId; + showSubDialog("collectionaddgame"); + } \ No newline at end of file diff --git a/gaseous-server/wwwroot/styles/style.css b/gaseous-server/wwwroot/styles/style.css index ce90598..465f38c 100644 --- a/gaseous-server/wwwroot/styles/style.css +++ b/gaseous-server/wwwroot/styles/style.css @@ -143,6 +143,12 @@ h3 { filter: invert(100%); } +.banner_button_image_smaller { + height: 16px; + width: 16px; + margin: unset; +} + #banner_header { background-color: rgba(0, 22, 56, 0.8); backdrop-filter: blur(8px); diff --git a/gaseous-tools/Database/MySQL/gaseous-1002.sql b/gaseous-tools/Database/MySQL/gaseous-1002.sql index 225d738..c9cfcb6 100644 --- a/gaseous-tools/Database/MySQL/gaseous-1002.sql +++ b/gaseous-tools/Database/MySQL/gaseous-1002.sql @@ -12,4 +12,5 @@ ADD COLUMN `MetadataVersion` INT NULL DEFAULT 1; ALTER TABLE `RomCollections` ADD COLUMN `FolderStructure` INT NULL DEFAULT 0 AFTER `MaximumCollectionSizeInBytes`, -ADD COLUMN `IncludeBIOSFiles` BOOLEAN NULL DEFAULT 0 AFTER `FolderStructure`; +ADD COLUMN `IncludeBIOSFiles` BOOLEAN NULL DEFAULT 0 AFTER `FolderStructure`, +ADD COLUMN `AlwaysInclude` JSON NULL AFTER `IncludeBIOSFiles`;