Code clean up and API versioning (#178)
* Merged tools project into main project * Applied API versioning
This commit is contained in:
@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 16
|
# Visual Studio Version 16
|
||||||
VisualStudioVersion = 25.0.1704.4
|
VisualStudioVersion = 25.0.1704.4
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaseous-tools", "gaseous-tools\gaseous-tools.csproj", "{08FE408A-5EC1-4110-ABD8-D19A1155B8CE}"
|
|
||||||
EndProject
|
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaseous-server", "gaseous-server\gaseous-server.csproj", "{A01D2EFF-C82E-473B-84D7-7C25E736F5D2}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaseous-server", "gaseous-server\gaseous-server.csproj", "{A01D2EFF-C82E-473B-84D7-7C25E736F5D2}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{17FA6F12-8532-420C-9489-CB8FDE42137C}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{17FA6F12-8532-420C-9489-CB8FDE42137C}"
|
||||||
@@ -37,10 +35,6 @@ Global
|
|||||||
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
{FFCEC386-033F-4772-A45B-D33579F2E5EE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{08FE408A-5EC1-4110-ABD8-D19A1155B8CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{08FE408A-5EC1-4110-ABD8-D19A1155B8CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{08FE408A-5EC1-4110-ABD8-D19A1155B8CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{08FE408A-5EC1-4110-ABD8-D19A1155B8CE}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{A01D2EFF-C82E-473B-84D7-7C25E736F5D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{A01D2EFF-C82E-473B-84D7-7C25E736F5D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{A01D2EFF-C82E-473B-84D7-7C25E736F5D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A01D2EFF-C82E-473B-84D7-7C25E736F5D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A01D2EFF-C82E-473B-84D7-7C25E736F5D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A01D2EFF-C82E-473B-84D7-7C25E736F5D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using gaseous_tools;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes
|
namespace gaseous_server.Classes
|
||||||
{
|
{
|
||||||
|
@@ -7,7 +7,6 @@ using System.Security.Cryptography;
|
|||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
using gaseous_server.Controllers;
|
using gaseous_server.Controllers;
|
||||||
using gaseous_server.Models;
|
using gaseous_server.Models;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
@@ -21,7 +20,7 @@ namespace gaseous_server.Classes
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static List<CollectionItem> GetCollections() {
|
public static List<CollectionItem> GetCollections() {
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM RomCollections ORDER BY `Name`";
|
string sql = "SELECT * FROM RomCollections ORDER BY `Name`";
|
||||||
|
|
||||||
DataTable data = db.ExecuteCMD(sql);
|
DataTable data = db.ExecuteCMD(sql);
|
||||||
@@ -36,7 +35,7 @@ namespace gaseous_server.Classes
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static CollectionItem GetCollection(long Id) {
|
public static CollectionItem GetCollection(long Id) {
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM RomCollections WHERE Id = @id ORDER BY `Name`";
|
string sql = "SELECT * FROM RomCollections WHERE Id = @id ORDER BY `Name`";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", Id);
|
dbDict.Add("id", Id);
|
||||||
@@ -57,7 +56,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static CollectionItem NewCollection(CollectionItem item)
|
public static CollectionItem NewCollection(CollectionItem item)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new 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, 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);";
|
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<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("name", item.Name);
|
dbDict.Add("name", item.Name);
|
||||||
@@ -88,7 +87,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static CollectionItem EditCollection(long Id, CollectionItem item, bool ForceRebuild = true)
|
public static CollectionItem EditCollection(long Id, CollectionItem item, bool ForceRebuild = true)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new 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, AlwaysInclude=@alwaysinclude, 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<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", Id);
|
dbDict.Add("id", Id);
|
||||||
@@ -143,7 +142,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static void DeleteCollection(long Id)
|
public static void DeleteCollection(long Id)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "DELETE FROM RomCollections WHERE Id=@id";
|
string sql = "DELETE FROM RomCollections WHERE Id=@id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", Id);
|
dbDict.Add("id", Id);
|
||||||
@@ -163,7 +162,7 @@ namespace gaseous_server.Classes
|
|||||||
if (collectionItem.BuildStatus != CollectionItem.CollectionBuildStatus.Building)
|
if (collectionItem.BuildStatus != CollectionItem.CollectionBuildStatus.Building)
|
||||||
{
|
{
|
||||||
// set collection item to waitingforbuild
|
// set collection item to waitingforbuild
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "UPDATE RomCollections SET BuiltStatus=@bs WHERE Id=@id";
|
string sql = "UPDATE RomCollections SET BuiltStatus=@bs WHERE Id=@id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", Id);
|
dbDict.Add("id", Id);
|
||||||
@@ -363,7 +362,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static void CompileCollections(long CollectionId)
|
public static void CompileCollections(long CollectionId)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
CollectionItem collectionItem = GetCollection(CollectionId);
|
CollectionItem collectionItem = GetCollection(CollectionId);
|
||||||
if (collectionItem.BuildStatus == CollectionItem.CollectionBuildStatus.WaitingForBuild)
|
if (collectionItem.BuildStatus == CollectionItem.CollectionBuildStatus.WaitingForBuild)
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
namespace gaseous_tools
|
namespace gaseous_server.Classes
|
||||||
{
|
{
|
||||||
public class Common
|
public class Common
|
||||||
{
|
{
|
@@ -3,7 +3,7 @@ using System.Data;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
|
|
||||||
namespace gaseous_tools
|
namespace gaseous_server.Classes
|
||||||
{
|
{
|
||||||
public static class Config
|
public static class Config
|
||||||
{
|
{
|
@@ -4,9 +4,8 @@ using System.Data.SqlClient;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using MySqlConnector;
|
using MySqlConnector;
|
||||||
using static gaseous_tools.Database;
|
|
||||||
|
|
||||||
namespace gaseous_tools
|
namespace gaseous_server.Classes
|
||||||
{
|
{
|
||||||
public class Database
|
public class Database
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_tools
|
|||||||
|
|
||||||
for (int i = 1000; i < 10000; i++)
|
for (int i = 1000; i < 10000; i++)
|
||||||
{
|
{
|
||||||
string resourceName = "gaseous_tools.Database.MySQL.gaseous-" + i + ".sql";
|
string resourceName = "gaseous_server.Support.Database.MySQL.gaseous-" + i + ".sql";
|
||||||
string dbScript = "";
|
string dbScript = "";
|
||||||
|
|
||||||
string[] resources = Assembly.GetExecutingAssembly().GetManifestResourceNames();
|
string[] resources = Assembly.GetExecutingAssembly().GetManifestResourceNames();
|
||||||
@@ -109,7 +108,7 @@ namespace gaseous_tools
|
|||||||
if (SchemaVer < i)
|
if (SchemaVer < i)
|
||||||
{
|
{
|
||||||
// run pre-upgrade code
|
// run pre-upgrade code
|
||||||
gaseous_tools.DatabaseMigration.PreUpgradeScript(i, _ConnectorType);
|
DatabaseMigration.PreUpgradeScript(i, _ConnectorType);
|
||||||
|
|
||||||
// apply schema!
|
// apply schema!
|
||||||
Logging.Log(Logging.LogType.Information, "Database", "Updating schema to version " + i);
|
Logging.Log(Logging.LogType.Information, "Database", "Updating schema to version " + i);
|
||||||
@@ -121,7 +120,7 @@ namespace gaseous_tools
|
|||||||
ExecuteCMD(sql, dbDict);
|
ExecuteCMD(sql, dbDict);
|
||||||
|
|
||||||
// run post-upgrade code
|
// run post-upgrade code
|
||||||
gaseous_tools.DatabaseMigration.PostUpgradeScript(i, _ConnectorType);
|
DatabaseMigration.PostUpgradeScript(i, _ConnectorType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,20 +1,20 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
||||||
namespace gaseous_tools
|
namespace gaseous_server.Classes
|
||||||
{
|
{
|
||||||
public static class DatabaseMigration
|
public static class DatabaseMigration
|
||||||
{
|
{
|
||||||
public static List<int> BackgroundUpgradeTargetSchemaVersions = new List<int>();
|
public static List<int> BackgroundUpgradeTargetSchemaVersions = new List<int>();
|
||||||
|
|
||||||
public static void PreUpgradeScript(int TargetSchemaVersion, gaseous_tools.Database.databaseType? DatabaseType)
|
public static void PreUpgradeScript(int TargetSchemaVersion, Database.databaseType? DatabaseType)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void PostUpgradeScript(int TargetSchemaVersion, gaseous_tools.Database.databaseType? DatabaseType)
|
public static void PostUpgradeScript(int TargetSchemaVersion, Database.databaseType? DatabaseType)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
|
|
||||||
switch(DatabaseType)
|
switch(DatabaseType)
|
||||||
@@ -65,7 +65,7 @@ namespace gaseous_tools
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void MySql_1002_MigrateMetadataVersion() {
|
public static void MySql_1002_MigrateMetadataVersion() {
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "";
|
string sql = "";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
|
|
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using gaseous_server.Classes;
|
||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Microsoft.CodeAnalysis.FlowAnalysis.DataFlow;
|
using Microsoft.CodeAnalysis.FlowAnalysis.DataFlow;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ namespace gaseous_server
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM GameLibraries WHERE DefaultLibrary=1 LIMIT 1";
|
string sql = "SELECT * FROM GameLibraries WHERE DefaultLibrary=1 LIMIT 1";
|
||||||
DataTable data = db.ExecuteCMD(sql);
|
DataTable data = db.ExecuteCMD(sql);
|
||||||
DataRow row = data.Rows[0];
|
DataRow row = data.Rows[0];
|
||||||
@@ -54,7 +54,7 @@ namespace gaseous_server
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
List<LibraryItem> libraryItems = new List<LibraryItem>();
|
List<LibraryItem> libraryItems = new List<LibraryItem>();
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM GameLibraries";
|
string sql = "SELECT * FROM GameLibraries";
|
||||||
DataTable data = db.ExecuteCMD(sql);
|
DataTable data = db.ExecuteCMD(sql);
|
||||||
foreach (DataRow row in data.Rows)
|
foreach (DataRow row in data.Rows)
|
||||||
@@ -86,7 +86,7 @@ namespace gaseous_server
|
|||||||
throw new PathNotFound(PathName);
|
throw new PathNotFound(PathName);
|
||||||
}
|
}
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "INSERT INTO GameLibraries (Name, Path, DefaultPlatform, DefaultLibrary) VALUES (@name, @path, @defaultplatform, 0); SELECT CAST(LAST_INSERT_ID() AS SIGNED);";
|
string sql = "INSERT INTO GameLibraries (Name, Path, DefaultPlatform, DefaultLibrary) VALUES (@name, @path, @defaultplatform, 0); SELECT CAST(LAST_INSERT_ID() AS SIGNED);";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("name", Name);
|
dbDict.Add("name", Name);
|
||||||
@@ -103,7 +103,7 @@ namespace gaseous_server
|
|||||||
{
|
{
|
||||||
if (GetLibrary(LibraryId).IsDefaultLibrary == false)
|
if (GetLibrary(LibraryId).IsDefaultLibrary == false)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "DELETE FROM Games_Roms WHERE LibraryId=@id; DELETE FROM GameLibraries WHERE Id=@id;";
|
string sql = "DELETE FROM Games_Roms WHERE LibraryId=@id; DELETE FROM GameLibraries WHERE Id=@id;";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", LibraryId);
|
dbDict.Add("id", LibraryId);
|
||||||
@@ -117,7 +117,7 @@ namespace gaseous_server
|
|||||||
|
|
||||||
public static LibraryItem GetLibrary(int LibraryId)
|
public static LibraryItem GetLibrary(int LibraryId)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM GameLibraries WHERE Id=@id";
|
string sql = "SELECT * FROM GameLibraries WHERE Id=@id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", LibraryId);
|
dbDict.Add("id", LibraryId);
|
||||||
|
@@ -5,7 +5,6 @@ using System.Security.Policy;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using NuGet.Common;
|
using NuGet.Common;
|
||||||
using static gaseous_server.Classes.Metadata.Games;
|
using static gaseous_server.Classes.Metadata.Games;
|
||||||
@@ -45,7 +44,7 @@ namespace gaseous_server.Classes
|
|||||||
{
|
{
|
||||||
public static void ImportGameFile(string GameFileImportPath, IGDB.Models.Platform? OverridePlatform)
|
public static void ImportGameFile(string GameFileImportPath, IGDB.Models.Platform? OverridePlatform)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "";
|
string sql = "";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
|
|
||||||
@@ -418,7 +417,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static long StoreROM(GameLibrary.LibraryItem library, Common.hashObject hash, IGDB.Models.Game determinedGame, IGDB.Models.Platform determinedPlatform, Models.Signatures_Games discoveredSignature, string GameFileImportPath, long UpdateId = 0)
|
public static long StoreROM(GameLibrary.LibraryItem library, Common.hashObject hash, IGDB.Models.Game determinedGame, IGDB.Models.Platform determinedPlatform, Models.Signatures_Games discoveredSignature, string GameFileImportPath, long UpdateId = 0)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
string sql = "";
|
string sql = "";
|
||||||
|
|
||||||
@@ -541,7 +540,7 @@ namespace gaseous_server.Classes
|
|||||||
File.Move(romPath, DestinationPath);
|
File.Move(romPath, DestinationPath);
|
||||||
|
|
||||||
// update the db
|
// update the db
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "UPDATE Games_Roms SET Path=@path WHERE Id=@id";
|
string sql = "UPDATE Games_Roms SET Path=@path WHERE Id=@id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", RomId);
|
dbDict.Add("id", RomId);
|
||||||
@@ -566,7 +565,7 @@ namespace gaseous_server.Classes
|
|||||||
GameLibrary.LibraryItem library = GameLibrary.GetDefaultLibrary;
|
GameLibrary.LibraryItem library = GameLibrary.GetDefaultLibrary;
|
||||||
|
|
||||||
// move rom files to their new location
|
// move rom files to their new location
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM Games_Roms WHERE LibraryId = @libraryid";
|
string sql = "SELECT * FROM Games_Roms WHERE LibraryId = @libraryid";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("libraryid", library.Id);
|
dbDict.Add("libraryid", library.Id);
|
||||||
|
@@ -3,7 +3,7 @@ using System.Data;
|
|||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Reflection.Metadata.Ecma335;
|
using System.Reflection.Metadata.Ecma335;
|
||||||
namespace gaseous_tools
|
namespace gaseous_server.Classes
|
||||||
{
|
{
|
||||||
public class Logging
|
public class Logging
|
||||||
{
|
{
|
||||||
@@ -69,7 +69,7 @@ namespace gaseous_tools
|
|||||||
|
|
||||||
if (LogToDiskOnly == false)
|
if (LogToDiskOnly == false)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "DELETE FROM ServerLogs WHERE EventTime < @EventRententionDate; INSERT INTO ServerLogs (EventTime, EventType, Process, Message, Exception) VALUES (@EventTime, @EventType, @Process, @Message, @Exception);";
|
string sql = "DELETE FROM ServerLogs WHERE EventTime < @EventRententionDate; INSERT INTO ServerLogs (EventTime, EventType, Process, Message, Exception) VALUES (@EventTime, @EventType, @Process, @Message, @Exception);";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("EventRententionDate", DateTime.UtcNow.AddDays(Config.LoggingConfiguration.LogRetention * -1));
|
dbDict.Add("EventRententionDate", DateTime.UtcNow.AddDays(Config.LoggingConfiguration.LogRetention * -1));
|
||||||
@@ -112,7 +112,7 @@ namespace gaseous_tools
|
|||||||
|
|
||||||
static public List<LogItem> GetLogs(long? StartIndex, int PageNumber = 1, int PageSize = 100)
|
static public List<LogItem> GetLogs(long? StartIndex, int PageNumber = 1, int PageSize = 100)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "";
|
string sql = "";
|
||||||
if (StartIndex == null)
|
if (StartIndex == null)
|
||||||
{
|
{
|
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using gaseous_server.Models;
|
using gaseous_server.Models;
|
||||||
using gaseous_tools;
|
|
||||||
using Microsoft.VisualStudio.Web.CodeGeneration;
|
using Microsoft.VisualStudio.Web.CodeGeneration;
|
||||||
|
|
||||||
namespace gaseous_server.Classes
|
namespace gaseous_server.Classes
|
||||||
@@ -46,7 +45,7 @@ namespace gaseous_server.Classes
|
|||||||
}
|
}
|
||||||
|
|
||||||
Logging.Log(Logging.LogType.Information, "Maintenance", "Optimising database tables");
|
Logging.Log(Logging.LogType.Information, "Maintenance", "Optimising database tables");
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SHOW TABLES;";
|
string sql = "SHOW TABLES;";
|
||||||
DataTable tables = db.ExecuteCMD(sql);
|
DataTable tables = db.ExecuteCMD(sql);
|
||||||
|
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -83,7 +81,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<AgeRating>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<AgeRating>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<AgeRatingContentDescription>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<AgeRatingContentDescription>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<AlternativeName>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<AlternativeName>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -84,7 +83,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<Artwork>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<Artwork>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<Collection>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<Collection>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
|
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<Company>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<Company>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -87,7 +86,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<CompanyLogo>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<CompanyLogo>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -84,7 +83,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<Cover>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<Cover>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -84,7 +83,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<ExternalGame>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<ExternalGame>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<Franchise>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<Franchise>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<GameMode>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<GameMode>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<GameVideo>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<GameVideo>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
|
|
||||||
@@ -116,7 +115,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<Game>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<Game>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<Genre>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<Genre>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
|
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<InvolvedCompany>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<InvolvedCompany>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -81,7 +80,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<MultiplayerMode>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<MultiplayerMode>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -87,7 +86,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<PlatformLogo>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<PlatformLogo>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
|
|
||||||
@@ -86,7 +85,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<PlatformVersion>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<PlatformVersion>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
return returnValue;
|
return returnValue;
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
|
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -83,7 +82,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<PlayerPerspective>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<PlayerPerspective>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -85,7 +84,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
returnValue = Storage.GetCacheValue<Screenshot>(returnValue, "id", (long)searchValue);
|
returnValue = Storage.GetCacheValue<Screenshot>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Microsoft.Extensions.Caching.Memory;
|
using Microsoft.Extensions.Caching.Memory;
|
||||||
@@ -67,7 +66,7 @@ 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 gaseous_tools.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;
|
||||||
|
|
||||||
@@ -178,7 +177,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
|
|
||||||
// execute sql
|
// execute sql
|
||||||
Database db = new gaseous_tools.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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -201,7 +200,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
string sql = "SELECT * FROM " + Endpoint + " WHERE " + SearchField + " = @" + SearchField;
|
string sql = "SELECT * FROM " + Endpoint + " WHERE " + SearchField + " = @" + SearchField;
|
||||||
|
|
||||||
@@ -425,7 +424,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
private static void StoreRelations(string PrimaryTable, string SecondaryTable, long ObjectId, string Relations)
|
private static void StoreRelations(string PrimaryTable, string SecondaryTable, long ObjectId, string Relations)
|
||||||
{
|
{
|
||||||
string TableName = "Relation_" + PrimaryTable + "_" + SecondaryTable;
|
string TableName = "Relation_" + PrimaryTable + "_" + SecondaryTable;
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
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 + "';";
|
string sql = "SELECT * FROM information_schema.tables WHERE table_schema = '" + Config.DatabaseConfiguration.DatabaseName + "' AND table_name = '" + TableName + "';";
|
||||||
DataTable data = db.ExecuteCMD(sql);
|
DataTable data = db.ExecuteCMD(sql);
|
||||||
if (data.Rows.Count == 0)
|
if (data.Rows.Count == 0)
|
||||||
|
@@ -1,8 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes.Metadata
|
namespace gaseous_server.Classes.Metadata
|
||||||
{
|
{
|
||||||
@@ -84,7 +83,7 @@ namespace gaseous_server.Classes.Metadata
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
gaseous_tools.Logging.Log(gaseous_tools.Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
Logging.Log(Logging.LogType.Warning, "Metadata: " + returnValue.GetType().Name, "An error occurred while connecting to IGDB. WhereClause: " + WhereClause, ex);
|
||||||
return Storage.GetCacheValue<Theme>(returnValue, "id", (long)searchValue);
|
return Storage.GetCacheValue<Theme>(returnValue, "id", (long)searchValue);
|
||||||
}
|
}
|
||||||
case Storage.CacheStatus.Current:
|
case Storage.CacheStatus.Current:
|
||||||
|
@@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using gaseous_server.Models;
|
using gaseous_server.Models;
|
||||||
using gaseous_tools;
|
|
||||||
|
|
||||||
namespace gaseous_server.Classes
|
namespace gaseous_server.Classes
|
||||||
{
|
{
|
||||||
@@ -9,7 +8,7 @@ namespace gaseous_server.Classes
|
|||||||
{
|
{
|
||||||
public static void RefreshMetadata(bool forceRefresh = false)
|
public static void RefreshMetadata(bool forceRefresh = false)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "";
|
string sql = "";
|
||||||
DataTable dt = new DataTable();
|
DataTable dt = new DataTable();
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using gaseous_tools;
|
|
||||||
using gaseous_signature_parser.models.RomSignatureObject;
|
using gaseous_signature_parser.models.RomSignatureObject;
|
||||||
using Microsoft.VisualBasic;
|
using Microsoft.VisualBasic;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
@@ -19,7 +18,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static GameRomMediaGroupItem CreateMediaGroup(long GameId, long PlatformId, List<long> RomIds)
|
public static GameRomMediaGroupItem CreateMediaGroup(long GameId, long PlatformId, List<long> RomIds)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "INSERT INTO RomMediaGroup (Status, PlatformId, GameId) VALUES (@status, @platformid, @gameid); SELECT CAST(LAST_INSERT_ID() AS SIGNED);";
|
string sql = "INSERT INTO RomMediaGroup (Status, PlatformId, GameId) VALUES (@status, @platformid, @gameid); SELECT CAST(LAST_INSERT_ID() AS SIGNED);";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("status", GameRomMediaGroupItem.GroupBuildStatus.WaitingForBuild);
|
dbDict.Add("status", GameRomMediaGroupItem.GroupBuildStatus.WaitingForBuild);
|
||||||
@@ -58,7 +57,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static GameRomMediaGroupItem GetMediaGroup(long Id)
|
public static GameRomMediaGroupItem GetMediaGroup(long Id)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM RomMediaGroup WHERE Id=@id;";
|
string sql = "SELECT * FROM RomMediaGroup WHERE Id=@id;";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", Id);
|
dbDict.Add("id", Id);
|
||||||
@@ -78,7 +77,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static List<GameRomMediaGroupItem> GetMediaGroupsFromGameId(long GameId)
|
public static List<GameRomMediaGroupItem> GetMediaGroupsFromGameId(long GameId)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM RomMediaGroup WHERE GameId=@gameid;";
|
string sql = "SELECT * FROM RomMediaGroup WHERE GameId=@gameid;";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("gameid", GameId);
|
dbDict.Add("gameid", GameId);
|
||||||
@@ -101,7 +100,7 @@ namespace gaseous_server.Classes
|
|||||||
{
|
{
|
||||||
GameRomMediaGroupItem mg = GetMediaGroup(Id);
|
GameRomMediaGroupItem mg = GetMediaGroup(Id);
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "";
|
string sql = "";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
|
|
||||||
@@ -156,7 +155,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static void DeleteMediaGroup(long Id)
|
public static void DeleteMediaGroup(long Id)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "DELETE FROM RomMediaGroup WHERE Id=@id;";
|
string sql = "DELETE FROM RomMediaGroup WHERE Id=@id;";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", Id);
|
dbDict.Add("id", Id);
|
||||||
@@ -179,7 +178,7 @@ namespace gaseous_server.Classes
|
|||||||
mediaGroupItem.RomIds = new List<long>();
|
mediaGroupItem.RomIds = new List<long>();
|
||||||
|
|
||||||
// get members
|
// get members
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM RomMediaGroup_Members WHERE GroupId=@id;";
|
string sql = "SELECT * FROM RomMediaGroup_Members WHERE GroupId=@id;";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", mediaGroupItem.Id);
|
dbDict.Add("id", mediaGroupItem.Id);
|
||||||
@@ -199,7 +198,7 @@ namespace gaseous_server.Classes
|
|||||||
if (mediaGroupItem.Status != GameRomMediaGroupItem.GroupBuildStatus.Building)
|
if (mediaGroupItem.Status != GameRomMediaGroupItem.GroupBuildStatus.Building)
|
||||||
{
|
{
|
||||||
// set collection item to waitingforbuild
|
// set collection item to waitingforbuild
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "UPDATE RomMediaGroup SET Status=@bs WHERE Id=@id";
|
string sql = "UPDATE RomMediaGroup SET Status=@bs WHERE Id=@id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", Id);
|
dbDict.Add("id", Id);
|
||||||
@@ -216,7 +215,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static void CompileMediaGroup(long Id)
|
public static void CompileMediaGroup(long Id)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
GameRomMediaGroupItem mediaGroupItem = GetMediaGroup(Id);
|
GameRomMediaGroupItem mediaGroupItem = GetMediaGroup(Id);
|
||||||
if (mediaGroupItem.Status == GameRomMediaGroupItem.GroupBuildStatus.WaitingForBuild)
|
if (mediaGroupItem.Status == GameRomMediaGroupItem.GroupBuildStatus.WaitingForBuild)
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using gaseous_tools;
|
|
||||||
using gaseous_signature_parser.models.RomSignatureObject;
|
using gaseous_signature_parser.models.RomSignatureObject;
|
||||||
using static gaseous_server.Classes.RomMediaGroup;
|
using static gaseous_server.Classes.RomMediaGroup;
|
||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
@@ -19,7 +18,7 @@ namespace gaseous_server.Classes
|
|||||||
{
|
{
|
||||||
GameRomObject GameRoms = new GameRomObject();
|
GameRomObject GameRoms = new GameRomObject();
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "";
|
string sql = "";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", GameId);
|
dbDict.Add("id", GameId);
|
||||||
@@ -52,7 +51,7 @@ namespace gaseous_server.Classes
|
|||||||
|
|
||||||
public static GameRomItem GetRom(long RomId)
|
public static GameRomItem GetRom(long RomId)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM Games_Roms WHERE Id = @id";
|
string sql = "SELECT * FROM Games_Roms WHERE Id = @id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", RomId);
|
dbDict.Add("id", RomId);
|
||||||
@@ -78,7 +77,7 @@ namespace gaseous_server.Classes
|
|||||||
// ensure metadata for gameid is present
|
// ensure metadata for gameid is present
|
||||||
IGDB.Models.Game game = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
IGDB.Models.Game game = Classes.Metadata.Games.GetGame(GameId, false, false, false);
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "UPDATE Games_Roms SET PlatformId=@platformid, GameId=@gameid WHERE Id = @id";
|
string sql = "UPDATE Games_Roms SET PlatformId=@platformid, GameId=@gameid WHERE Id = @id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", RomId);
|
dbDict.Add("id", RomId);
|
||||||
@@ -101,7 +100,7 @@ namespace gaseous_server.Classes
|
|||||||
File.Delete(rom.Path);
|
File.Delete(rom.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "DELETE FROM Games_Roms WHERE Id = @id";
|
string sql = "DELETE FROM Games_Roms WHERE Id = @id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("id", RomId);
|
dbDict.Add("id", RomId);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using gaseous_server.Classes;
|
||||||
using gaseous_signature_parser.models.RomSignatureObject;
|
using gaseous_signature_parser.models.RomSignatureObject;
|
||||||
using gaseous_tools;
|
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
|
||||||
namespace gaseous_server.SignatureIngestors.XML
|
namespace gaseous_server.SignatureIngestors.XML
|
||||||
@@ -11,7 +11,7 @@ namespace gaseous_server.SignatureIngestors.XML
|
|||||||
public void Import(string SearchPath, gaseous_signature_parser.parser.SignatureParser XMLType)
|
public void Import(string SearchPath, gaseous_signature_parser.parser.SignatureParser XMLType)
|
||||||
{
|
{
|
||||||
// connect to database
|
// connect to database
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
// process provided files
|
// process provided files
|
||||||
Logging.Log(Logging.LogType.Information, "Signature Ingestor - XML", "Importing from " + SearchPath);
|
Logging.Log(Logging.LogType.Information, "Signature Ingestor - XML", "Importing from " + SearchPath);
|
||||||
|
@@ -6,10 +6,12 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
public class BackgroundTasksController : Controller
|
public class BackgroundTasksController : Controller
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public List<ProcessQueue.QueueItem> GetQueue()
|
public List<ProcessQueue.QueueItem> GetQueue()
|
||||||
@@ -17,23 +19,24 @@ namespace gaseous_server.Controllers
|
|||||||
return ProcessQueue.QueueItems;
|
return ProcessQueue.QueueItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{TaskType}")]
|
[Route("{TaskType}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
public ActionResult<ProcessQueue.QueueItem> ForceRun(ProcessQueue.QueueItemType TaskType, Boolean ForceRun)
|
public ActionResult<ProcessQueue.QueueItem> ForceRun(ProcessQueue.QueueItemType TaskType, Boolean ForceRun)
|
||||||
{
|
{
|
||||||
foreach (ProcessQueue.QueueItem qi in ProcessQueue.QueueItems)
|
foreach (ProcessQueue.QueueItem qi in ProcessQueue.QueueItems)
|
||||||
{
|
{
|
||||||
if (qi.AllowManualStart == true)
|
if (qi.AllowManualStart == true)
|
||||||
{
|
{
|
||||||
if (TaskType == qi.ItemType)
|
if (TaskType == qi.ItemType)
|
||||||
{
|
{
|
||||||
if (ForceRun == true)
|
if (ForceRun == true)
|
||||||
{
|
{
|
||||||
qi.ForceExecute();
|
qi.ForceExecute();
|
||||||
}
|
}
|
||||||
return qi;
|
return qi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -3,14 +3,17 @@ using System.Collections.Generic;
|
|||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using gaseous_server.Classes;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
public class BiosController : Controller
|
public class BiosController : Controller
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public List<Classes.Bios.BiosItem> GetBios()
|
public List<Classes.Bios.BiosItem> GetBios()
|
||||||
@@ -18,6 +21,7 @@ namespace gaseous_server.Controllers
|
|||||||
return Classes.Bios.GetBios();
|
return Classes.Bios.GetBios();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{PlatformId}")]
|
[Route("{PlatformId}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
@@ -26,7 +30,9 @@ namespace gaseous_server.Controllers
|
|||||||
return Classes.Bios.GetBios(PlatformId, AvailableOnly);
|
return Classes.Bios.GetBios(PlatformId, AvailableOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpHead]
|
[HttpHead]
|
||||||
[Route("zip/{PlatformId}")]
|
[Route("zip/{PlatformId}")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
@@ -37,7 +43,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
IGDB.Models.Platform platform = Classes.Metadata.Platforms.GetPlatform(PlatformId);
|
IGDB.Models.Platform platform = Classes.Metadata.Platforms.GetPlatform(PlatformId);
|
||||||
|
|
||||||
string biosPath = Path.Combine(gaseous_tools.Config.LibraryConfiguration.LibraryBIOSDirectory, platform.Slug);
|
string biosPath = Path.Combine(Config.LibraryConfiguration.LibraryBIOSDirectory, platform.Slug);
|
||||||
|
|
||||||
string tempFile = Path.GetTempFileName();
|
string tempFile = Path.GetTempFileName();
|
||||||
|
|
||||||
@@ -59,7 +65,9 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpHead]
|
[HttpHead]
|
||||||
[Route("{PlatformId}/{BiosName}")]
|
[Route("{PlatformId}/{BiosName}")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
|
@@ -9,13 +9,15 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
public class CollectionsController : Controller
|
public class CollectionsController : Controller
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets all ROM collections
|
/// Gets all ROM collections
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public List<Classes.Collections.CollectionItem> GetCollections()
|
public List<Classes.Collections.CollectionItem> GetCollections()
|
||||||
@@ -29,6 +31,7 @@ namespace gaseous_server.Controllers
|
|||||||
/// <param name="CollectionId"></param>
|
/// <param name="CollectionId"></param>
|
||||||
/// <param name="Build">Set to true to begin the collection build process</param>
|
/// <param name="Build">Set to true to begin the collection build process</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{CollectionId}")]
|
[Route("{CollectionId}")]
|
||||||
[ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)]
|
||||||
@@ -55,6 +58,7 @@ namespace gaseous_server.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="CollectionId"></param>
|
/// <param name="CollectionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{CollectionId}/Roms")]
|
[Route("{CollectionId}/Roms")]
|
||||||
[ProducesResponseType(typeof(List<Classes.Collections.CollectionContents.CollectionPlatformItem>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Classes.Collections.CollectionContents.CollectionPlatformItem>), StatusCodes.Status200OK)]
|
||||||
@@ -77,6 +81,7 @@ namespace gaseous_server.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Item"></param>
|
/// <param name="Item"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("Preview")]
|
[Route("Preview")]
|
||||||
[ProducesResponseType(typeof(List<Classes.Collections.CollectionContents.CollectionPlatformItem>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Classes.Collections.CollectionContents.CollectionPlatformItem>), StatusCodes.Status200OK)]
|
||||||
@@ -98,6 +103,7 @@ namespace gaseous_server.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="CollectionId"></param>
|
/// <param name="CollectionId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{CollectionId}/Roms/Zip")]
|
[Route("{CollectionId}/Roms/Zip")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
@@ -108,7 +114,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
Classes.Collections.CollectionItem collectionItem = Classes.Collections.GetCollection(CollectionId);
|
Classes.Collections.CollectionItem collectionItem = Classes.Collections.GetCollection(CollectionId);
|
||||||
|
|
||||||
string ZipFilePath = Path.Combine(gaseous_tools.Config.LibraryConfiguration.LibraryCollectionsDirectory, CollectionId + ".zip");
|
string ZipFilePath = Path.Combine(Config.LibraryConfiguration.LibraryCollectionsDirectory, CollectionId + ".zip");
|
||||||
|
|
||||||
if (System.IO.File.Exists(ZipFilePath))
|
if (System.IO.File.Exists(ZipFilePath))
|
||||||
{
|
{
|
||||||
@@ -131,6 +137,7 @@ namespace gaseous_server.Controllers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Item"></param>
|
/// <param name="Item"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
@@ -152,6 +159,7 @@ namespace gaseous_server.Controllers
|
|||||||
/// <param name="CollectionId"></param>
|
/// <param name="CollectionId"></param>
|
||||||
/// <param name="Item"></param>
|
/// <param name="Item"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPatch]
|
[HttpPatch]
|
||||||
[Route("{CollectionId}")]
|
[Route("{CollectionId}")]
|
||||||
[ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)]
|
||||||
@@ -174,6 +182,7 @@ namespace gaseous_server.Controllers
|
|||||||
/// <param name="CollectionId"></param>
|
/// <param name="CollectionId"></param>
|
||||||
/// <param name="Item"></param>
|
/// <param name="Item"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPatch]
|
[HttpPatch]
|
||||||
[Route("{CollectionId}/AlwaysInclude")]
|
[Route("{CollectionId}/AlwaysInclude")]
|
||||||
[ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.Collections.CollectionItem), StatusCodes.Status200OK)]
|
||||||
@@ -208,6 +217,7 @@ namespace gaseous_server.Controllers
|
|||||||
/// Deletes the specified ROM collection
|
/// Deletes the specified ROM collection
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="CollectionId"></param>
|
/// <param name="CollectionId"></param>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
[Route("{CollectionId}")]
|
[Route("{CollectionId}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
@@ -3,23 +3,25 @@ using System.Collections.Generic;
|
|||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using gaseous_tools;
|
using gaseous_server.Classes;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class FilterController : ControllerBase
|
public class FilterController : ControllerBase
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
//[ResponseCache(CacheProfileName = "5Minute")]
|
//[ResponseCache(CacheProfileName = "5Minute")]
|
||||||
public Dictionary<string, object> Filter()
|
public Dictionary<string, object> Filter()
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
Dictionary<string, object> FilterSet = new Dictionary<string, object>();
|
Dictionary<string, object> FilterSet = new Dictionary<string, object>();
|
||||||
|
|
||||||
|
@@ -6,8 +6,8 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using gaseous_server.Classes;
|
||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -16,10 +16,12 @@ using static gaseous_server.Classes.Metadata.AgeRatings;
|
|||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class GamesController : ControllerBase
|
public class GamesController : ControllerBase
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(typeof(List<Game>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Game>), StatusCodes.Status200OK)]
|
||||||
public ActionResult Game(
|
public ActionResult Game(
|
||||||
@@ -203,7 +205,7 @@ namespace gaseous_server.Controllers
|
|||||||
orderByClause = "ORDER BY `Name` DESC";
|
orderByClause = "ORDER BY `Name` DESC";
|
||||||
}
|
}
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT DISTINCT Games_Roms.GameId AS ROMGameId, Game.* FROM Games_Roms LEFT JOIN Game ON Game.Id = Games_Roms.GameId LEFT JOIN Relation_Game_Genres ON Game.Id = Relation_Game_Genres.GameId LEFT JOIN Relation_Game_GameModes ON Game.Id = Relation_Game_GameModes.GameId LEFT JOIN Relation_Game_PlayerPerspectives ON Game.Id = Relation_Game_PlayerPerspectives.GameId LEFT JOIN Relation_Game_Themes ON Game.Id = Relation_Game_Themes.GameId " + whereClause + " " + havingClause + " " + orderByClause;
|
string sql = "SELECT DISTINCT Games_Roms.GameId AS ROMGameId, Game.* FROM Games_Roms LEFT JOIN Game ON Game.Id = Games_Roms.GameId LEFT JOIN Relation_Game_Genres ON Game.Id = Relation_Game_Genres.GameId LEFT JOIN Relation_Game_GameModes ON Game.Id = Relation_Game_GameModes.GameId LEFT JOIN Relation_Game_PlayerPerspectives ON Game.Id = Relation_Game_PlayerPerspectives.GameId LEFT JOIN Relation_Game_Themes ON Game.Id = Relation_Game_Themes.GameId " + whereClause + " " + havingClause + " " + orderByClause;
|
||||||
|
|
||||||
List<IGDB.Models.Game> RetVal = new List<IGDB.Models.Game>();
|
List<IGDB.Models.Game> RetVal = new List<IGDB.Models.Game>();
|
||||||
@@ -218,6 +220,7 @@ namespace gaseous_server.Controllers
|
|||||||
return RetVal;
|
return RetVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}")]
|
[Route("{GameId}")]
|
||||||
[ProducesResponseType(typeof(Game), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Game), StatusCodes.Status200OK)]
|
||||||
@@ -244,6 +247,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/alternativename")]
|
[Route("{GameId}/alternativename")]
|
||||||
[ProducesResponseType(typeof(List<AlternativeName>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<AlternativeName>), StatusCodes.Status200OK)]
|
||||||
@@ -275,6 +279,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/agerating")]
|
[Route("{GameId}/agerating")]
|
||||||
[ProducesResponseType(typeof(List<AgeRatings.GameAgeRating>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<AgeRatings.GameAgeRating>), StatusCodes.Status200OK)]
|
||||||
@@ -306,6 +311,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/agerating/{RatingId}/image")]
|
[Route("{GameId}/agerating/{RatingId}/image")]
|
||||||
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
|
||||||
@@ -385,6 +391,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/artwork")]
|
[Route("{GameId}/artwork")]
|
||||||
[ProducesResponseType(typeof(List<Artwork>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Artwork>), StatusCodes.Status200OK)]
|
||||||
@@ -414,6 +421,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/artwork/{ArtworkId}")]
|
[Route("{GameId}/artwork/{ArtworkId}")]
|
||||||
[ProducesResponseType(typeof(Artwork), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Artwork), StatusCodes.Status200OK)]
|
||||||
@@ -448,6 +456,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/artwork/{ArtworkId}/image")]
|
[Route("{GameId}/artwork/{ArtworkId}/image")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
@@ -502,6 +511,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/cover")]
|
[Route("{GameId}/cover")]
|
||||||
[ProducesResponseType(typeof(Cover), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Cover), StatusCodes.Status200OK)]
|
||||||
@@ -535,6 +545,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/cover/image")]
|
[Route("{GameId}/cover/image")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
@@ -574,6 +585,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/genre")]
|
[Route("{GameId}/genre")]
|
||||||
[ProducesResponseType(typeof(List<Genre>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Genre>), StatusCodes.Status200OK)]
|
||||||
@@ -610,6 +622,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/companies")]
|
[Route("{GameId}/companies")]
|
||||||
[ProducesResponseType(typeof(List<Dictionary<string, object>>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Dictionary<string, object>>), StatusCodes.Status200OK)]
|
||||||
@@ -653,6 +666,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/companies/{CompanyId}")]
|
[Route("{GameId}/companies/{CompanyId}")]
|
||||||
[ProducesResponseType(typeof(Dictionary<string, object>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Dictionary<string, object>), StatusCodes.Status200OK)]
|
||||||
@@ -694,6 +708,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/companies/{CompanyId}/image")]
|
[Route("{GameId}/companies/{CompanyId}/image")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
@@ -737,6 +752,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/roms")]
|
[Route("{GameId}/roms")]
|
||||||
[ProducesResponseType(typeof(Classes.Roms.GameRomObject), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.Roms.GameRomObject), StatusCodes.Status200OK)]
|
||||||
@@ -756,6 +772,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/roms/{RomId}")]
|
[Route("{GameId}/roms/{RomId}")]
|
||||||
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
|
||||||
@@ -783,6 +800,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPatch]
|
[HttpPatch]
|
||||||
[Route("{GameId}/roms/{RomId}")]
|
[Route("{GameId}/roms/{RomId}")]
|
||||||
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
|
||||||
@@ -810,6 +828,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
[Route("{GameId}/roms/{RomId}")]
|
[Route("{GameId}/roms/{RomId}")]
|
||||||
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.Roms.GameRomItem), StatusCodes.Status200OK)]
|
||||||
@@ -837,7 +856,9 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpHead]
|
[HttpHead]
|
||||||
[Route("{GameId}/roms/{RomId}/file")]
|
[Route("{GameId}/roms/{RomId}/file")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
@@ -872,7 +893,9 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpHead]
|
[HttpHead]
|
||||||
[Route("{GameId}/roms/{RomId}/{FileName}")]
|
[Route("{GameId}/roms/{RomId}/{FileName}")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
@@ -907,6 +930,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/romgroup/{RomGroupId}")]
|
[Route("{GameId}/romgroup/{RomGroupId}")]
|
||||||
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
|
||||||
@@ -934,6 +958,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("{GameId}/romgroup")]
|
[Route("{GameId}/romgroup")]
|
||||||
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
|
||||||
@@ -960,6 +985,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPatch]
|
[HttpPatch]
|
||||||
[Route("{GameId}/romgroup/{RomId}")]
|
[Route("{GameId}/romgroup/{RomId}")]
|
||||||
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
|
||||||
@@ -987,6 +1013,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
[Route("{GameId}/romgroup/{RomGroupId}")]
|
[Route("{GameId}/romgroup/{RomGroupId}")]
|
||||||
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Classes.RomMediaGroup.GameRomMediaGroupItem), StatusCodes.Status200OK)]
|
||||||
@@ -1014,7 +1041,9 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpHead]
|
[HttpHead]
|
||||||
[Route("{GameId}/romgroup/{RomGroupId}/file")]
|
[Route("{GameId}/romgroup/{RomGroupId}/file")]
|
||||||
[Route("{GameId}/romgroup/{RomGroupId}/{filename}")]
|
[Route("{GameId}/romgroup/{RomGroupId}/{filename}")]
|
||||||
@@ -1059,6 +1088,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("search")]
|
[Route("search")]
|
||||||
[ProducesResponseType(typeof(List<Game>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Game>), StatusCodes.Status200OK)]
|
||||||
@@ -1096,6 +1126,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/screenshots")]
|
[Route("{GameId}/screenshots")]
|
||||||
[ProducesResponseType(typeof(List<Screenshot>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Screenshot>), StatusCodes.Status200OK)]
|
||||||
@@ -1125,6 +1156,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/screenshots/{ScreenshotId}")]
|
[Route("{GameId}/screenshots/{ScreenshotId}")]
|
||||||
[ProducesResponseType(typeof(Screenshot), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Screenshot), StatusCodes.Status200OK)]
|
||||||
@@ -1157,6 +1189,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/screenshots/{ScreenshotId}/image")]
|
[Route("{GameId}/screenshots/{ScreenshotId}/image")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
@@ -1199,6 +1232,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{GameId}/videos")]
|
[Route("{GameId}/videos")]
|
||||||
[ProducesResponseType(typeof(List<GameVideo>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<GameVideo>), StatusCodes.Status200OK)]
|
||||||
|
@@ -8,9 +8,11 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
public class LibraryController : Controller
|
public class LibraryController : Controller
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(typeof(List<GameLibrary.LibraryItem>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<GameLibrary.LibraryItem>), StatusCodes.Status200OK)]
|
||||||
public ActionResult GetLibraries()
|
public ActionResult GetLibraries()
|
||||||
@@ -18,6 +20,7 @@ namespace gaseous_server.Controllers
|
|||||||
return Ok(GameLibrary.GetLibraries);
|
return Ok(GameLibrary.GetLibraries);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet("{LibraryId}")]
|
[HttpGet("{LibraryId}")]
|
||||||
[ProducesResponseType(typeof(GameLibrary.LibraryItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(GameLibrary.LibraryItem), StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
@@ -33,6 +36,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ProducesResponseType(typeof(GameLibrary.LibraryItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(GameLibrary.LibraryItem), StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
@@ -53,6 +57,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpDelete("{LibraryId}")]
|
[HttpDelete("{LibraryId}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
@@ -2,15 +2,17 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using gaseous_tools;
|
using gaseous_server.Classes;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
public class LogsController : Controller
|
public class LogsController : Controller
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public List<Logging.LogItem> Logs(long? StartIndex, int PageNumber = 1, int PageSize = 100)
|
public List<Logging.LogItem> Logs(long? StartIndex, int PageNumber = 1, int PageSize = 100)
|
||||||
|
@@ -7,7 +7,7 @@ using System.Reflection;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
using gaseous_server.Models;
|
using gaseous_server.Models;
|
||||||
using gaseous_tools;
|
using gaseous_server.Classes;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -15,10 +15,12 @@ using Microsoft.CodeAnalysis.Scripting;
|
|||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class PlatformMapsController : Controller
|
public class PlatformMapsController : Controller
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(typeof(List<PlatformMapping.PlatformMapItem>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<PlatformMapping.PlatformMapItem>), StatusCodes.Status200OK)]
|
||||||
public ActionResult GetPlatformMap(bool ResetToDefault = false)
|
public ActionResult GetPlatformMap(bool ResetToDefault = false)
|
||||||
@@ -31,6 +33,7 @@ namespace gaseous_server.Controllers
|
|||||||
return Ok(PlatformMapping.PlatformMap);
|
return Ok(PlatformMapping.PlatformMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{PlatformId}")]
|
[Route("{PlatformId}")]
|
||||||
[ProducesResponseType(typeof(PlatformMapping.PlatformMapItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(PlatformMapping.PlatformMapItem), StatusCodes.Status200OK)]
|
||||||
@@ -56,6 +59,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ProducesResponseType(typeof(List<IFormFile>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<IFormFile>), StatusCodes.Status200OK)]
|
||||||
[RequestSizeLimit(long.MaxValue)]
|
[RequestSizeLimit(long.MaxValue)]
|
||||||
@@ -110,7 +114,8 @@ namespace gaseous_server.Controllers
|
|||||||
return Ok(new { count = files.Count, size });
|
return Ok(new { count = files.Count, size });
|
||||||
}
|
}
|
||||||
|
|
||||||
// [HttpPost]
|
// [MapToApiVersion("1.0")]
|
||||||
|
[HttpPost]
|
||||||
// [Route("{PlatformId}")]
|
// [Route("{PlatformId}")]
|
||||||
// [ProducesResponseType(typeof(PlatformMapping.PlatformMapItem), StatusCodes.Status200OK)]
|
// [ProducesResponseType(typeof(PlatformMapping.PlatformMapItem), StatusCodes.Status200OK)]
|
||||||
// [ProducesResponseType(StatusCodes.Status404NotFound)]
|
// [ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
@@ -137,6 +142,7 @@ namespace gaseous_server.Controllers
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPatch]
|
[HttpPatch]
|
||||||
[Route("{PlatformId}")]
|
[Route("{PlatformId}")]
|
||||||
[ProducesResponseType(typeof(PlatformMapping.PlatformMapItem), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(PlatformMapping.PlatformMapItem), StatusCodes.Status200OK)]
|
||||||
|
@@ -5,9 +5,9 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using gaseous_server.Classes;
|
||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
using gaseous_server.Models;
|
using gaseous_server.Models;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -15,10 +15,12 @@ using Microsoft.CodeAnalysis.Scripting;
|
|||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class PlatformsController : Controller
|
public class PlatformsController : Controller
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(typeof(List<Platform>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Platform>), StatusCodes.Status200OK)]
|
||||||
public ActionResult Platform()
|
public ActionResult Platform()
|
||||||
@@ -28,7 +30,7 @@ namespace gaseous_server.Controllers
|
|||||||
|
|
||||||
public static List<Platform> GetPlatforms()
|
public static List<Platform> GetPlatforms()
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
string sql = "SELECT * FROM Platform WHERE Id IN (SELECT DISTINCT PlatformId FROM Games_Roms) ORDER BY `Name` ASC;";
|
string sql = "SELECT * FROM Platform WHERE Id IN (SELECT DISTINCT PlatformId FROM Games_Roms) ORDER BY `Name` ASC;";
|
||||||
|
|
||||||
@@ -43,6 +45,7 @@ namespace gaseous_server.Controllers
|
|||||||
return RetVal;
|
return RetVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{PlatformId}")]
|
[Route("{PlatformId}")]
|
||||||
[ProducesResponseType(typeof(Platform), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(Platform), StatusCodes.Status200OK)]
|
||||||
@@ -68,6 +71,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{PlatformId}/platformlogo")]
|
[Route("{PlatformId}/platformlogo")]
|
||||||
[ProducesResponseType(typeof(PlatformLogo), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(PlatformLogo), StatusCodes.Status200OK)]
|
||||||
@@ -100,6 +104,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("{PlatformId}/platformlogo/image")]
|
[Route("{PlatformId}/platformlogo/image")]
|
||||||
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(FileStreamResult), StatusCodes.Status200OK)]
|
||||||
|
@@ -6,8 +6,8 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using gaseous_server.Classes;
|
||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@@ -16,10 +16,12 @@ using static gaseous_server.Classes.Metadata.AgeRatings;
|
|||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
[ApiController]
|
[ApiController]
|
||||||
public class RomsController : ControllerBase
|
public class RomsController : ControllerBase
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ProducesResponseType(typeof(List<IFormFile>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<IFormFile>), StatusCodes.Status200OK)]
|
||||||
[RequestSizeLimit(long.MaxValue)]
|
[RequestSizeLimit(long.MaxValue)]
|
||||||
|
@@ -2,17 +2,18 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using gaseous_tools;
|
using gaseous_server.Classes;
|
||||||
using IGDB;
|
using IGDB;
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using static gaseous_server.Classes.Metadata.Games;
|
using static gaseous_server.Classes.Metadata.Games;
|
||||||
using static gaseous_tools.Config.ConfigFile;
|
|
||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
public class SearchController : Controller
|
public class SearchController : Controller
|
||||||
{
|
{
|
||||||
private static IGDBClient igdb = new IGDBClient(
|
private static IGDBClient igdb = new IGDBClient(
|
||||||
@@ -21,6 +22,7 @@ namespace gaseous_server.Controllers
|
|||||||
Config.IGDB.Secret
|
Config.IGDB.Secret
|
||||||
);
|
);
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("Platform")]
|
[Route("Platform")]
|
||||||
[ProducesResponseType(typeof(List<Platform>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Platform>), StatusCodes.Status200OK)]
|
||||||
@@ -42,6 +44,7 @@ namespace gaseous_server.Controllers
|
|||||||
return results.ToList();
|
return results.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("Game")]
|
[Route("Game")]
|
||||||
[ProducesResponseType(typeof(List<Game>), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(List<Game>), StatusCodes.Status200OK)]
|
||||||
|
@@ -4,8 +4,8 @@ using System.Data;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using gaseous_server.Classes;
|
||||||
using gaseous_signature_parser.models.RomSignatureObject;
|
using gaseous_signature_parser.models.RomSignatureObject;
|
||||||
using gaseous_tools;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
|
||||||
@@ -13,13 +13,15 @@ using Microsoft.AspNetCore.Mvc;
|
|||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/[controller]/[action]")]
|
[Route("api/v{version:apiVersion}/[controller]/[action]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
public class SignaturesController : ControllerBase
|
public class SignaturesController : ControllerBase
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get the current signature counts from the database
|
/// Get the current signature counts from the database
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Number of sources, publishers, games, and rom signatures in the database</returns>
|
/// <returns>Number of sources, publishers, games, and rom signatures in the database</returns>
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public Models.Signatures_Status Status()
|
public Models.Signatures_Status Status()
|
||||||
@@ -27,6 +29,7 @@ namespace gaseous_server.Controllers
|
|||||||
return new Models.Signatures_Status();
|
return new Models.Signatures_Status();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public List<Models.Signatures_Games> GetSignature(string md5 = "", string sha1 = "")
|
public List<Models.Signatures_Games> GetSignature(string md5 = "", string sha1 = "")
|
||||||
@@ -40,6 +43,7 @@ namespace gaseous_server.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public List<Models.Signatures_Games> GetByTosecName(string TosecName = "")
|
public List<Models.Signatures_Games> GetByTosecName(string TosecName = "")
|
||||||
@@ -55,7 +59,7 @@ namespace gaseous_server.Controllers
|
|||||||
|
|
||||||
private List<Models.Signatures_Games> _GetSignature(string sqlWhere, string searchString)
|
private List<Models.Signatures_Games> _GetSignature(string sqlWhere, string searchString)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT view_Signatures_Games.*, Signatures_Roms.Id AS romid, Signatures_Roms.Name AS romname, Signatures_Roms.Size, Signatures_Roms.CRC, Signatures_Roms.MD5, Signatures_Roms.SHA1, Signatures_Roms.DevelopmentStatus, Signatures_Roms.Attributes, Signatures_Roms.RomType, Signatures_Roms.RomTypeMedia, Signatures_Roms.MediaLabel, Signatures_Roms.MetadataSource FROM Signatures_Roms INNER JOIN view_Signatures_Games ON Signatures_Roms.GameId = view_Signatures_Games.Id WHERE " + sqlWhere;
|
string sql = "SELECT view_Signatures_Games.*, Signatures_Roms.Id AS romid, Signatures_Roms.Name AS romname, Signatures_Roms.Size, Signatures_Roms.CRC, Signatures_Roms.MD5, Signatures_Roms.SHA1, Signatures_Roms.DevelopmentStatus, Signatures_Roms.Attributes, Signatures_Roms.RomType, Signatures_Roms.RomTypeMedia, Signatures_Roms.MediaLabel, Signatures_Roms.MetadataSource FROM Signatures_Roms INNER JOIN view_Signatures_Games ON Signatures_Roms.GameId = view_Signatures_Games.Id WHERE " + sqlWhere;
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("searchString", searchString);
|
dbDict.Add("searchString", searchString);
|
||||||
|
@@ -5,20 +5,22 @@ using System.Linq;
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using gaseous_tools;
|
using gaseous_server.Classes;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace gaseous_server.Controllers
|
namespace gaseous_server.Controllers
|
||||||
{
|
{
|
||||||
[ApiController]
|
[ApiController]
|
||||||
[Route("api/v1/[controller]")]
|
[Route("api/v{version:apiVersion}/[controller]")]
|
||||||
|
[ApiVersion("1.0")]
|
||||||
public class SystemController : Controller
|
public class SystemController : Controller
|
||||||
{
|
{
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public SystemInfo GetSystemStatus()
|
public SystemInfo GetSystemStatus()
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
SystemInfo ReturnValue = new SystemInfo();
|
SystemInfo ReturnValue = new SystemInfo();
|
||||||
|
|
||||||
@@ -53,6 +55,7 @@ namespace gaseous_server.Controllers
|
|||||||
return ReturnValue;
|
return ReturnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("Version")]
|
[Route("Version")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
@@ -60,11 +63,12 @@ namespace gaseous_server.Controllers
|
|||||||
return Assembly.GetExecutingAssembly().GetName().Version;
|
return Assembly.GetExecutingAssembly().GetName().Version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MapToApiVersion("1.0")]
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("VersionFile")]
|
[Route("VersionFile")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
public FileContentResult GetSystemVersionAsFile() {
|
public FileContentResult GetSystemVersionAsFile() {
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string ver = "var AppVersion = \"" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + "\";" + Environment.NewLine +
|
string ver = "var AppVersion = \"" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + "\";" + Environment.NewLine +
|
||||||
"var DBSchemaVersion = \"" + db.GetDatabaseSchemaVersion() + "\";";
|
"var DBSchemaVersion = \"" + db.GetDatabaseSchemaVersion() + "\";";
|
||||||
byte[] bytes = Encoding.UTF8.GetBytes(ver);
|
byte[] bytes = Encoding.UTF8.GetBytes(ver);
|
||||||
@@ -75,7 +79,7 @@ namespace gaseous_server.Controllers
|
|||||||
{
|
{
|
||||||
SystemInfo.PathItem pathItem = new SystemInfo.PathItem {
|
SystemInfo.PathItem pathItem = new SystemInfo.PathItem {
|
||||||
LibraryPath = Path,
|
LibraryPath = Path,
|
||||||
SpaceUsed = gaseous_tools.Common.DirSize(new DirectoryInfo(Path)),
|
SpaceUsed = Common.DirSize(new DirectoryInfo(Path)),
|
||||||
SpaceAvailable = new DriveInfo(Path).AvailableFreeSpace,
|
SpaceAvailable = new DriveInfo(Path).AvailableFreeSpace,
|
||||||
TotalSpace = new DriveInfo(Path).TotalSize
|
TotalSpace = new DriveInfo(Path).TotalSize
|
||||||
};
|
};
|
||||||
|
@@ -8,7 +8,6 @@ using System.Web;
|
|||||||
using gaseous_server.Classes;
|
using gaseous_server.Classes;
|
||||||
using gaseous_server.Classes.Metadata;
|
using gaseous_server.Classes.Metadata;
|
||||||
using gaseous_server.Controllers;
|
using gaseous_server.Controllers;
|
||||||
using gaseous_tools;
|
|
||||||
using IGDB.Models;
|
using IGDB.Models;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
@@ -97,7 +96,7 @@ namespace gaseous_server.Models
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM PlatformMap";
|
string sql = "SELECT * FROM PlatformMap";
|
||||||
DataTable data = db.ExecuteCMD(sql);
|
DataTable data = db.ExecuteCMD(sql);
|
||||||
|
|
||||||
@@ -129,7 +128,7 @@ namespace gaseous_server.Models
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "SELECT * FROM PlatformMap WHERE Id = @Id";
|
string sql = "SELECT * FROM PlatformMap WHERE Id = @Id";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
dbDict.Add("Id", Id);
|
dbDict.Add("Id", Id);
|
||||||
@@ -152,7 +151,7 @@ namespace gaseous_server.Models
|
|||||||
|
|
||||||
public static void WritePlatformMap(PlatformMapItem item, bool Update, bool AllowAvailableEmulatorOverwrite)
|
public static void WritePlatformMap(PlatformMapItem item, bool Update, bool AllowAvailableEmulatorOverwrite)
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "";
|
string sql = "";
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
if (Update == false)
|
if (Update == false)
|
||||||
@@ -249,7 +248,7 @@ namespace gaseous_server.Models
|
|||||||
static PlatformMapItem BuildPlatformMapItem(DataRow row)
|
static PlatformMapItem BuildPlatformMapItem(DataRow row)
|
||||||
{
|
{
|
||||||
long IGDBId = (long)row["Id"];
|
long IGDBId = (long)row["Id"];
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||||
string sql = "";
|
string sql = "";
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using gaseous_tools;
|
using gaseous_server.Classes;
|
||||||
|
|
||||||
namespace gaseous_server.Models
|
namespace gaseous_server.Models
|
||||||
{
|
{
|
||||||
@@ -14,7 +14,7 @@ namespace gaseous_server.Models
|
|||||||
|
|
||||||
public Signatures_Status()
|
public Signatures_Status()
|
||||||
{
|
{
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
string sql = "select (select count(*) from Signatures_Sources) as SourceCount, (select count(*) from Signatures_Platforms) as PlatformCount, (select count(*) from Signatures_Games) as GameCount, (select count(*) from Signatures_Roms) as RomCount;";
|
string sql = "select (select count(*) from Signatures_Sources) as SourceCount, (select count(*) from Signatures_Platforms) as PlatformCount, (select count(*) from Signatures_Games) as GameCount, (select count(*) from Signatures_Roms) as RomCount;";
|
||||||
|
|
||||||
DataTable sigDb = db.ExecuteCMD(sql);
|
DataTable sigDb = db.ExecuteCMD(sql);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
using gaseous_server.Classes;
|
||||||
|
|
||||||
namespace gaseous_server
|
namespace gaseous_server
|
||||||
{
|
{
|
||||||
@@ -166,7 +166,7 @@ namespace gaseous_server
|
|||||||
|
|
||||||
case QueueItemType.BackgroundDatabaseUpgrade:
|
case QueueItemType.BackgroundDatabaseUpgrade:
|
||||||
Logging.Log(Logging.LogType.Debug, "Timered Event", "Starting Background Upgrade");
|
Logging.Log(Logging.LogType.Debug, "Timered Event", "Starting Background Upgrade");
|
||||||
gaseous_tools.DatabaseMigration.UpgradeScriptBackgroundTasks();
|
DatabaseMigration.UpgradeScriptBackgroundTasks();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QueueItemType.Maintainer:
|
case QueueItemType.Maintainer:
|
||||||
|
@@ -1,18 +1,19 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using gaseous_server;
|
using gaseous_server;
|
||||||
|
using gaseous_server.Classes;
|
||||||
using gaseous_server.Models;
|
using gaseous_server.Models;
|
||||||
using gaseous_server.SignatureIngestors.XML;
|
using gaseous_server.SignatureIngestors.XML;
|
||||||
using gaseous_tools;
|
|
||||||
using Microsoft.AspNetCore.Http.Features;
|
using Microsoft.AspNetCore.Http.Features;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Versioning;
|
||||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
|
|
||||||
Logging.WriteToDiskOnly = true;
|
Logging.WriteToDiskOnly = true;
|
||||||
Logging.Log(Logging.LogType.Information, "Startup", "Starting Gaseous Server " + Assembly.GetExecutingAssembly().GetName().Version);
|
Logging.Log(Logging.LogType.Information, "Startup", "Starting Gaseous Server " + Assembly.GetExecutingAssembly().GetName().Version);
|
||||||
|
|
||||||
Database db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionStringNoDatabase);
|
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionStringNoDatabase);
|
||||||
|
|
||||||
// check db availability
|
// check db availability
|
||||||
bool dbOnline = false;
|
bool dbOnline = false;
|
||||||
@@ -29,7 +30,7 @@ do
|
|||||||
}
|
}
|
||||||
} while (dbOnline == false);
|
} while (dbOnline == false);
|
||||||
|
|
||||||
db = new gaseous_tools.Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||||
|
|
||||||
// set up db
|
// set up db
|
||||||
db.InitDB();
|
db.InitDB();
|
||||||
@@ -111,6 +112,21 @@ builder.Services.AddControllers(options =>
|
|||||||
Location = ResponseCacheLocation.Any
|
Location = ResponseCacheLocation.Any
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
builder.Services.AddApiVersioning(config =>
|
||||||
|
{
|
||||||
|
config.DefaultApiVersion = new ApiVersion(1, 0);
|
||||||
|
config.AssumeDefaultVersionWhenUnspecified = true;
|
||||||
|
config.ReportApiVersions = true;
|
||||||
|
});
|
||||||
|
builder.Services.AddApiVersioning(setup =>
|
||||||
|
{
|
||||||
|
setup.ApiVersionReader = new UrlSegmentApiVersionReader();
|
||||||
|
});
|
||||||
|
builder.Services.AddVersionedApiExplorer(setup =>
|
||||||
|
{
|
||||||
|
setup.GroupNameFormat = "'v'VVV";
|
||||||
|
setup.SubstituteApiVersionInUrl = true;
|
||||||
|
});
|
||||||
|
|
||||||
// set max upload size
|
// set max upload size
|
||||||
builder.Services.Configure<IISServerOptions>(options =>
|
builder.Services.Configure<IISServerOptions>(options =>
|
||||||
@@ -134,7 +150,7 @@ builder.Services.AddSwaggerGen(options =>
|
|||||||
{
|
{
|
||||||
options.SwaggerDoc("v1", new OpenApiInfo
|
options.SwaggerDoc("v1", new OpenApiInfo
|
||||||
{
|
{
|
||||||
Version = "v1",
|
Version = "v1.0",
|
||||||
Title = "Gaseous Server API",
|
Title = "Gaseous Server API",
|
||||||
Description = "An API for managing the Gaseous Server",
|
Description = "An API for managing the Gaseous Server",
|
||||||
TermsOfService = new Uri("https://github.com/gaseous-project/gaseous-server"),
|
TermsOfService = new Uri("https://github.com/gaseous-project/gaseous-server"),
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using gaseous_tools;
|
using gaseous_server.Classes;
|
||||||
|
|
||||||
namespace gaseous_server
|
namespace gaseous_server
|
||||||
{
|
{
|
||||||
|
@@ -20,9 +20,13 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="gaseous-signature-parser" Version="2.0.0" />
|
<PackageReference Include="gaseous-signature-parser" Version="2.0.0" />
|
||||||
<PackageReference Include="gaseous.IGDB" Version="1.0.1" />
|
<PackageReference Include="gaseous.IGDB" Version="1.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.1.0" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.1.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.12" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.12" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.10" />
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.10" />
|
||||||
|
<PackageReference Include="MySqlConnector" Version="2.2.7" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -32,6 +36,13 @@
|
|||||||
<None Remove="Classes\" />
|
<None Remove="Classes\" />
|
||||||
<None Remove="Classes\SignatureIngestors\" />
|
<None Remove="Classes\SignatureIngestors\" />
|
||||||
<None Remove="Support\" />
|
<None Remove="Support\" />
|
||||||
|
<None Remove="Support\Database\" />
|
||||||
|
<None Remove="Support\Database\MySQL\" />
|
||||||
|
<None Remove="Support\Database\MySQL\gaseous-1000.sql" />
|
||||||
|
<None Remove="Support\Database\MySQL\gaseous-1001.sql" />
|
||||||
|
<None Remove="Support\Database\MySQL\gaseous-1002.sql" />
|
||||||
|
<None Remove="Support\Database\MySQL\gaseous-1003.sql" />
|
||||||
|
<None Remove="Support\Database\MySQL\gaseous-1004.sql" />
|
||||||
<None Remove="Classes\Metadata\" />
|
<None Remove="Classes\Metadata\" />
|
||||||
<None Remove="Assets\" />
|
<None Remove="Assets\" />
|
||||||
<None Remove="Assets\Ratings\" />
|
<None Remove="Assets\Ratings\" />
|
||||||
@@ -109,11 +120,6 @@
|
|||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\gaseous-tools\gaseous-tools.csproj">
|
|
||||||
<GlobalPropertiesToRemove></GlobalPropertiesToRemove>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Support\PlatformMap.json" Condition="'$(ExcludeConfigFilesFromBuildOutput)'!='true'">
|
<EmbeddedResource Include="Support\PlatformMap.json" Condition="'$(ExcludeConfigFilesFromBuildOutput)'!='true'">
|
||||||
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
|
||||||
@@ -158,5 +164,10 @@
|
|||||||
<EmbeddedResource Include="Assets\Ratings\CLASS_IND\CLASS_IND_Sixteen.svg" />
|
<EmbeddedResource Include="Assets\Ratings\CLASS_IND\CLASS_IND_Sixteen.svg" />
|
||||||
<EmbeddedResource Include="Assets\Ratings\CLASS_IND\CLASS_IND_Ten.svg" />
|
<EmbeddedResource Include="Assets\Ratings\CLASS_IND\CLASS_IND_Ten.svg" />
|
||||||
<EmbeddedResource Include="Assets\Ratings\CLASS_IND\CLASS_IND_Twelve.svg" />
|
<EmbeddedResource Include="Assets\Ratings\CLASS_IND\CLASS_IND_Twelve.svg" />
|
||||||
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1000.sql" />
|
||||||
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1001.sql" />
|
||||||
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1002.sql" />
|
||||||
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1003.sql" />
|
||||||
|
<EmbeddedResource Include="Support\Database\MySQL\gaseous-1004.sql" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<script src="/api/v1/System/VersionFile"></script>
|
<script src="/api/v1.0/System/VersionFile"></script>
|
||||||
<link type="text/css" rel="stylesheet" dat-href="/styles/style.css" />
|
<link type="text/css" rel="stylesheet" dat-href="/styles/style.css" />
|
||||||
<script src="/scripts/jquery-3.6.0.min.js"></script>
|
<script src="/scripts/jquery-3.6.0.min.js"></script>
|
||||||
<script src="/scripts/moment.js"></script>
|
<script src="/scripts/moment.js"></script>
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
GetCollections();
|
GetCollections();
|
||||||
|
|
||||||
function GetCollections() {
|
function GetCollections() {
|
||||||
ajaxCall('/api/v1/Collections', 'GET', function (result) {
|
ajaxCall('/api/v1.0/Collections', 'GET', function (result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
var targetDiv = document.getElementById('collection_table_location');
|
var targetDiv = document.getElementById('collection_table_location');
|
||||||
targetDiv.innerHTML = '';
|
targetDiv.innerHTML = '';
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
break;
|
break;
|
||||||
case "Completed":
|
case "Completed":
|
||||||
statusText = 'Available';
|
statusText = 'Available';
|
||||||
downloadLink = '<a href="/api/v1/Collections/' + result[i].id + '/Roms/Zip" class="romlink"><img src="/images/download.svg" class="banner_button_image" alt="Download" title="Download" /></a>';
|
downloadLink = '<a href="/api/v1.0/Collections/' + result[i].id + '/Roms/Zip" class="romlink"><img src="/images/download.svg" class="banner_button_image" alt="Download" title="Download" /></a>';
|
||||||
packageSize = formatBytes(result[i].collectionBuiltSizeBytes);
|
packageSize = formatBytes(result[i].collectionBuiltSizeBytes);
|
||||||
break;
|
break;
|
||||||
case "Failed":
|
case "Failed":
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
$('#collection_addgame').select2({
|
$('#collection_addgame').select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Collections',
|
url: '/api/v1.0/Collections',
|
||||||
placeholder: 'Select collection',
|
placeholder: 'Select collection',
|
||||||
processResults: function (data) {
|
processResults: function (data) {
|
||||||
var arr = [];
|
var arr = [];
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
if (CollectionId != 0) {
|
if (CollectionId != 0) {
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Collections/' + CollectionId + '/AlwaysInclude' + RebuildCollection,
|
'/api/v1.0/Collections/' + CollectionId + '/AlwaysInclude' + RebuildCollection,
|
||||||
'PATCH',
|
'PATCH',
|
||||||
function (result) {
|
function (result) {
|
||||||
closeSubDialog();
|
closeSubDialog();
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function deleteCollection() {
|
function deleteCollection() {
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Collections/' + subModalVariables,
|
'/api/v1.0/Collections/' + subModalVariables,
|
||||||
'DELETE',
|
'DELETE',
|
||||||
function (result) {
|
function (result) {
|
||||||
GetCollections();
|
GetCollections();
|
||||||
|
@@ -136,7 +136,7 @@
|
|||||||
// setup dropdowns
|
// setup dropdowns
|
||||||
$('#collection_platform').select2({
|
$('#collection_platform').select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Filter',
|
url: '/api/v1.0/Filter',
|
||||||
processResults: function (data) {
|
processResults: function (data) {
|
||||||
var filter = data['platforms'];
|
var filter = data['platforms'];
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@
|
|||||||
|
|
||||||
$('#collection_genres').select2({
|
$('#collection_genres').select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Filter',
|
url: '/api/v1.0/Filter',
|
||||||
processResults: function (data) {
|
processResults: function (data) {
|
||||||
var filter = data['genres'];
|
var filter = data['genres'];
|
||||||
|
|
||||||
@@ -182,7 +182,7 @@
|
|||||||
|
|
||||||
$('#collection_players').select2({
|
$('#collection_players').select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Filter',
|
url: '/api/v1.0/Filter',
|
||||||
processResults: function (data) {
|
processResults: function (data) {
|
||||||
var filter = data['gamemodes'];
|
var filter = data['gamemodes'];
|
||||||
|
|
||||||
@@ -205,7 +205,7 @@
|
|||||||
|
|
||||||
$('#collection_playerperspectives').select2({
|
$('#collection_playerperspectives').select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Filter',
|
url: '/api/v1.0/Filter',
|
||||||
processResults: function (data) {
|
processResults: function (data) {
|
||||||
var filter = data['playerperspectives'];
|
var filter = data['playerperspectives'];
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@
|
|||||||
|
|
||||||
$('#collection_themes').select2({
|
$('#collection_themes').select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Filter',
|
url: '/api/v1.0/Filter',
|
||||||
processResults: function (data) {
|
processResults: function (data) {
|
||||||
var filter = data['themes'];
|
var filter = data['themes'];
|
||||||
|
|
||||||
@@ -258,7 +258,7 @@
|
|||||||
|
|
||||||
// edit mode
|
// edit mode
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Collections/' + modalVariables,
|
'/api/v1.0/Collections/' + modalVariables,
|
||||||
'GET',
|
'GET',
|
||||||
function(result) {
|
function(result) {
|
||||||
if (result.name) { document.getElementById('collection_name').value = result.name; }
|
if (result.name) { document.getElementById('collection_name').value = result.name; }
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
// fill select2 controls
|
// fill select2 controls
|
||||||
$.ajax(
|
$.ajax(
|
||||||
{
|
{
|
||||||
url: '/api/v1/Filter',
|
url: '/api/v1.0/Filter',
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
indexValue: result,
|
indexValue: result,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
@@ -344,7 +344,7 @@
|
|||||||
// existing object - save over the top
|
// existing object - save over the top
|
||||||
item.id = modalVariables;
|
item.id = modalVariables;
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Collections/' + modalVariables,
|
'/api/v1.0/Collections/' + modalVariables,
|
||||||
'PATCH',
|
'PATCH',
|
||||||
function(result) {
|
function(result) {
|
||||||
location.reload();
|
location.reload();
|
||||||
@@ -357,7 +357,7 @@
|
|||||||
} else {
|
} else {
|
||||||
// new object
|
// new object
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Collections',
|
'/api/v1.0/Collections',
|
||||||
'POST',
|
'POST',
|
||||||
function(result) {
|
function(result) {
|
||||||
location.reload();
|
location.reload();
|
||||||
@@ -426,7 +426,7 @@
|
|||||||
var item = GenerateCollectionItem();
|
var item = GenerateCollectionItem();
|
||||||
|
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Collections/Preview',
|
'/api/v1.0/Collections/Preview',
|
||||||
'POST',
|
'POST',
|
||||||
function(result) {
|
function(result) {
|
||||||
DisplayPreview(result, 'collectionedit_previewbox_content');
|
DisplayPreview(result, 'collectionedit_previewbox_content');
|
||||||
@@ -579,7 +579,7 @@
|
|||||||
var gameImage = document.createElement('img');
|
var gameImage = document.createElement('img');
|
||||||
gameImage.className = 'game_tile_image game_tile_image_small';
|
gameImage.className = 'game_tile_image game_tile_image_small';
|
||||||
if (gameItem.cover) {
|
if (gameItem.cover) {
|
||||||
gameImage.src = '/api/v1/Games/' + gameItem.id + '/cover/image';
|
gameImage.src = '/api/v1.0/Games/' + gameItem.id + '/cover/image';
|
||||||
} else {
|
} else {
|
||||||
gameImage.src = '/images/unknowngame.png';
|
gameImage.src = '/images/unknowngame.png';
|
||||||
gameImage.className = 'game_tile_image game_tile_image_small unknown';
|
gameImage.className = 'game_tile_image game_tile_image_small unknown';
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function deleteLibrary() {
|
function deleteLibrary() {
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Library/' + subModalVariables,
|
'/api/v1.0/Library/' + subModalVariables,
|
||||||
'DELETE',
|
'DELETE',
|
||||||
function (result) {
|
function (result) {
|
||||||
drawLibrary();
|
drawLibrary();
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
$('#newlibrary_defaultplatform').select2({
|
$('#newlibrary_defaultplatform').select2({
|
||||||
minimumInputLength: 3,
|
minimumInputLength: 3,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Search/Platform',
|
url: '/api/v1.0/Search/Platform',
|
||||||
data: function (params) {
|
data: function (params) {
|
||||||
var query = {
|
var query = {
|
||||||
SearchString: params.term
|
SearchString: params.term
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
alert("A path must be provided.");
|
alert("A path must be provided.");
|
||||||
} else {
|
} else {
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Library?Name=' + encodeURIComponent(libName) + '&DefaultPlatformId=' + libPlatform[0].id + '&Path=' + encodeURIComponent(libPath),
|
'/api/v1.0/Library?Name=' + encodeURIComponent(libName) + '&DefaultPlatformId=' + libPlatform[0].id + '&Path=' + encodeURIComponent(libPath),
|
||||||
'POST',
|
'POST',
|
||||||
function(result) {
|
function(result) {
|
||||||
drawLibrary();
|
drawLibrary();
|
||||||
|
@@ -12,7 +12,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function deleteCollection() {
|
function deleteCollection() {
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Games/' + gameData.id + '/romgroup/' + subModalVariables,
|
'/api/v1.0/Games/' + gameData.id + '/romgroup/' + subModalVariables,
|
||||||
'DELETE',
|
'DELETE',
|
||||||
function (result) {
|
function (result) {
|
||||||
loadRoms();
|
loadRoms();
|
||||||
|
@@ -105,7 +105,7 @@
|
|||||||
DisplayWebEmulatorContent(false);
|
DisplayWebEmulatorContent(false);
|
||||||
|
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/PlatformMaps/' + modalVariables,
|
'/api/v1.0/PlatformMaps/' + modalVariables,
|
||||||
'GET',
|
'GET',
|
||||||
function (result) {
|
function (result) {
|
||||||
// set heading
|
// set heading
|
||||||
@@ -338,7 +338,7 @@
|
|||||||
console.log(JSON.stringify(item));
|
console.log(JSON.stringify(item));
|
||||||
|
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/PlatformMaps/' + modalVariables,
|
'/api/v1.0/PlatformMaps/' + modalVariables,
|
||||||
'PATCH',
|
'PATCH',
|
||||||
function (result) {
|
function (result) {
|
||||||
loadPlatformMapping();
|
loadPlatformMapping();
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function deleteRom() {
|
function deleteRom() {
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + modalVariables, 'DELETE', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + modalVariables, 'DELETE', function (result) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -118,7 +118,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + modalVariables, 'GET', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + modalVariables, 'GET', function (result) {
|
||||||
romData = result;
|
romData = result;
|
||||||
document.getElementById('modal-heading').innerHTML = result.name;
|
document.getElementById('modal-heading').innerHTML = result.name;
|
||||||
document.getElementById('rominfo_library').innerHTML = result.library.name;
|
document.getElementById('rominfo_library').innerHTML = result.library.name;
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
$('#properties_fixplatform').select2({
|
$('#properties_fixplatform').select2({
|
||||||
minimumInputLength: 3,
|
minimumInputLength: 3,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Search/Platform',
|
url: '/api/v1.0/Search/Platform',
|
||||||
data: function (params) {
|
data: function (params) {
|
||||||
var query = {
|
var query = {
|
||||||
SearchString: params.term
|
SearchString: params.term
|
||||||
@@ -200,7 +200,7 @@
|
|||||||
minimumInputLength: 3,
|
minimumInputLength: 3,
|
||||||
templateResult: DropDownRenderGameOption,
|
templateResult: DropDownRenderGameOption,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Search/Game',
|
url: '/api/v1.0/Search/Game',
|
||||||
data: function (params) {
|
data: function (params) {
|
||||||
fixplatform = $('#properties_fixplatform').select2('data');
|
fixplatform = $('#properties_fixplatform').select2('data');
|
||||||
|
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
|
|
||||||
document.getElementById('properties_fixsave').setAttribute("disabled", "disabled");
|
document.getElementById('properties_fixsave').setAttribute("disabled", "disabled");
|
||||||
|
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + modalVariables + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + modalVariables + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
document.getElementById('upload_platformoverride').innerHTML = "<option value='0' selected='selected'>Automatic Platform</option>";
|
document.getElementById('upload_platformoverride').innerHTML = "<option value='0' selected='selected'>Automatic Platform</option>";
|
||||||
|
|
||||||
var myDropzone = new Dropzone("div#upload_target", {
|
var myDropzone = new Dropzone("div#upload_target", {
|
||||||
url: "/api/v1/Roms",
|
url: "/api/v1.0/Roms",
|
||||||
autoProcessQueue: true,
|
autoProcessQueue: true,
|
||||||
uploadMultiple: true,
|
uploadMultiple: true,
|
||||||
paramName: myParamName,
|
paramName: myParamName,
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
$('#upload_platformoverride').select2({
|
$('#upload_platformoverride').select2({
|
||||||
minimumInputLength: 3,
|
minimumInputLength: 3,
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Search/Platform',
|
url: '/api/v1.0/Search/Platform',
|
||||||
data: function (params) {
|
data: function (params) {
|
||||||
var query = {
|
var query = {
|
||||||
SearchString: params.term
|
SearchString: params.term
|
||||||
@@ -125,6 +125,6 @@
|
|||||||
}
|
}
|
||||||
console.log(queryString);
|
console.log(queryString);
|
||||||
|
|
||||||
myDropzone.options.url = "/api/v1/Roms" + queryString;
|
myDropzone.options.url = "/api/v1.0/Roms" + queryString;
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
@@ -15,7 +15,7 @@
|
|||||||
var emuBios = '';
|
var emuBios = '';
|
||||||
var emuBackground = '';
|
var emuBackground = '';
|
||||||
|
|
||||||
ajaxCall('/api/v1/Games/' + gameId, 'GET', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId, 'GET', function (result) {
|
||||||
gameData = result;
|
gameData = result;
|
||||||
|
|
||||||
// load artwork
|
// load artwork
|
||||||
@@ -27,22 +27,22 @@
|
|||||||
} else {
|
} else {
|
||||||
if (result.cover) {
|
if (result.cover) {
|
||||||
var bg = document.getElementById('bgImage');
|
var bg = document.getElementById('bgImage');
|
||||||
bg.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/cover/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
bg.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/cover/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.cover) {
|
if (result.cover) {
|
||||||
emuBackground = '/api/v1/Games/' + gameId + '/cover/image';
|
emuBackground = '/api/v1.0/Games/' + gameId + '/cover/image';
|
||||||
}
|
}
|
||||||
|
|
||||||
emuGameTitle = gameData.name;
|
emuGameTitle = gameData.name;
|
||||||
});
|
});
|
||||||
|
|
||||||
ajaxCall('/api/v1/Bios/' + platformId, 'GET', function (result) {
|
ajaxCall('/api/v1.0/Bios/' + platformId, 'GET', function (result) {
|
||||||
if (result.length == 0) {
|
if (result.length == 0) {
|
||||||
emuBios = '';
|
emuBios = '';
|
||||||
} else {
|
} else {
|
||||||
emuBios = '/api/v1/Bios/zip/' + platformId;
|
emuBios = '/api/v1.0/Bios/zip/' + platformId;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (getQueryString('engine', 'string')) {
|
switch (getQueryString('engine', 'string')) {
|
||||||
@@ -59,7 +59,7 @@
|
|||||||
artworksPosition = 0;
|
artworksPosition = 0;
|
||||||
}
|
}
|
||||||
var bg = document.getElementById('bgImage');
|
var bg = document.getElementById('bgImage');
|
||||||
bg.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/artwork/' + artworks[artworksPosition] + '/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
bg.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/artwork/' + artworks[artworksPosition] + '/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@@ -94,7 +94,7 @@
|
|||||||
var artworksTimer = null;
|
var artworksTimer = null;
|
||||||
var selectedScreenshot = 0;
|
var selectedScreenshot = 0;
|
||||||
|
|
||||||
ajaxCall('/api/v1/Games/' + gameId, 'GET', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId, 'GET', function (result) {
|
||||||
// populate games page
|
// populate games page
|
||||||
gameData = result;
|
gameData = result;
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
// get alt name
|
// get alt name
|
||||||
var gameTitleAltLabel = document.getElementById('gametitle_alts');
|
var gameTitleAltLabel = document.getElementById('gametitle_alts');
|
||||||
if (result.alternativeNames) {
|
if (result.alternativeNames) {
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/alternativename', 'GET', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/alternativename', 'GET', function (result) {
|
||||||
var altNames = '';
|
var altNames = '';
|
||||||
for (var i = 0; i < result.length; i++) {
|
for (var i = 0; i < result.length; i++) {
|
||||||
if (altNames.length > 0) {
|
if (altNames.length > 0) {
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
} else {
|
} else {
|
||||||
var bg = document.getElementById('bgImage');
|
var bg = document.getElementById('bgImage');
|
||||||
if (result.cover) {
|
if (result.cover) {
|
||||||
bg.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/cover/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
bg.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/cover/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
||||||
} else {
|
} else {
|
||||||
var randomInt = randomIntFromInterval(1, 3);
|
var randomInt = randomIntFromInterval(1, 3);
|
||||||
bg.setAttribute('style', 'background-image: url("/images/gamebg' + randomInt + '.jpg"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
bg.setAttribute('style', 'background-image: url("/images/gamebg' + randomInt + '.jpg"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
||||||
@@ -175,7 +175,7 @@
|
|||||||
var gameDeveloperLoaded = false;
|
var gameDeveloperLoaded = false;
|
||||||
var gamePublisherLoaded = false;
|
var gamePublisherLoaded = false;
|
||||||
if (result.involvedCompanies) {
|
if (result.involvedCompanies) {
|
||||||
ajaxCall('/api/v1/games/' + gameId + '/companies', 'GET', function (result) {
|
ajaxCall('/api/v1.0/games/' + gameId + '/companies', 'GET', function (result) {
|
||||||
var lstDevelopers = [];
|
var lstDevelopers = [];
|
||||||
var lstPublishers = [];
|
var lstPublishers = [];
|
||||||
|
|
||||||
@@ -227,7 +227,7 @@
|
|||||||
var gameImage = document.createElement('img');
|
var gameImage = document.createElement('img');
|
||||||
gameImage.className = 'game_cover_image';
|
gameImage.className = 'game_cover_image';
|
||||||
if (result.cover) {
|
if (result.cover) {
|
||||||
gameImage.src = '/api/v1/Games/' + result.id + '/cover/image';
|
gameImage.src = '/api/v1.0/Games/' + result.id + '/cover/image';
|
||||||
} else {
|
} else {
|
||||||
gameImage.src = '/images/unknowngame.png';
|
gameImage.src = '/images/unknowngame.png';
|
||||||
gameImage.className = 'game_cover_image unknown';
|
gameImage.className = 'game_cover_image unknown';
|
||||||
@@ -240,7 +240,7 @@
|
|||||||
var gameRatings = document.createElement('div');
|
var gameRatings = document.createElement('div');
|
||||||
for (var i = 0; i < result.ageRatings.ids.length; i++) {
|
for (var i = 0; i < result.ageRatings.ids.length; i++) {
|
||||||
var ratingImage = document.createElement('img');
|
var ratingImage = document.createElement('img');
|
||||||
ratingImage.src = '/api/v1/Games/' + result.id + '/agerating/' + result.ageRatings.ids[i] + '/image';
|
ratingImage.src = '/api/v1.0/Games/' + result.id + '/agerating/' + result.ageRatings.ids[i] + '/image';
|
||||||
ratingImage.className = 'rating_image';
|
ratingImage.className = 'rating_image';
|
||||||
gameRatings.appendChild(ratingImage);
|
gameRatings.appendChild(ratingImage);
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@
|
|||||||
// load genres
|
// load genres
|
||||||
var gameSummaryGenres = document.getElementById('gamesumarry_genres');
|
var gameSummaryGenres = document.getElementById('gamesumarry_genres');
|
||||||
if (result.genres) {
|
if (result.genres) {
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/genre', 'GET', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/genre', 'GET', function (result) {
|
||||||
for (var i = 0; i < result.length; i++) {
|
for (var i = 0; i < result.length; i++) {
|
||||||
var genreLabel = document.createElement('span');
|
var genreLabel = document.createElement('span');
|
||||||
genreLabel.className = 'gamegenrelabel';
|
genreLabel.className = 'gamegenrelabel';
|
||||||
@@ -281,7 +281,7 @@
|
|||||||
var screenshotItem = document.createElement('div');
|
var screenshotItem = document.createElement('div');
|
||||||
screenshotItem.id = 'gamescreenshots_gallery_' + imageIndex;
|
screenshotItem.id = 'gamescreenshots_gallery_' + imageIndex;
|
||||||
screenshotItem.setAttribute('name', 'gamescreenshots_gallery_item');
|
screenshotItem.setAttribute('name', 'gamescreenshots_gallery_item');
|
||||||
screenshotItem.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/screenshots/' + result.screenshots.ids[i] + '/image"); background-position: center; background-repeat: no-repeat; background-size: contain;)');
|
screenshotItem.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/screenshots/' + result.screenshots.ids[i] + '/image"); background-position: center; background-repeat: no-repeat; background-size: contain;)');
|
||||||
screenshotItem.setAttribute('imageid', imageIndex);
|
screenshotItem.setAttribute('imageid', imageIndex);
|
||||||
screenshotItem.setAttribute('imagetype', 0);
|
screenshotItem.setAttribute('imagetype', 0);
|
||||||
screenshotItem.className = 'gamescreenshots_gallery_item';
|
screenshotItem.className = 'gamescreenshots_gallery_item';
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
|
|
||||||
// load videos
|
// load videos
|
||||||
if (result.videos) {
|
if (result.videos) {
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/videos', 'GET', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/videos', 'GET', function (result) {
|
||||||
var gameScreenshots_vGallery = document.getElementById('gamescreenshots_gallery_panel');
|
var gameScreenshots_vGallery = document.getElementById('gamescreenshots_gallery_panel');
|
||||||
for (var i = 0; i < result.length; i++) {
|
for (var i = 0; i < result.length; i++) {
|
||||||
var vScreenshotItem = document.createElement('div');
|
var vScreenshotItem = document.createElement('div');
|
||||||
@@ -360,7 +360,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var gameRoms = document.getElementById('gamesummaryroms');
|
var gameRoms = document.getElementById('gamesummaryroms');
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/roms', 'GET', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/roms', 'GET', function (result) {
|
||||||
if (result.gameRomItems) {
|
if (result.gameRomItems) {
|
||||||
var gameRomItems = result.gameRomItems;
|
var gameRomItems = result.gameRomItems;
|
||||||
var mediaGroups = result.mediaGroups;
|
var mediaGroups = result.mediaGroups;
|
||||||
@@ -391,14 +391,14 @@
|
|||||||
if (result.gameRomItems[i].emulator) {
|
if (result.gameRomItems[i].emulator) {
|
||||||
if (gameRomItems[i].emulator.type) {
|
if (gameRomItems[i].emulator.type) {
|
||||||
if (gameRomItems[i].emulator.type.length > 0) {
|
if (gameRomItems[i].emulator.type.length > 0) {
|
||||||
launchButton = '<a href="/index.html?page=emulator&engine=' + gameRomItems[i].emulator.type + '&core=' + gameRomItems[i].emulator.core + '&platformid=' + gameRomItems[i].platform.id + '&gameid=' + gameId + '&rompath=' + encodeURIComponent('/api/v1/Games/' + gameId + '/roms/' + gameRomItems[i].id + '/' + encodeURIComponent(gameRomItems[i].name)) + '" class="romstart">Launch</a>';
|
launchButton = '<a href="/index.html?page=emulator&engine=' + gameRomItems[i].emulator.type + '&core=' + gameRomItems[i].emulator.core + '&platformid=' + gameRomItems[i].platform.id + '&gameid=' + gameId + '&rompath=' + encodeURIComponent('/api/v1.0/Games/' + gameId + '/roms/' + gameRomItems[i].id + '/' + encodeURIComponent(gameRomItems[i].name)) + '" class="romstart">Launch</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var newRow = [
|
var newRow = [
|
||||||
['<input type="checkbox" name="rom_checkbox" data-gameid="' + gameData.id + '" data-platformid="' + gameRomItems[i].platformId + '" data-romid="' + gameRomItems[i].id + '" onclick="handleChecks();" />', 'rom_checkbox_box_hidden', 'rom_edit_checkbox'],
|
['<input type="checkbox" name="rom_checkbox" data-gameid="' + gameData.id + '" data-platformid="' + gameRomItems[i].platformId + '" data-romid="' + gameRomItems[i].id + '" onclick="handleChecks();" />', 'rom_checkbox_box_hidden', 'rom_edit_checkbox'],
|
||||||
'<a href="/api/v1/Games/' + gameId + '/roms/' + gameRomItems[i].id + '/' + encodeURIComponent(gameRomItems[i].name) + '" class="romlink">' + gameRomItems[i].name + '</a>',
|
'<a href="/api/v1.0/Games/' + gameId + '/roms/' + gameRomItems[i].id + '/' + encodeURIComponent(gameRomItems[i].name) + '" class="romlink">' + gameRomItems[i].name + '</a>',
|
||||||
formatBytes(gameRomItems[i].size, 2),
|
formatBytes(gameRomItems[i].size, 2),
|
||||||
gameRomItems[i].romTypeMedia,
|
gameRomItems[i].romTypeMedia,
|
||||||
gameRomItems[i].mediaLabel,
|
gameRomItems[i].mediaLabel,
|
||||||
@@ -436,7 +436,7 @@
|
|||||||
if (gameRomItem.platformId == mediaGroup.platformId) {
|
if (gameRomItem.platformId == mediaGroup.platformId) {
|
||||||
if (gameRomItem.emulator) {
|
if (gameRomItem.emulator) {
|
||||||
if (gameRomItem.emulator.type.length > 0) {
|
if (gameRomItem.emulator.type.length > 0) {
|
||||||
launchButton = '<a href="/index.html?page=emulator&engine=' + gameRomItem.emulator.type + '&core=' + gameRomItem.emulator.core + '&platformid=' + gameRomItem.platform.id + '&gameid=' + gameId + '&rompath=' + encodeURIComponent('/api/v1/Games/' + gameId + '/romgroup/' + mediaGroup.id + '/' + gameData.name + '(' + mediaGroup.id + ')' + '.zip') + '" class="romstart">Launch</a>';
|
launchButton = '<a href="/index.html?page=emulator&engine=' + gameRomItem.emulator.type + '&core=' + gameRomItem.emulator.core + '&platformid=' + gameRomItem.platform.id + '&gameid=' + gameId + '&rompath=' + encodeURIComponent('/api/v1.0/Games/' + gameId + '/romgroup/' + mediaGroup.id + '/' + gameData.name + '(' + mediaGroup.id + ')' + '.zip') + '" class="romstart">Launch</a>';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -459,7 +459,7 @@
|
|||||||
break;
|
break;
|
||||||
case "Completed":
|
case "Completed":
|
||||||
statusText = 'Available';
|
statusText = 'Available';
|
||||||
downloadLink = '<a href="/api/v1/Games/' + gameId + '/romgroup/' + mediaGroup.id + '/' + gameData.name + '.zip" class="romlink"><img src="/images/download.svg" class="banner_button_image" alt="Download" title="Download" /></a>';
|
downloadLink = '<a href="/api/v1.0/Games/' + gameId + '/romgroup/' + mediaGroup.id + '/' + gameData.name + '.zip" class="romlink"><img src="/images/download.svg" class="banner_button_image" alt="Download" title="Download" /></a>';
|
||||||
packageSize = formatBytes(mediaGroup.size);
|
packageSize = formatBytes(mediaGroup.size);
|
||||||
launchButtonContent = launchButton;
|
launchButtonContent = launchButton;
|
||||||
break;
|
break;
|
||||||
@@ -525,7 +525,7 @@
|
|||||||
artworksPosition = 0;
|
artworksPosition = 0;
|
||||||
}
|
}
|
||||||
var bg = document.getElementById('bgImage');
|
var bg = document.getElementById('bgImage');
|
||||||
bg.setAttribute('style', 'background-image: url("/api/v1/Games/' + gameId + '/artwork/' + artworks[artworksPosition] + '/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
bg.setAttribute('style', 'background-image: url("/api/v1.0/Games/' + gameId + '/artwork/' + artworks[artworksPosition] + '/image"); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); -webkit-filter: blur(10px);');
|
||||||
artworksTimer = setTimeout(rotateBackground, 60000);
|
artworksTimer = setTimeout(rotateBackground, 60000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -677,7 +677,7 @@
|
|||||||
minimumInputLength: 3,
|
minimumInputLength: 3,
|
||||||
placeholder: "Platform",
|
placeholder: "Platform",
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Search/Platform',
|
url: '/api/v1.0/Search/Platform',
|
||||||
data: function (params) {
|
data: function (params) {
|
||||||
var query = {
|
var query = {
|
||||||
SearchString: params.term
|
SearchString: params.term
|
||||||
@@ -709,7 +709,7 @@
|
|||||||
templateResult: DropDownRenderGameOption,
|
templateResult: DropDownRenderGameOption,
|
||||||
placeholder: "Game",
|
placeholder: "Game",
|
||||||
ajax: {
|
ajax: {
|
||||||
url: '/api/v1/Search/Game',
|
url: '/api/v1.0/Search/Game',
|
||||||
data: function (params) {
|
data: function (params) {
|
||||||
fixplatform = $('#rom_edit_fixplatform').select2('data');
|
fixplatform = $('#rom_edit_fixplatform').select2('data');
|
||||||
|
|
||||||
@@ -762,7 +762,7 @@
|
|||||||
if (rom_checks[i].checked == true) {
|
if (rom_checks[i].checked == true) {
|
||||||
var romId = rom_checks[i].getAttribute('data-romid');
|
var romId = rom_checks[i].getAttribute('data-romid');
|
||||||
remapCallCounter += 1;
|
remapCallCounter += 1;
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + romId + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + romId + '?NewPlatformId=' + fixplatform[0].id + '&NewGameId=' + fixgame[0].id, 'PATCH', function (result) {
|
||||||
remapTitlesCallback();
|
remapTitlesCallback();
|
||||||
}, function (result) {
|
}, function (result) {
|
||||||
remapTitlesCallback();
|
remapTitlesCallback();
|
||||||
@@ -804,7 +804,7 @@
|
|||||||
if (rom_checks[i].checked == true) {
|
if (rom_checks[i].checked == true) {
|
||||||
var romId = rom_checks[i].getAttribute('data-romid');
|
var romId = rom_checks[i].getAttribute('data-romid');
|
||||||
remapCallCounter += 1;
|
remapCallCounter += 1;
|
||||||
ajaxCall('/api/v1/Games/' + gameId + '/roms/' + romId, 'DELETE', function (result) {
|
ajaxCall('/api/v1.0/Games/' + gameId + '/roms/' + romId, 'DELETE', function (result) {
|
||||||
remapTitlesCallback();
|
remapTitlesCallback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -846,7 +846,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Games/' + gameId + '/romgroup?PlatformId=' + platformId,
|
'/api/v1.0/Games/' + gameId + '/romgroup?PlatformId=' + platformId,
|
||||||
'POST',
|
'POST',
|
||||||
function (result) {
|
function (result) {
|
||||||
DisplayROMCheckboxes(false);
|
DisplayROMCheckboxes(false);
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
ajaxCall('/api/v1/Filter', 'GET', function (result) {
|
ajaxCall('/api/v1.0/Filter', 'GET', function (result) {
|
||||||
var filterElement = document.getElementById('games_filter');
|
var filterElement = document.getElementById('games_filter');
|
||||||
formatFilterPanel(filterElement, result);
|
formatFilterPanel(filterElement, result);
|
||||||
|
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
ajaxCall('/api/v1/Bios', 'GET', function (result) {
|
ajaxCall('/api/v1.0/Bios', 'GET', function (result) {
|
||||||
result.sort((a, b) => a.platformname.charCodeAt(0) - b.platformname.charCodeAt(0));
|
result.sort((a, b) => a.platformname.charCodeAt(0) - b.platformname.charCodeAt(0));
|
||||||
|
|
||||||
var lastPlatform = '';
|
var lastPlatform = '';
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var biosFilename = document.createElement('a');
|
var biosFilename = document.createElement('a');
|
||||||
biosFilename.href = '/api/v1/Bios/' + result[i].platformid + '/' + result[i].filename;
|
biosFilename.href = '/api/v1.0/Bios/' + result[i].platformid + '/' + result[i].filename;
|
||||||
biosFilename.innerHTML = result[i].filename;
|
biosFilename.innerHTML = result[i].filename;
|
||||||
biosFilename.className = 'romlink';
|
biosFilename.className = 'romlink';
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
availableText.className = 'greentext';
|
availableText.className = 'greentext';
|
||||||
|
|
||||||
biosFilename = document.createElement('a');
|
biosFilename = document.createElement('a');
|
||||||
biosFilename.href = '/api/v1/Bios/' + result[i].platformid + '/' + result[i].filename;
|
biosFilename.href = '/api/v1.0/Bios/' + result[i].platformid + '/' + result[i].filename;
|
||||||
biosFilename.innerHTML = result[i].filename;
|
biosFilename.innerHTML = result[i].filename;
|
||||||
biosFilename.className = 'romlink';
|
biosFilename.className = 'romlink';
|
||||||
} else {
|
} else {
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Logs' + apiQuery,
|
'/api/v1.0/Logs' + apiQuery,
|
||||||
'GET',
|
'GET',
|
||||||
function (result) {
|
function (result) {
|
||||||
var newTable = document.getElementById('settings_events_table');
|
var newTable = document.getElementById('settings_events_table');
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/PlatformMaps' + queryString,
|
'/api/v1.0/PlatformMaps' + queryString,
|
||||||
'GET',
|
'GET',
|
||||||
function (result) {
|
function (result) {
|
||||||
var newTable = document.getElementById('settings_mapping_table');
|
var newTable = document.getElementById('settings_mapping_table');
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function DownloadJSON() {
|
function DownloadJSON() {
|
||||||
window.open('/api/v1/PlatformMaps', '_blank');
|
window.open('/api/v1.0/PlatformMaps', '_blank');
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('importjson').addEventListener('click', openDialog);
|
document.getElementById('importjson').addEventListener('click', openDialog);
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#uploadjson').change(function () {
|
$('#uploadjson').change(function () {
|
||||||
$(this).simpleUpload("/api/v1/PlatformMaps", {
|
$(this).simpleUpload("/api/v1.0/PlatformMaps", {
|
||||||
start: function (file) {
|
start: function (file) {
|
||||||
//upload started
|
//upload started
|
||||||
console.log("JSON upload started");
|
console.log("JSON upload started");
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function drawLibrary() {
|
function drawLibrary() {
|
||||||
ajaxCall(
|
ajaxCall(
|
||||||
'/api/v1/Library',
|
'/api/v1.0/Library',
|
||||||
'GET',
|
'GET',
|
||||||
function (result) {
|
function (result) {
|
||||||
var newTable = document.getElementById('settings_libraries');
|
var newTable = document.getElementById('settings_libraries');
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
<div id="system_signatures"></div>
|
<div id="system_signatures"></div>
|
||||||
|
|
||||||
<script type="text/javascript">function SystemLoadStatus() {
|
<script type="text/javascript">function SystemLoadStatus() {
|
||||||
ajaxCall('/api/v1/BackgroundTasks', 'GET', function (result) {
|
ajaxCall('/api/v1.0/BackgroundTasks', 'GET', function (result) {
|
||||||
var newTable = document.createElement('table');
|
var newTable = document.createElement('table');
|
||||||
newTable.className = 'romtable';
|
newTable.className = 'romtable';
|
||||||
newTable.setAttribute('cellspacing', 0);
|
newTable.setAttribute('cellspacing', 0);
|
||||||
@@ -119,7 +119,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SystemLoadSystemStatus() {
|
function SystemLoadSystemStatus() {
|
||||||
ajaxCall('/api/v1/System', 'GET', function (result) {
|
ajaxCall('/api/v1.0/System', 'GET', function (result) {
|
||||||
if (result) {
|
if (result) {
|
||||||
var totalLibrarySpace = 0;
|
var totalLibrarySpace = 0;
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function SystemSignaturesStatus() {
|
function SystemSignaturesStatus() {
|
||||||
ajaxCall('/api/v1/Signatures/Status', 'GET', function (result) {
|
ajaxCall('/api/v1.0/Signatures/Status', 'GET', function (result) {
|
||||||
var newTable = document.createElement('table');
|
var newTable = document.createElement('table');
|
||||||
newTable.className = 'romtable';
|
newTable.className = 'romtable';
|
||||||
newTable.setAttribute('cellspacing', 0);
|
newTable.setAttribute('cellspacing', 0);
|
||||||
@@ -257,7 +257,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function StartProcess(itemType) {
|
function StartProcess(itemType) {
|
||||||
ajaxCall('/api/v1/BackgroundTasks/' + itemType + '?ForceRun=true', 'GET', function (result) {
|
ajaxCall('/api/v1.0/BackgroundTasks/' + itemType + '?ForceRun=true', 'GET', function (result) {
|
||||||
SystemLoadStatus();
|
SystemLoadStatus();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -251,7 +251,7 @@ function executeFilter() {
|
|||||||
|
|
||||||
console.log('Query string = ' + queryString);
|
console.log('Query string = ' + queryString);
|
||||||
|
|
||||||
ajaxCall('/api/v1/Games' + queryString, 'GET', function (result) {
|
ajaxCall('/api/v1.0/Games' + queryString, 'GET', function (result) {
|
||||||
var gameElement = document.getElementById('games_library');
|
var gameElement = document.getElementById('games_library');
|
||||||
formatGamesPanel(gameElement, result);
|
formatGamesPanel(gameElement, result);
|
||||||
});
|
});
|
||||||
|
@@ -20,7 +20,7 @@ function renderGameIcon(gameObject, showTitle, showRatings) {
|
|||||||
var gameImage = document.createElement('img');
|
var gameImage = document.createElement('img');
|
||||||
gameImage.className = 'game_tile_image lazy';
|
gameImage.className = 'game_tile_image lazy';
|
||||||
if (gameObject.cover) {
|
if (gameObject.cover) {
|
||||||
gameImage.setAttribute('data-src', '/api/v1/Games/' + gameObject.id + '/cover/image');
|
gameImage.setAttribute('data-src', '/api/v1.0/Games/' + gameObject.id + '/cover/image');
|
||||||
} else {
|
} else {
|
||||||
gameImage.src = '/images/unknowngame.png';
|
gameImage.src = '/images/unknowngame.png';
|
||||||
gameImage.className = 'game_tile_image unknown';
|
gameImage.className = 'game_tile_image unknown';
|
||||||
@@ -40,7 +40,7 @@ function renderGameIcon(gameObject, showTitle, showRatings) {
|
|||||||
ratingsSection.id = 'ratings_section';
|
ratingsSection.id = 'ratings_section';
|
||||||
for (var i = 0; i < gameObject.ageRatings.ids.length; i++) {
|
for (var i = 0; i < gameObject.ageRatings.ids.length; i++) {
|
||||||
var ratingImage = document.createElement('img');
|
var ratingImage = document.createElement('img');
|
||||||
ratingImage.src = '/api/v1/Games/' + gameObject.id + '/agerating/' + gameObject.ageRatings.ids[i] + '/image';
|
ratingImage.src = '/api/v1.0/Games/' + gameObject.id + '/agerating/' + gameObject.ageRatings.ids[i] + '/image';
|
||||||
ratingImage.className = 'rating_image_mini';
|
ratingImage.className = 'rating_image_mini';
|
||||||
ratingsSection.appendChild(ratingImage);
|
ratingsSection.appendChild(ratingImage);
|
||||||
}
|
}
|
||||||
|
@@ -1,35 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<RootNamespace>gaseous_tools</RootNamespace>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="gaseous.IGDB" Version="1.0.1" />
|
|
||||||
<PackageReference Include="MySqlConnector" Version="2.2.7" />
|
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Remove="Database\" />
|
|
||||||
<None Remove="Database\MySQL\" />
|
|
||||||
<None Remove="Database\MySQL\gaseous-1000.sql" />
|
|
||||||
<None Remove="Database\MySQL\gaseous-1001.sql" />
|
|
||||||
<None Remove="Database\MySQL\gaseous-1002.sql" />
|
|
||||||
<None Remove="Database\MySQL\gaseous-1003.sql" />
|
|
||||||
<None Remove="Database\MySQL\gaseous-1004.sql" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Folder Include="Database\" />
|
|
||||||
<Folder Include="Database\MySQL\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Database\MySQL\gaseous-1000.sql" />
|
|
||||||
<EmbeddedResource Include="Database\MySQL\gaseous-1001.sql" />
|
|
||||||
<EmbeddedResource Include="Database\MySQL\gaseous-1002.sql" />
|
|
||||||
<EmbeddedResource Include="Database\MySQL\gaseous-1003.sql" />
|
|
||||||
<EmbeddedResource Include="Database\MySQL\gaseous-1004.sql" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
Reference in New Issue
Block a user