Compare commits
2 Commits
main
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
![]() |
bec461259c | ||
![]() |
c615b804fa |
@@ -1,51 +0,0 @@
|
||||
name: release-tag
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
jobs:
|
||||
release-image:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_ORG: sendnrw
|
||||
DOCKER_LATEST: latest
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
- name: Set up Docker BuildX
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with: # replace it with your local IP
|
||||
config-inline: |
|
||||
[registry."git.send.nrw"]
|
||||
http = true
|
||||
insecure = true
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: git.send.nrw # replace it with your local IP
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Get Meta
|
||||
id: meta
|
||||
run: |
|
||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./build/Dockerfile
|
||||
platforms: |
|
||||
linux/amd64
|
||||
push: true
|
||||
tags: | # replace it with your local IP and tags
|
||||
git.send.nrw/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}
|
||||
git.send.nrw/${{ env.DOCKER_ORG }}/${{ steps.meta.outputs.REPO_NAME }}:${{ env.DOCKER_LATEST }}
|
61
.github/workflows/BuildNightly.yml
vendored
61
.github/workflows/BuildNightly.yml
vendored
@@ -1,61 +0,0 @@
|
||||
name: Build Nightly Docker Image
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '15 4 * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
packages: write
|
||||
contents: read
|
||||
attestations: write
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: 'true'
|
||||
- name: Install dotnet tool
|
||||
run: dotnet tool install -g dotnetCampus.TagToVersion
|
||||
- name: Set tag to version
|
||||
run: dotnet TagToVersion -t 0.0.0-nightly
|
||||
- name: Sign in to Nuget
|
||||
run: dotnet nuget add source --username michael-j-green --password ${{ secrets.NUGETKEY }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/gaseous-project/index.json"
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Login to GitHub Package Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Build and push standard image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./build/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
gaseousgames/gaseousserver:nightly
|
||||
ghcr.io/gaseous-project/gaseousserver:nightly
|
||||
- name: Build and push image with embedded mariadb
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./build/Dockerfile-EmbeddedDB
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
gaseousgames/gaseousserver:nightly-embeddeddb
|
||||
ghcr.io/gaseous-project/gaseousserver:nightly-embeddeddb
|
33
README.MD
33
README.MD
@@ -1,9 +1,17 @@
|
||||
[](https://github.com/gaseous-project/gaseous-server/actions/workflows/dotnet.yml) [](https://github.com/gaseous-project/gaseous-server/actions/workflows/BuildNightly.yml) [](https://github.com/gaseous-project/gaseous-server/actions/workflows/BuildDockerOnTag-Release.yml)
|
||||
# <img src="./logo.png" height="28" style="float: right;" /> Gaseous Server
|
||||
[](https://github.com/gaseous-project/gaseous-server/actions/workflows/dotnet.yml) [](https://github.com/gaseous-project/gaseous-server/actions/workflows/codeql.yml) [](https://github.com/gaseous-project/gaseous-server/actions/workflows/BuildDockerOnTag-Release.yml)
|
||||
# Gaseous Server
|
||||
|
||||
This is the server for the Gaseous system. It offers ROM and title management, as well as some basic in browser emulation of those ROMs.
|
||||
|
||||
Version 1.7.0 and later contain user authentication, and can be exposed to the internet. However, it is recommended to not expose the server to the internet if you're not actively using it remotely, or if you have alternative means to access it remotely like a VPN.
|
||||
## Warning
|
||||
|
||||
Versions 1.6.1 and earlier are not suitable for being exposed to the internet, as:
|
||||
1. there is no authentication support, meaning anyone could trash your library
|
||||
2. the server has not been hardened for exposure to the internet - so there maybe unknown vulnerabilities
|
||||
|
||||
If you expose one of these earlier versions of the server to the internet, **you do so at your own risk**.
|
||||
|
||||
Version 1.7.0 and later contain user authentication, and can be exposed to the internet. However, it is recommended to no expose the server to the internet if you're not actively using it remotely, or if you have alternative means to access it remotely like a VPN.
|
||||
|
||||
While we do our best to stay on top of server security, if you expose the server to the internet **you do so at your own risk**.
|
||||
|
||||
@@ -12,19 +20,15 @@ While we do our best to stay on top of server security, if you expose the server
|
||||

|
||||

|
||||
|
||||
|
||||
## Requirements
|
||||
* MariaDB 11.1.2+ (preferred) or MySQL Server 8+
|
||||
* MariaDB 11.1.2 (preferred) or MySQL Server 8+
|
||||
* These are the database versions Gaseous has been tested and developed against. Your mileage may vary with earlier versions.
|
||||
* MariaDB is the preferred database server, while MySQL will continue to be supported for existing users (they should be interchangable).
|
||||
* Note that due to the earlier database schema using MySQL specific features, moving to MariaDB from MySQL will require rebuilding your database from scratch. The "Library Scan" background task can be used to re-import all titles.
|
||||
* Internet Game Database API Key. See: https://api-docs.igdb.com/#account-creation
|
||||
|
||||
# Installation
|
||||
See https://github.com/gaseous-project/gaseous-server/wiki/Installation for installation instructions.
|
||||
|
||||
# Adding Content
|
||||
1. Import signatures: see https://github.com/gaseous-project/gaseous-server/wiki/Signatures
|
||||
2. Add ROMs: see https://github.com/gaseous-project/gaseous-server/wiki/Adding-ROMs
|
||||
If using the provided docker-compose.yml, MariaDB will be installed for you.
|
||||
|
||||
## Friends of Gaseous
|
||||
* [EmulatorJS](https://github.com/EmulatorJS/EmulatorJS): A fantastic (and fast) Javascript based implementation of RetroArch, supporting a wide variety of platforms. Discord: https://discord.gg/6akryGkETU
|
||||
@@ -39,4 +43,11 @@ The following projects are used by Gaseous
|
||||
* [EmulatorJS](https://github.com/EmulatorJS/EmulatorJS)
|
||||
|
||||
## Discord Server
|
||||
Join our Discord server: https://discord.gg/Nhu7wpT3k4
|
||||
[](https://discord.gg/Nhu7wpT3k4)
|
||||
|
||||
# Installation
|
||||
See https://github.com/gaseous-project/gaseous-server/wiki/Installation for installation instructions.
|
||||
|
||||
# Adding Content
|
||||
1. Import signatures: see https://github.com/gaseous-project/gaseous-server/wiki/Signatures
|
||||
2. Add ROMs: see https://github.com/gaseous-project/gaseous-server/wiki/Adding-ROMs
|
||||
|
@@ -5,9 +5,6 @@ echo "Creating user gaseous with UID ${PUID} and GID ${PGID}"
|
||||
groupadd -g ${PGID} gaseous
|
||||
useradd -u ${PUID} -g ${PGID} -m gaseous -d /home/gaseous -G sudo
|
||||
usermod -p "*" gaseous
|
||||
mkdir -p /home/gaseous/.aspnet
|
||||
chown -R ${PUID} /App /home/gaseous/.aspnet
|
||||
chgrp -R ${PGID} /App /home/gaseous/.aspnet
|
||||
mkdir -p /home/gaseous/.gaseous-server
|
||||
chown -R ${PUID} /App /home/gaseous/.gaseous-server
|
||||
chgrp -R ${PGID} /App /home/gaseous/.gaseous-server
|
||||
|
@@ -5,9 +5,6 @@ echo "Creating user gaseous with UID ${PUID} and GID ${PGID}"
|
||||
groupadd -g ${PGID} gaseous
|
||||
useradd -u ${PUID} -g ${PGID} -m gaseous -d /home/gaseous -G sudo
|
||||
usermod -p "*" gaseous
|
||||
mkdir -p /home/gaseous/.aspnet
|
||||
chown -R ${PUID} /App /home/gaseous/.aspnet
|
||||
chgrp -R ${PGID} /App /home/gaseous/.aspnet
|
||||
mkdir -p /home/gaseous/.gaseous-server
|
||||
chown -R ${PUID} /App /home/gaseous/.gaseous-server
|
||||
chgrp -R ${PGID} /App /home/gaseous/.gaseous-server
|
||||
|
39
docker-compose.yml
Normal file
39
docker-compose.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
version: '2'
|
||||
services:
|
||||
gaseous-server:
|
||||
container_name: gaseous-server
|
||||
image: gaseousgames/gaseousserver:latest
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- gaseous
|
||||
depends_on:
|
||||
- gsdb
|
||||
ports:
|
||||
- 5198:80
|
||||
volumes:
|
||||
- gs:/home/gaseous/.gaseous-server
|
||||
environment:
|
||||
- TZ=Australia/Sydney
|
||||
- dbhost=gsdb
|
||||
- dbuser=root
|
||||
- dbpass=gaseous
|
||||
- igdbclientid=<clientid>
|
||||
- igdbclientsecret=<clientsecret>
|
||||
gsdb:
|
||||
container_name: gsdb
|
||||
image: mariadb
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- gaseous
|
||||
volumes:
|
||||
- gsdb:/var/lib/mysql
|
||||
environment:
|
||||
- MARIADB_ROOT_PASSWORD=gaseous
|
||||
- MARIADB_USER=gaseous
|
||||
- MARIADB_PASSWORD=gaseous
|
||||
networks:
|
||||
gaseous:
|
||||
driver: bridge
|
||||
volumes:
|
||||
gs:
|
||||
gsdb:
|
@@ -4,39 +4,12 @@ using System.Security.Cryptography;
|
||||
|
||||
namespace gaseous_server.Classes
|
||||
{
|
||||
public class Bios
|
||||
{
|
||||
public Bios()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static void MigrateToNewFolderStructure()
|
||||
{
|
||||
// migrate from old BIOS file structure which had each bios file inside a folder named for the platform to the new structure which has each file in a subdirectory named after the MD5 hash
|
||||
if (Directory.Exists(Config.LibraryConfiguration.LibraryBIOSDirectory))
|
||||
{
|
||||
foreach (Models.PlatformMapping.PlatformMapItem platformMapping in Models.PlatformMapping.PlatformMap)
|
||||
{
|
||||
if (platformMapping.Bios != null)
|
||||
{
|
||||
foreach (Models.PlatformMapping.PlatformMapItem.EmulatorBiosItem emulatorBiosItem in platformMapping.Bios)
|
||||
{
|
||||
string oldBiosPath = Path.Combine(Config.LibraryConfiguration.LibraryBIOSDirectory, platformMapping.IGDBSlug.ToString(), emulatorBiosItem.filename);
|
||||
string newBiosPath = Path.Combine(Config.LibraryConfiguration.LibraryFirmwareDirectory, emulatorBiosItem.hash + ".bios");
|
||||
|
||||
if (File.Exists(oldBiosPath))
|
||||
{
|
||||
File.Copy(oldBiosPath, newBiosPath, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove old BIOS folder structure
|
||||
Directory.Delete(Config.LibraryConfiguration.LibraryBIOSDirectory, true);
|
||||
}
|
||||
}
|
||||
public class Bios
|
||||
{
|
||||
public Bios()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static Models.PlatformMapping.PlatformMapItem? BiosHashSignatureLookup(string MD5)
|
||||
{
|
||||
@@ -123,11 +96,10 @@ namespace gaseous_server.Classes
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(Config.LibraryConfiguration.LibraryFirmwareDirectory, hash + ".bios");
|
||||
return Path.Combine(Config.LibraryConfiguration.LibraryBIOSDirectory, platformslug, base.filename);
|
||||
}
|
||||
}
|
||||
public bool Available
|
||||
{
|
||||
public bool Available {
|
||||
get
|
||||
{
|
||||
bool fileExists = File.Exists(biosPath);
|
||||
|
@@ -531,7 +531,11 @@ namespace gaseous_server.Classes
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(Config.ConfigurationPath, "Data");
|
||||
return ReadSetting<string>("LibraryRootDirectory", Path.Combine(Config.ConfigurationPath, "Data"));
|
||||
}
|
||||
set
|
||||
{
|
||||
SetSetting<string>("LibraryRootDirectory", value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,14 +579,6 @@ namespace gaseous_server.Classes
|
||||
}
|
||||
}
|
||||
|
||||
public string LibraryFirmwareDirectory
|
||||
{
|
||||
get
|
||||
{
|
||||
return Path.Combine(LibraryRootDirectory, "Firmware");
|
||||
}
|
||||
}
|
||||
|
||||
public string LibraryUploadDirectory
|
||||
{
|
||||
get
|
||||
@@ -664,8 +660,7 @@ namespace gaseous_server.Classes
|
||||
{
|
||||
if (!Directory.Exists(LibraryRootDirectory)) { Directory.CreateDirectory(LibraryRootDirectory); }
|
||||
if (!Directory.Exists(LibraryImportDirectory)) { Directory.CreateDirectory(LibraryImportDirectory); }
|
||||
// if (!Directory.Exists(LibraryBIOSDirectory)) { Directory.CreateDirectory(LibraryBIOSDirectory); }
|
||||
if (!Directory.Exists(LibraryFirmwareDirectory)) { Directory.CreateDirectory(LibraryFirmwareDirectory); }
|
||||
if (!Directory.Exists(LibraryBIOSDirectory)) { Directory.CreateDirectory(LibraryBIOSDirectory); }
|
||||
if (!Directory.Exists(LibraryUploadDirectory)) { Directory.CreateDirectory(LibraryUploadDirectory); }
|
||||
if (!Directory.Exists(LibraryMetadataDirectory)) { Directory.CreateDirectory(LibraryMetadataDirectory); }
|
||||
if (!Directory.Exists(LibraryTempDirectory)) { Directory.CreateDirectory(LibraryTempDirectory); }
|
||||
|
@@ -149,6 +149,9 @@ namespace gaseous_server.Classes
|
||||
db.ExecuteNonQuery(sql, dbDict);
|
||||
} while (reader.EndOfStream == false);
|
||||
}
|
||||
|
||||
// this is a safe background task
|
||||
BackgroundUpgradeTargetSchemaVersions.Add(1023);
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
@@ -178,73 +181,6 @@ namespace gaseous_server.Classes
|
||||
};
|
||||
db.ExecuteNonQuery(sql, dbDict);
|
||||
}
|
||||
|
||||
// update all rom paths to use the new format
|
||||
sql = "SELECT * FROM GameLibraries;";
|
||||
data = db.ExecuteCMD(sql);
|
||||
foreach (DataRow row in data.Rows)
|
||||
{
|
||||
sql = "SELECT * FROM Games_Roms WHERE LibraryId = @libraryid;";
|
||||
dbDict = new Dictionary<string, object>
|
||||
{
|
||||
{ "libraryid", row["Id"] }
|
||||
};
|
||||
DataTable romData = db.ExecuteCMD(sql, dbDict);
|
||||
|
||||
string libraryRootPath = (string)row["Path"];
|
||||
if (libraryRootPath.EndsWith(Path.DirectorySeparatorChar.ToString()) == false)
|
||||
{
|
||||
libraryRootPath += Path.DirectorySeparatorChar;
|
||||
}
|
||||
|
||||
bool GetLastThreeElements = (bool)row["DefaultLibrary"];
|
||||
|
||||
foreach (DataRow romRow in romData.Rows)
|
||||
{
|
||||
string existingPath = (string)romRow["RelativePath"];
|
||||
string newPath = "";
|
||||
|
||||
if (GetLastThreeElements == true)
|
||||
{
|
||||
// strip all but the last 3 elements from existingPath separated by directory separator
|
||||
// this mode only works for the default library
|
||||
string[] pathParts = existingPath.Split(Path.DirectorySeparatorChar);
|
||||
if (pathParts.Length > 3)
|
||||
{
|
||||
newPath = Path.Combine(pathParts[pathParts.Length - 3], pathParts[pathParts.Length - 2], pathParts[pathParts.Length - 1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
newPath = existingPath;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// strip the library root path from the existing path
|
||||
if (existingPath.StartsWith(libraryRootPath))
|
||||
{
|
||||
newPath = existingPath.Substring(libraryRootPath.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
newPath = existingPath;
|
||||
}
|
||||
}
|
||||
|
||||
Logging.Log(Logging.LogType.Information, "Database Upgrade", "Updating ROM path from " + existingPath + " to " + newPath);
|
||||
|
||||
sql = "UPDATE Games_Roms SET RelativePath = @newpath WHERE Id = @id;";
|
||||
dbDict = new Dictionary<string, object>
|
||||
{
|
||||
{ "newpath", newPath },
|
||||
{ "id", romRow["Id"] }
|
||||
};
|
||||
db.ExecuteNonQuery(sql, dbDict);
|
||||
}
|
||||
}
|
||||
|
||||
// migrating metadata is a safe background task
|
||||
BackgroundUpgradeTargetSchemaVersions.Add(1024);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -261,8 +197,8 @@ namespace gaseous_server.Classes
|
||||
MySql_1002_MigrateMetadataVersion();
|
||||
break;
|
||||
|
||||
case 1024:
|
||||
MySql_1024_MigrateMetadataVersion();
|
||||
case 1023:
|
||||
MySql_1023_MigrateMetadataVersion();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -365,12 +301,12 @@ namespace gaseous_server.Classes
|
||||
}
|
||||
}
|
||||
|
||||
public static void MySql_1024_MigrateMetadataVersion()
|
||||
public static void MySql_1023_MigrateMetadataVersion()
|
||||
{
|
||||
FileSignature fileSignature = new FileSignature();
|
||||
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "SELECT * FROM view_Games_Roms WHERE RomDataVersion = 1;";
|
||||
string sql = "SELECT * FROM Games_Roms WHERE RomDataVersion = 1;";
|
||||
DataTable data = db.ExecuteCMD(sql);
|
||||
long count = 1;
|
||||
foreach (DataRow row in data.Rows)
|
||||
|
@@ -24,7 +24,7 @@ namespace gaseous_server.Classes
|
||||
ageRestriction_Generic += " OR view_Games.AgeGroupId IS NULL";
|
||||
}
|
||||
|
||||
string sql = "SELECT Platform.Id, Platform.`Name`, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT Game.Id, view_Games_Roms.PlatformId, COUNT(view_Games_Roms.Id) AS RomCount FROM Game LEFT JOIN AgeGroup ON Game.Id = AgeGroup.GameId LEFT JOIN view_Games_Roms ON Game.Id = view_Games_Roms.GameId WHERE (" + ageRestriction_Platform + ") GROUP BY Game.Id , view_Games_Roms.PlatformId HAVING RomCount > 0) Game JOIN Platform ON Game.PlatformId = Platform.Id GROUP BY Platform.`Name`;";
|
||||
string sql = "SELECT Platform.Id, Platform.`Name`, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT Game.Id, Games_Roms.PlatformId, COUNT(Games_Roms.Id) AS RomCount FROM Game LEFT JOIN AgeGroup ON Game.Id = AgeGroup.GameId LEFT JOIN Games_Roms ON Game.Id = Games_Roms.GameId WHERE (" + ageRestriction_Platform + ") GROUP BY Game.Id , Games_Roms.PlatformId HAVING RomCount > 0) Game JOIN Platform ON Game.PlatformId = Platform.Id GROUP BY Platform.`Name`;";
|
||||
|
||||
DataTable dbResponse = db.ExecuteCMD(sql, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 300));
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace gaseous_server.Classes
|
||||
|
||||
// age groups
|
||||
List<FilterItem> agegroupings = new List<FilterItem>();
|
||||
sql = "SELECT Game.AgeGroupId, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT Game.Id, AgeGroup.AgeGroupId, COUNT(view_Games_Roms.Id) AS RomCount FROM Game LEFT JOIN AgeGroup ON Game.Id = AgeGroup.GameId LEFT JOIN view_Games_Roms ON Game.Id = view_Games_Roms.GameId WHERE (" + ageRestriction_Platform + ") GROUP BY Game.Id HAVING RomCount > 0) Game GROUP BY Game.AgeGroupId ORDER BY Game.AgeGroupId DESC";
|
||||
sql = "SELECT Game.AgeGroupId, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT Game.Id, AgeGroup.AgeGroupId, COUNT(Games_Roms.Id) AS RomCount FROM Game LEFT JOIN AgeGroup ON Game.Id = AgeGroup.GameId LEFT JOIN Games_Roms ON Game.Id = Games_Roms.GameId WHERE (" + ageRestriction_Platform + ") GROUP BY Game.Id HAVING RomCount > 0) Game GROUP BY Game.AgeGroupId ORDER BY Game.AgeGroupId DESC";
|
||||
dbResponse = db.ExecuteCMD(sql, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 300));
|
||||
|
||||
foreach (DataRow dr in dbResponse.Rows)
|
||||
@@ -112,7 +112,7 @@ namespace gaseous_server.Classes
|
||||
{
|
||||
//string sql = "SELECT DISTINCT <ITEMNAME>.Id, <ITEMNAME>.`Name`, COUNT(view_Games.Id) AS GameCount FROM <ITEMNAME> LEFT JOIN Relation_Game_<ITEMNAME>s ON Relation_Game_<ITEMNAME>s.<ITEMNAME>sId = <ITEMNAME>.Id LEFT JOIN view_Games ON view_Games.Id = Relation_Game_<ITEMNAME>s.GameId WHERE (" + AgeRestriction_Generic + ") GROUP BY <ITEMNAME>.Id HAVING GameCount > 0 ORDER BY <ITEMNAME>.`Name`;";
|
||||
|
||||
string sql = "SELECT <ITEMNAME>.Id, <ITEMNAME>.`Name`, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT Game.Id, AgeGroup.AgeGroupId, COUNT(view_Games_Roms.Id) AS RomCount FROM Game LEFT JOIN AgeGroup ON Game.Id = AgeGroup.GameId LEFT JOIN view_Games_Roms ON Game.Id = view_Games_Roms.GameId WHERE (" + AgeRestriction + ") GROUP BY Game.Id HAVING RomCount > 0) Game JOIN Relation_Game_<ITEMNAME>s ON Game.Id = Relation_Game_<ITEMNAME>s.GameId JOIN <ITEMNAME> ON Relation_Game_<ITEMNAME>s.<ITEMNAME>sId = <ITEMNAME>.Id GROUP BY <ITEMNAME>.`Name` ORDER BY <ITEMNAME>.`Name`;";
|
||||
string sql = "SELECT <ITEMNAME>.Id, <ITEMNAME>.`Name`, COUNT(Game.Id) AS GameCount FROM (SELECT DISTINCT Game.Id, AgeGroup.AgeGroupId, COUNT(Games_Roms.Id) AS RomCount FROM Game LEFT JOIN AgeGroup ON Game.Id = AgeGroup.GameId LEFT JOIN Games_Roms ON Game.Id = Games_Roms.GameId WHERE (" + AgeRestriction + ") GROUP BY Game.Id HAVING RomCount > 0) Game JOIN Relation_Game_<ITEMNAME>s ON Game.Id = Relation_Game_<ITEMNAME>s.GameId JOIN <ITEMNAME> ON Relation_Game_<ITEMNAME>s.<ITEMNAME>sId = <ITEMNAME>.Id GROUP BY <ITEMNAME>.`Name` ORDER BY <ITEMNAME>.`Name`;";
|
||||
sql = sql.Replace("<ITEMNAME>", Name);
|
||||
DataTable dbResponse = db.ExecuteCMD(sql, new Database.DatabaseMemoryCacheOptions(CacheEnabled: true, ExpirationSeconds: 300));
|
||||
|
||||
|
@@ -60,18 +60,6 @@ namespace gaseous_server
|
||||
}
|
||||
}
|
||||
|
||||
// update default library path
|
||||
public static void UpdateDefaultLibraryPath()
|
||||
{
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "UPDATE GameLibraries SET Path=@path WHERE DefaultLibrary=1;";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>
|
||||
{
|
||||
{ "path", Path.Combine(Config.LibraryConfiguration.LibraryRootDirectory, "Library") }
|
||||
};
|
||||
db.ExecuteCMD(sql, dbDict);
|
||||
}
|
||||
|
||||
public static List<LibraryItem> GetLibraries
|
||||
{
|
||||
get
|
||||
|
@@ -73,7 +73,7 @@ namespace gaseous_server.Classes
|
||||
RetVal.Add("type", "rom");
|
||||
|
||||
// check to make sure we don't already have this file imported
|
||||
sql = "SELECT COUNT(Id) AS count FROM view_Games_Roms WHERE MD5=@md5 AND SHA1=@sha1";
|
||||
sql = "SELECT COUNT(Id) AS count FROM Games_Roms WHERE MD5=@md5 AND SHA1=@sha1";
|
||||
dbDict.Add("md5", hash.md5hash);
|
||||
dbDict.Add("sha1", hash.sha1hash);
|
||||
DataTable importDB = db.ExecuteCMD(sql, dbDict);
|
||||
@@ -129,7 +129,7 @@ namespace gaseous_server.Classes
|
||||
IGDB.Models.Game determinedGame = SearchForGame(discoveredSignature, discoveredSignature.Flags.IGDBPlatformId, true);
|
||||
|
||||
// add to database
|
||||
long RomId = StoreROM(GameLibrary.GetDefaultLibrary, hash, determinedGame, determinedPlatform, discoveredSignature, GameFileImportPath, 0, true);
|
||||
long RomId = StoreROM(GameLibrary.GetDefaultLibrary, hash, determinedGame, determinedPlatform, discoveredSignature, GameFileImportPath);
|
||||
|
||||
// build return value
|
||||
RetVal.Add("romid", RomId);
|
||||
@@ -151,8 +151,11 @@ namespace gaseous_server.Classes
|
||||
{
|
||||
if (biosItem.hash == hash.md5hash)
|
||||
{
|
||||
string biosPath = Path.Combine(Config.LibraryConfiguration.LibraryFirmwareDirectory, biosItem.hash + ".bios");
|
||||
Logging.Log(Logging.LogType.Information, "Import Game", " " + GameFileImportPath + " is a BIOS file - moving to " + biosPath);
|
||||
string biosPath = biosItem.biosPath.Replace(biosItem.filename, "");
|
||||
if (!Directory.Exists(biosPath))
|
||||
{
|
||||
Directory.CreateDirectory(biosPath);
|
||||
}
|
||||
|
||||
File.Move(GameFileImportPath, biosItem.biosPath, true);
|
||||
|
||||
@@ -326,7 +329,7 @@ namespace gaseous_server.Classes
|
||||
return SearchCandidates;
|
||||
}
|
||||
|
||||
public static long StoreROM(GameLibrary.LibraryItem library, Common.hashObject hash, IGDB.Models.Game determinedGame, IGDB.Models.Platform determinedPlatform, gaseous_server.Models.Signatures_Games discoveredSignature, string GameFileImportPath, long UpdateId = 0, bool SourceIsExternal = false)
|
||||
public static long StoreROM(GameLibrary.LibraryItem library, Common.hashObject hash, IGDB.Models.Game determinedGame, IGDB.Models.Platform determinedPlatform, gaseous_server.Models.Signatures_Games discoveredSignature, string GameFileImportPath, long UpdateId = 0)
|
||||
{
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
|
||||
@@ -336,7 +339,7 @@ namespace gaseous_server.Classes
|
||||
|
||||
if (UpdateId == 0)
|
||||
{
|
||||
sql = "INSERT INTO Games_Roms (PlatformId, GameId, Name, Size, CRC, MD5, SHA1, DevelopmentStatus, Attributes, RomType, RomTypeMedia, MediaLabel, RelativePath, MetadataSource, MetadataGameName, MetadataVersion, LibraryId, RomDataVersion) VALUES (@platformid, @gameid, @name, @size, @crc, @md5, @sha1, @developmentstatus, @Attributes, @romtype, @romtypemedia, @medialabel, @path, @metadatasource, @metadatagamename, @metadataversion, @libraryid, @romdataversion); SELECT CAST(LAST_INSERT_ID() AS SIGNED);";
|
||||
sql = "INSERT INTO Games_Roms (PlatformId, GameId, Name, Size, CRC, MD5, SHA1, DevelopmentStatus, Attributes, RomType, RomTypeMedia, MediaLabel, Path, MetadataSource, MetadataGameName, MetadataVersion, LibraryId, RomDataVersion) VALUES (@platformid, @gameid, @name, @size, @crc, @md5, @sha1, @developmentstatus, @Attributes, @romtype, @romtypemedia, @medialabel, @path, @metadatasource, @metadatagamename, @metadataversion, @libraryid, @romdataversion); SELECT CAST(LAST_INSERT_ID() AS SIGNED);";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -375,13 +378,7 @@ namespace gaseous_server.Classes
|
||||
dbDict.Add("romtype", (int)discoveredSignature.Rom.RomType);
|
||||
dbDict.Add("romtypemedia", Common.ReturnValueIfNull(discoveredSignature.Rom.RomTypeMedia, ""));
|
||||
dbDict.Add("medialabel", Common.ReturnValueIfNull(discoveredSignature.Rom.MediaLabel, ""));
|
||||
|
||||
string libraryRootPath = library.Path;
|
||||
if (libraryRootPath.EndsWith(Path.DirectorySeparatorChar.ToString()) == false)
|
||||
{
|
||||
libraryRootPath += Path.DirectorySeparatorChar;
|
||||
}
|
||||
dbDict.Add("path", GameFileImportPath.Replace(libraryRootPath, ""));
|
||||
dbDict.Add("path", GameFileImportPath);
|
||||
|
||||
DataTable romInsert = db.ExecuteCMD(sql, dbDict);
|
||||
long romId = 0;
|
||||
@@ -397,7 +394,7 @@ namespace gaseous_server.Classes
|
||||
// move to destination
|
||||
if (library.IsDefaultLibrary == true)
|
||||
{
|
||||
MoveGameFile(romId, SourceIsExternal);
|
||||
MoveGameFile(romId);
|
||||
}
|
||||
|
||||
return romId;
|
||||
@@ -433,14 +430,10 @@ namespace gaseous_server.Classes
|
||||
return DestinationPathName;
|
||||
}
|
||||
|
||||
public static bool MoveGameFile(long RomId, bool SourceIsExternal)
|
||||
public static bool MoveGameFile(long RomId)
|
||||
{
|
||||
Classes.Roms.GameRomItem rom = Classes.Roms.GetRom(RomId);
|
||||
string romPath = rom.Path;
|
||||
if (SourceIsExternal == true)
|
||||
{
|
||||
romPath = rom.RelativePath;
|
||||
}
|
||||
|
||||
if (File.Exists(romPath))
|
||||
{
|
||||
@@ -465,16 +458,10 @@ namespace gaseous_server.Classes
|
||||
|
||||
// update the db
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "UPDATE Games_Roms SET RelativePath=@path WHERE Id=@id";
|
||||
string sql = "UPDATE Games_Roms SET Path=@path WHERE Id=@id";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||
dbDict.Add("id", RomId);
|
||||
|
||||
string libraryRootPath = rom.Library.Path;
|
||||
if (libraryRootPath.EndsWith(Path.DirectorySeparatorChar.ToString()) == false)
|
||||
{
|
||||
libraryRootPath += Path.DirectorySeparatorChar;
|
||||
}
|
||||
dbDict.Add("path", DestinationPath.Replace(libraryRootPath, ""));
|
||||
dbDict.Add("path", DestinationPath);
|
||||
db.ExecuteCMD(sql, dbDict);
|
||||
|
||||
return true;
|
||||
@@ -496,7 +483,7 @@ namespace gaseous_server.Classes
|
||||
|
||||
// move rom files to their new location
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "SELECT * FROM view_Games_Roms WHERE LibraryId = @libraryid";
|
||||
string sql = "SELECT * FROM Games_Roms WHERE LibraryId = @libraryid";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||
dbDict.Add("libraryid", library.Id);
|
||||
DataTable romDT = db.ExecuteCMD(sql, dbDict);
|
||||
@@ -508,7 +495,7 @@ namespace gaseous_server.Classes
|
||||
SetStatus(i, romDT.Rows.Count, "Processing file " + romDT.Rows[i]["name"]);
|
||||
Logging.Log(Logging.LogType.Information, "Organise Library", "(" + i + "/" + romDT.Rows.Count + ") Processing ROM " + romDT.Rows[i]["name"]);
|
||||
long RomId = (long)romDT.Rows[i]["id"];
|
||||
MoveGameFile(RomId, false);
|
||||
MoveGameFile(RomId);
|
||||
}
|
||||
}
|
||||
ClearStatus();
|
||||
@@ -652,7 +639,7 @@ namespace gaseous_server.Classes
|
||||
dupDict.Add("libraryid", library.Id);
|
||||
db.ExecuteCMD(duplicateSql, dupDict);
|
||||
|
||||
string sql = "SELECT * FROM view_Games_Roms WHERE LibraryId=@libraryid ORDER BY `name`";
|
||||
string sql = "SELECT * FROM Games_Roms WHERE LibraryId=@libraryid ORDER BY `name`";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||
dbDict.Add("libraryid", library.Id);
|
||||
DataTable dtRoms = db.ExecuteCMD(sql, dbDict);
|
||||
@@ -677,7 +664,7 @@ namespace gaseous_server.Classes
|
||||
}
|
||||
}
|
||||
|
||||
sql = "SELECT * FROM view_Games_Roms WHERE LibraryId=@libraryid ORDER BY `name`";
|
||||
sql = "SELECT * FROM Games_Roms WHERE LibraryId=@libraryid ORDER BY `name`";
|
||||
dtRoms = db.ExecuteCMD(sql, dbDict);
|
||||
|
||||
// search for files in the library that aren't in the database
|
||||
@@ -749,7 +736,7 @@ namespace gaseous_server.Classes
|
||||
}
|
||||
ClearStatus();
|
||||
|
||||
sql = "SELECT * FROM view_Games_Roms WHERE LibraryId=@libraryid ORDER BY `name`";
|
||||
sql = "SELECT * FROM Games_Roms WHERE LibraryId=@libraryid ORDER BY `name`";
|
||||
dtRoms = db.ExecuteCMD(sql, dbDict);
|
||||
|
||||
// check all roms to see if their local file still exists
|
||||
@@ -773,7 +760,7 @@ namespace gaseous_server.Classes
|
||||
if (romPath != ComputeROMPath(romId))
|
||||
{
|
||||
Logging.Log(Logging.LogType.Information, "Library Scan", "ROM at path " + romPath + " found, but needs to be moved");
|
||||
MoveGameFile(romId, false);
|
||||
MoveGameFile(romId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -814,11 +801,11 @@ namespace gaseous_server.Classes
|
||||
string sql = "";
|
||||
if (ForceExecute == false)
|
||||
{
|
||||
sql = "SELECT * FROM view_Games_Roms WHERE (PlatformId = 0 AND GameId <> 0) OR (((PlatformId = 0 OR GameId = 0) AND MetadataSource = 0) OR (PlatformId = 0 AND GameId = 0)) AND (LastMatchAttemptDate IS NULL OR LastMatchAttemptDate < @lastmatchattemptdate) AND LibraryId = @libraryid LIMIT 100;";
|
||||
sql = "SELECT * FROM Games_Roms WHERE (PlatformId = 0 AND GameId <> 0) OR (((PlatformId = 0 OR GameId = 0) AND MetadataSource = 0) OR (PlatformId = 0 AND GameId = 0)) AND (LastMatchAttemptDate IS NULL OR LastMatchAttemptDate < @lastmatchattemptdate) AND LibraryId = @libraryid LIMIT 100;";
|
||||
}
|
||||
else
|
||||
{
|
||||
sql = "SELECT * FROM view_Games_Roms WHERE (PlatformId = 0 AND GameId <> 0) OR (((PlatformId = 0 OR GameId = 0) AND MetadataSource = 0) OR (PlatformId = 0 AND GameId = 0)) AND LibraryId = @libraryid;";
|
||||
sql = "SELECT * FROM Games_Roms WHERE (PlatformId = 0 AND GameId <> 0) OR (((PlatformId = 0 OR GameId = 0) AND MetadataSource = 0) OR (PlatformId = 0 AND GameId = 0)) AND LibraryId = @libraryid;";
|
||||
}
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||
dbDict.Add("lastmatchattemptdate", DateTime.UtcNow.AddDays(-7));
|
||||
|
@@ -510,8 +510,8 @@ namespace gaseous_server.Classes.Metadata
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = @"
|
||||
SELECT DISTINCT
|
||||
view_Games_Roms.GameId,
|
||||
view_Games_Roms.PlatformId,
|
||||
Games_Roms.GameId,
|
||||
Games_Roms.PlatformId,
|
||||
Platform.`Name`,
|
||||
User_RecentPlayedRoms.UserId AS MostRecentUserId,
|
||||
User_RecentPlayedRoms.RomId AS MostRecentRomId,
|
||||
@@ -530,23 +530,23 @@ SELECT DISTINCT
|
||||
END AS `FavouriteRomName`,
|
||||
User_GameFavouriteRoms.IsMediaGroup AS FavouriteRomIsMediaGroup
|
||||
FROM
|
||||
view_Games_Roms
|
||||
Games_Roms
|
||||
LEFT JOIN
|
||||
Platform ON view_Games_Roms.PlatformId = Platform.Id
|
||||
Platform ON Games_Roms.PlatformId = Platform.Id
|
||||
LEFT JOIN
|
||||
User_RecentPlayedRoms ON User_RecentPlayedRoms.UserId = @userid
|
||||
AND User_RecentPlayedRoms.GameId = view_Games_Roms.GameId
|
||||
AND User_RecentPlayedRoms.PlatformId = view_Games_Roms.PlatformId
|
||||
AND User_RecentPlayedRoms.GameId = Games_Roms.GameId
|
||||
AND User_RecentPlayedRoms.PlatformId = Games_Roms.PlatformId
|
||||
LEFT JOIN
|
||||
User_GameFavouriteRoms ON User_GameFavouriteRoms.UserId = @userid
|
||||
AND User_GameFavouriteRoms.GameId = view_Games_Roms.GameId
|
||||
AND User_GameFavouriteRoms.PlatformId = view_Games_Roms.PlatformId
|
||||
AND User_GameFavouriteRoms.GameId = Games_Roms.GameId
|
||||
AND User_GameFavouriteRoms.PlatformId = Games_Roms.PlatformId
|
||||
LEFT JOIN
|
||||
view_Games_Roms AS GMR ON GMR.Id = User_RecentPlayedRoms.RomId
|
||||
Games_Roms AS GMR ON GMR.Id = User_RecentPlayedRoms.RomId
|
||||
LEFT JOIN
|
||||
view_Games_Roms AS GFV ON GFV.Id = User_GameFavouriteRoms.RomId
|
||||
Games_Roms AS GFV ON GFV.Id = User_GameFavouriteRoms.RomId
|
||||
WHERE
|
||||
view_Games_Roms.GameId = @gameid
|
||||
Games_Roms.GameId = @gameid
|
||||
ORDER BY Platform.`Name`;";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>
|
||||
{
|
||||
@@ -583,10 +583,7 @@ ORDER BY Platform.`Name`;";
|
||||
{
|
||||
LastPlayedRomId = (long?)row["MostRecentRomId"];
|
||||
LastPlayedIsMediagroup = (bool)row["MostRecentRomIsMediaGroup"];
|
||||
if (row["MostRecentRomName"] != System.DBNull.Value)
|
||||
{
|
||||
LastPlayedRomName = string.IsNullOrEmpty((string?)row["MostRecentRomName"]) ? "" : (string)row["MostRecentRomName"];
|
||||
}
|
||||
LastPlayedRomName = (string)row["MostRecentRomName"];
|
||||
}
|
||||
|
||||
long? FavouriteRomId = null;
|
||||
@@ -596,10 +593,7 @@ ORDER BY Platform.`Name`;";
|
||||
{
|
||||
FavouriteRomId = (long?)row["FavouriteRomId"];
|
||||
FavouriteRomIsMediagroup = (bool)row["FavouriteRomIsMediaGroup"];
|
||||
if (row["MostRecentRomName"] != System.DBNull.Value)
|
||||
{
|
||||
FavouriteRomName = string.IsNullOrEmpty((string?)row["MostRecentRomName"]) ? "" : (string)row["MostRecentRomName"];
|
||||
}
|
||||
FavouriteRomName = (string)row["FavouriteRomName"];
|
||||
}
|
||||
|
||||
AvailablePlatformItem valuePair = new AvailablePlatformItem
|
||||
|
@@ -39,7 +39,7 @@ namespace gaseous_server.Classes
|
||||
string NameSearchWhere = "";
|
||||
if (NameSearch.Length > 0)
|
||||
{
|
||||
NameSearchWhere = " AND view_Games_Roms.`Name` LIKE @namesearch";
|
||||
NameSearchWhere = " AND Games_Roms.`Name` LIKE @namesearch";
|
||||
dbDict.Add("namesearch", '%' + NameSearch + '%');
|
||||
}
|
||||
|
||||
@@ -51,37 +51,37 @@ namespace gaseous_server.Classes
|
||||
UserJoin = @"
|
||||
LEFT JOIN
|
||||
User_RecentPlayedRoms ON User_RecentPlayedRoms.UserId = @userid
|
||||
AND User_RecentPlayedRoms.GameId = view_Games_Roms.GameId
|
||||
AND User_RecentPlayedRoms.PlatformId = view_Games_Roms.PlatformId
|
||||
AND User_RecentPlayedRoms.RomId = view_Games_Roms.Id
|
||||
AND User_RecentPlayedRoms.GameId = Games_Roms.GameId
|
||||
AND User_RecentPlayedRoms.PlatformId = Games_Roms.PlatformId
|
||||
AND User_RecentPlayedRoms.RomId = Games_Roms.Id
|
||||
AND User_RecentPlayedRoms.IsMediaGroup = 0
|
||||
LEFT JOIN
|
||||
User_GameFavouriteRoms ON User_GameFavouriteRoms.UserId = @userid
|
||||
AND User_GameFavouriteRoms.GameId = view_Games_Roms.GameId
|
||||
AND User_GameFavouriteRoms.PlatformId = view_Games_Roms.PlatformId
|
||||
AND User_GameFavouriteRoms.RomId = view_Games_Roms.Id
|
||||
AND User_GameFavouriteRoms.GameId = Games_Roms.GameId
|
||||
AND User_GameFavouriteRoms.PlatformId = Games_Roms.PlatformId
|
||||
AND User_GameFavouriteRoms.RomId = Games_Roms.Id
|
||||
AND User_GameFavouriteRoms.IsMediaGroup = 0
|
||||
";
|
||||
}
|
||||
|
||||
// platform query
|
||||
sqlPlatform = "SELECT DISTINCT view_Games_Roms.PlatformId, Platform.`Name` FROM view_Games_Roms LEFT JOIN Platform ON view_Games_Roms.PlatformId = Platform.Id WHERE GameId = @id ORDER BY Platform.`Name`;";
|
||||
sqlPlatform = "SELECT DISTINCT Games_Roms.PlatformId, Platform.`Name` FROM Games_Roms LEFT JOIN Platform ON Games_Roms.PlatformId = Platform.Id WHERE GameId = @id ORDER BY Platform.`Name`;";
|
||||
|
||||
if (PlatformId == -1)
|
||||
{
|
||||
// data query
|
||||
sql = "SELECT DISTINCT view_Games_Roms.*, Platform.`Name` AS platformname, Game.`Name` AS gamename, GameState.RomId AS SavedStateRomId" + UserFields + " FROM view_Games_Roms LEFT JOIN Platform ON view_Games_Roms.PlatformId = Platform.Id LEFT JOIN Game ON view_Games_Roms.GameId = Game.Id LEFT JOIN GameState ON (view_Games_Roms.Id = GameState.RomId AND GameState.UserId = @userid AND GameState.IsMediaGroup = 0) " + UserJoin + " WHERE view_Games_Roms.GameId = @id" + NameSearchWhere + " ORDER BY Platform.`Name`, view_Games_Roms.`Name` LIMIT 1000;";
|
||||
sql = "SELECT DISTINCT Games_Roms.*, Platform.`Name` AS platformname, Game.`Name` AS gamename, GameState.RomId AS SavedStateRomId" + UserFields + " FROM Games_Roms LEFT JOIN Platform ON Games_Roms.PlatformId = Platform.Id LEFT JOIN Game ON Games_Roms.GameId = Game.Id LEFT JOIN GameState ON (Games_Roms.Id = GameState.RomId AND GameState.UserId = @userid AND GameState.IsMediaGroup = 0) " + UserJoin + " WHERE Games_Roms.GameId = @id" + NameSearchWhere + " ORDER BY Platform.`Name`, Games_Roms.`Name` LIMIT 1000;";
|
||||
|
||||
// count query
|
||||
sqlCount = "SELECT COUNT(view_Games_Roms.Id) AS RomCount FROM view_Games_Roms WHERE view_Games_Roms.GameId = @id" + NameSearchWhere + ";";
|
||||
sqlCount = "SELECT COUNT(Games_Roms.Id) AS RomCount FROM Games_Roms WHERE Games_Roms.GameId = @id" + NameSearchWhere + ";";
|
||||
}
|
||||
else
|
||||
{
|
||||
// data query
|
||||
sql = "SELECT DISTINCT view_Games_Roms.*, Platform.`Name` AS platformname, Game.`Name` AS gamename, GameState.RomId AS SavedStateRomId" + UserFields + " FROM view_Games_Roms LEFT JOIN Platform ON view_Games_Roms.PlatformId = Platform.Id LEFT JOIN Game ON view_Games_Roms.GameId = Game.Id LEFT JOIN GameState ON (view_Games_Roms.Id = GameState.RomId AND GameState.UserId = @userid AND GameState.IsMediaGroup = 0) " + UserJoin + " WHERE view_Games_Roms.GameId = @id AND view_Games_Roms.PlatformId = @platformid" + NameSearchWhere + " ORDER BY Platform.`Name`, view_Games_Roms.`Name` LIMIT 1000;";
|
||||
sql = "SELECT DISTINCT Games_Roms.*, Platform.`Name` AS platformname, Game.`Name` AS gamename, GameState.RomId AS SavedStateRomId" + UserFields + " FROM Games_Roms LEFT JOIN Platform ON Games_Roms.PlatformId = Platform.Id LEFT JOIN Game ON Games_Roms.GameId = Game.Id LEFT JOIN GameState ON (Games_Roms.Id = GameState.RomId AND GameState.UserId = @userid AND GameState.IsMediaGroup = 0) " + UserJoin + " WHERE Games_Roms.GameId = @id AND Games_Roms.PlatformId = @platformid" + NameSearchWhere + " ORDER BY Platform.`Name`, Games_Roms.`Name` LIMIT 1000;";
|
||||
|
||||
// count query
|
||||
sqlCount = "SELECT COUNT(view_Games_Roms.Id) AS RomCount FROM view_Games_Roms WHERE view_Games_Roms.GameId = @id AND view_Games_Roms.PlatformId = @platformid" + NameSearchWhere + ";";
|
||||
sqlCount = "SELECT COUNT(Games_Roms.Id) AS RomCount FROM Games_Roms WHERE Games_Roms.GameId = @id AND Games_Roms.PlatformId = @platformid" + NameSearchWhere + ";";
|
||||
|
||||
dbDict.Add("platformid", PlatformId);
|
||||
}
|
||||
@@ -114,7 +114,7 @@ namespace gaseous_server.Classes
|
||||
public static GameRomItem GetRom(long RomId)
|
||||
{
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "SELECT view_Games_Roms.*, Platform.`Name` AS platformname, Game.`Name` AS gamename FROM view_Games_Roms LEFT JOIN Platform ON view_Games_Roms.PlatformId = Platform.Id LEFT JOIN Game ON view_Games_Roms.GameId = Game.Id WHERE view_Games_Roms.Id = @id";
|
||||
string sql = "SELECT Games_Roms.*, Platform.`Name` AS platformname, Game.`Name` AS gamename FROM Games_Roms LEFT JOIN Platform ON Games_Roms.PlatformId = Platform.Id LEFT JOIN Game ON Games_Roms.GameId = Game.Id WHERE Games_Roms.Id = @id";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||
dbDict.Add("id", RomId);
|
||||
DataTable romDT = db.ExecuteCMD(sql, dbDict);
|
||||
@@ -134,7 +134,7 @@ namespace gaseous_server.Classes
|
||||
public static GameRomItem GetRom(string MD5)
|
||||
{
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "SELECT view_Games_Roms.*, Platform.`Name` AS platformname, Game.`Name` AS gamename FROM view_Games_Roms LEFT JOIN Platform ON view_Games_Roms.PlatformId = Platform.Id LEFT JOIN Game ON view_Games_Roms.GameId = Game.Id WHERE view_Games_Roms.MD5 = @id";
|
||||
string sql = "SELECT Games_Roms.*, Platform.`Name` AS platformname, Game.`Name` AS gamename FROM Games_Roms LEFT JOIN Platform ON Games_Roms.PlatformId = Platform.Id LEFT JOIN Game ON Games_Roms.GameId = Game.Id WHERE Games_Roms.MD5 = @id";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>();
|
||||
dbDict.Add("id", MD5);
|
||||
DataTable romDT = db.ExecuteCMD(sql, dbDict);
|
||||
@@ -282,7 +282,6 @@ namespace gaseous_server.Classes
|
||||
RomTypeMedia = (string)romDR["romtypemedia"],
|
||||
MediaLabel = (string)romDR["medialabel"],
|
||||
Path = (string)romDR["path"],
|
||||
RelativePath = (string)romDR["relativepath"],
|
||||
SignatureSource = (gaseous_server.Models.Signatures_Games.RomItem.SignatureSourceType)(Int32)romDR["metadatasource"],
|
||||
SignatureSourceGameTitle = (string)Common.ReturnValueIfNull(romDR["MetadataGameName"], ""),
|
||||
HasSaveStates = hasSaveStates,
|
||||
@@ -323,7 +322,6 @@ namespace gaseous_server.Classes
|
||||
public long GameId { get; set; }
|
||||
public string Game { get; set; }
|
||||
public string? Path { get; set; }
|
||||
public string? RelativePath { get; set; }
|
||||
public string? SignatureSourceGameTitle { get; set; }
|
||||
public bool HasSaveStates { get; set; } = false;
|
||||
public GameLibrary.LibraryItem Library { get; set; }
|
||||
|
@@ -1,6 +1,4 @@
|
||||
using System.Data;
|
||||
using gaseous_server.Classes.Metadata;
|
||||
using IGDB.Models;
|
||||
|
||||
namespace gaseous_server.Classes
|
||||
{
|
||||
@@ -17,9 +15,8 @@ namespace gaseous_server.Classes
|
||||
|
||||
public Models.UserProfile? GetUserProfile(string UserId)
|
||||
{
|
||||
// build the user profile object
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "SELECT Id, UserId, DisplayName, Quip, AvatarExtension, ProfileBackgroundExtension, UnstructuredData FROM UserProfiles WHERE Id = @userid;";
|
||||
string sql = "SELECT Id, DisplayName, Quip, AvatarExtension, ProfileBackgroundExtension, UnstructuredData FROM UserProfiles WHERE Id = @userid;";
|
||||
Dictionary<string, object> dbDict = new Dictionary<string, object>{
|
||||
{ "userid", UserId }
|
||||
};
|
||||
@@ -51,24 +48,6 @@ namespace gaseous_server.Classes
|
||||
};
|
||||
}
|
||||
|
||||
// get now playing game - if available
|
||||
Models.UserProfile.NowPlayingItem? NowPlaying = null;
|
||||
sql = "SELECT * FROM `view_UserTimeTracking` WHERE UserId = @userid AND UTC_TIMESTAMP() BETWEEN SessionTime AND DATE_ADD(SessionEnd, INTERVAL 2 MINUTE) ORDER BY SessionEnd DESC LIMIT 1;";
|
||||
dbDict = new Dictionary<string, object>{
|
||||
{ "userid", data.Rows[0]["UserId"].ToString() }
|
||||
};
|
||||
DataTable nowPlayingData = db.ExecuteCMD(sql, dbDict);
|
||||
if (nowPlayingData.Rows.Count > 0)
|
||||
{
|
||||
NowPlaying = new Models.UserProfile.NowPlayingItem
|
||||
{
|
||||
Game = Games.GetGame((long)nowPlayingData.Rows[0]["GameId"], false, false, false),
|
||||
Platform = Platforms.GetPlatform((long)nowPlayingData.Rows[0]["PlatformId"], false, false),
|
||||
Duration = Convert.ToInt64(nowPlayingData.Rows[0]["SessionLength"])
|
||||
};
|
||||
}
|
||||
|
||||
// return the user profile object
|
||||
return new Models.UserProfile
|
||||
{
|
||||
UserId = Guid.Parse(data.Rows[0]["Id"].ToString()),
|
||||
@@ -76,7 +55,6 @@ namespace gaseous_server.Classes
|
||||
Quip = data.Rows[0]["Quip"].ToString(),
|
||||
Avatar = Avatar,
|
||||
ProfileBackground = ProfileBackground,
|
||||
NowPlaying = NowPlaying,
|
||||
Data = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, object>>(data.Rows[0]["UnstructuredData"].ToString())
|
||||
};
|
||||
}
|
||||
|
@@ -10,8 +10,6 @@ using Asp.Versioning;
|
||||
using Authentication;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using gaseous_server.Models;
|
||||
using IGDB.Models;
|
||||
using gaseous_server.Classes.Metadata;
|
||||
|
||||
namespace gaseous_server.Controllers
|
||||
{
|
||||
@@ -64,15 +62,25 @@ namespace gaseous_server.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
Platform platform = Platforms.GetPlatform(PlatformId);
|
||||
PlatformMapping.PlatformMapItem platformMap = PlatformMapping.GetPlatformMap(PlatformId);
|
||||
|
||||
List<string> biosHashes = new List<string>();
|
||||
|
||||
if (GameId == -1 || filtered == false)
|
||||
{
|
||||
// get all bios files for selected platform
|
||||
biosHashes.AddRange(platformMap.EnabledBIOSHashes);
|
||||
IGDB.Models.Platform platform = Classes.Metadata.Platforms.GetPlatform(PlatformId);
|
||||
|
||||
string biosPath = Path.Combine(Config.LibraryConfiguration.LibraryBIOSDirectory, platform.Slug);
|
||||
|
||||
string tempFile = Path.GetTempFileName();
|
||||
|
||||
using (FileStream zipFile = System.IO.File.Create(tempFile))
|
||||
using (var zipArchive = new ZipArchive(zipFile, ZipArchiveMode.Create))
|
||||
{
|
||||
foreach (string file in Directory.GetFiles(biosPath))
|
||||
{
|
||||
zipArchive.CreateEntryFromFile(file, Path.GetFileName(file));
|
||||
}
|
||||
}
|
||||
|
||||
var stream = new FileStream(tempFile, FileMode.Open);
|
||||
return File(stream, "application/zip", platform.Slug + ".zip");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -82,31 +90,24 @@ namespace gaseous_server.Controllers
|
||||
PlatformMapping platformMapping = new PlatformMapping();
|
||||
PlatformMapping.PlatformMapItem userPlatformMap = platformMapping.GetUserPlatformMap(user.Id, PlatformId, GameId);
|
||||
|
||||
biosHashes.AddRange(userPlatformMap.EnabledBIOSHashes);
|
||||
}
|
||||
// build zip file
|
||||
string tempFile = Path.GetTempFileName();
|
||||
|
||||
// build zip file
|
||||
string tempFile = Path.GetTempFileName();
|
||||
|
||||
using (FileStream zipFile = System.IO.File.Create(tempFile))
|
||||
using (var zipArchive = new ZipArchive(zipFile, ZipArchiveMode.Create))
|
||||
{
|
||||
foreach (string hash in biosHashes)
|
||||
using (FileStream zipFile = System.IO.File.Create(tempFile))
|
||||
using (var zipArchive = new ZipArchive(zipFile, ZipArchiveMode.Create))
|
||||
{
|
||||
// get the bios data for the hash
|
||||
foreach (PlatformMapping.PlatformMapItem.EmulatorBiosItem bios in platformMap.Bios)
|
||||
foreach (Bios.BiosItem bios in GetBios(PlatformId, true))
|
||||
{
|
||||
if (bios.hash == hash)
|
||||
if (userPlatformMap.EnabledBIOSHashes.Contains(bios.hash))
|
||||
{
|
||||
// add the bios file to the zip
|
||||
zipArchive.CreateEntryFromFile(Path.Combine(Config.LibraryConfiguration.LibraryFirmwareDirectory, hash + ".bios"), bios.filename);
|
||||
zipArchive.CreateEntryFromFile(bios.biosPath, bios.filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var stream = new FileStream(tempFile, FileMode.Open);
|
||||
return File(stream, "application/zip", platform.Slug + ".zip");
|
||||
var stream = new FileStream(tempFile, FileMode.Open);
|
||||
return File(stream, "application/zip", userPlatformMap.IGDBSlug + ".zip");
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@@ -105,7 +105,7 @@ namespace gaseous_server.Controllers
|
||||
|
||||
if (platform.Length > 0)
|
||||
{
|
||||
tempVal = "view_Games_Roms.PlatformId IN (";
|
||||
tempVal = "Games_Roms.PlatformId IN (";
|
||||
string[] platformClauseItems = platform.Split(",");
|
||||
for (int i = 0; i < platformClauseItems.Length; i++)
|
||||
{
|
||||
@@ -281,7 +281,9 @@ namespace gaseous_server.Controllers
|
||||
}
|
||||
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
string sql = "SELECT DISTINCT view_Games_Roms.GameId AS ROMGameId, Game.*, case when Game.`Name` like 'The %' then CONCAT(trim(substr(Game.`Name` from 4)), ', The') else Game.`Name` end as NameThe FROM view_Games_Roms LEFT JOIN Game ON Game.Id = view_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 LEFT JOIN (SELECT Relation_Game_AgeRatings.GameId, AgeRating.* FROM Relation_Game_AgeRatings JOIN AgeRating ON Relation_Game_AgeRatings.AgeRatingsId = AgeRating.Id) view_AgeRatings ON Game.Id = view_AgeRatings.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;
|
||||
|
||||
string sql = "SELECT DISTINCT Games_Roms.GameId AS ROMGameId, Game.*, case when Game.`Name` like 'The %' then CONCAT(trim(substr(Game.`Name` from 4)), ', The') else Game.`Name` end as NameThe 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 LEFT JOIN (SELECT Relation_Game_AgeRatings.GameId, AgeRating.* FROM Relation_Game_AgeRatings JOIN AgeRating ON Relation_Game_AgeRatings.AgeRatingsId = AgeRating.Id) view_AgeRatings ON Game.Id = view_AgeRatings.GameId " + whereClause + " " + havingClause + " " + orderByClause;
|
||||
|
||||
List<IGDB.Models.Game> RetVal = new List<IGDB.Models.Game>();
|
||||
|
||||
|
@@ -37,7 +37,7 @@ namespace gaseous_server.Controllers
|
||||
{
|
||||
Database db = new Database(Database.databaseType.MySql, Config.DatabaseConfiguration.ConnectionString);
|
||||
|
||||
string sql = "SELECT * FROM Platform WHERE Id IN (SELECT DISTINCT PlatformId FROM view_Games_Roms) ORDER BY `Name` ASC;";
|
||||
string sql = "SELECT * FROM Platform WHERE Id IN (SELECT DISTINCT PlatformId FROM Games_Roms) ORDER BY `Name` ASC;";
|
||||
|
||||
List<Platform> RetVal = new List<Platform>();
|
||||
|
||||
|
@@ -51,7 +51,7 @@ namespace gaseous_server.Controllers
|
||||
ReturnValue.DatabaseSize = (long)(System.Decimal)dbResponse.Rows[0][1];
|
||||
|
||||
// platform statistics
|
||||
sql = "SELECT Platform.`name`, grc.Count, grs.Size FROM Platform INNER JOIN (SELECT Platform.`name` AS `Name`, SUM(grs.Size) AS Size FROM Platform JOIN view_Games_Roms AS grs ON (grs.PlatformId = Platform.Id) GROUP BY Platform.`name`) grs ON (grs.`Name` = Platform.`name`) INNER JOIN (SELECT Platform.`name` AS `Name`, COUNT(grc.Size) AS Count FROM Platform JOIN view_Games_Roms AS grc ON (grc.PlatformId = Platform.Id) GROUP BY Platform.`name`) grc ON (grc.`Name` = Platform.`name`) ORDER BY Platform.`name`;";
|
||||
sql = "SELECT Platform.`name`, grc.Count, grs.Size FROM Platform INNER JOIN (SELECT Platform.`name` AS `Name`, SUM(grs.Size) AS Size FROM Platform JOIN Games_Roms AS grs ON (grs.PlatformId = Platform.Id) GROUP BY Platform.`name`) grs ON (grs.`Name` = Platform.`name`) INNER JOIN (SELECT Platform.`name` AS `Name`, COUNT(grc.Size) AS Count FROM Platform JOIN Games_Roms AS grc ON (grc.PlatformId = Platform.Id) GROUP BY Platform.`name`) grc ON (grc.`Name` = Platform.`name`) ORDER BY Platform.`name`;";
|
||||
dbResponse = db.ExecuteCMD(sql);
|
||||
ReturnValue.PlatformStatistics = new List<SystemInfo.PlatformStatisticsItem>();
|
||||
foreach (DataRow dr in dbResponse.Rows)
|
||||
|
@@ -303,7 +303,7 @@ namespace gaseous_server.Controllers.v1_1
|
||||
string platformWhereClause = "";
|
||||
if (model.Platform.Count > 0)
|
||||
{
|
||||
tempVal = " AND view_Games_Roms.PlatformId IN (";
|
||||
tempVal = " AND Games_Roms.PlatformId IN (";
|
||||
for (int i = 0; i < model.Platform.Count; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
@@ -511,26 +511,26 @@ FROM
|
||||
WHEN Game.`Name` LIKE 'The %' THEN CONCAT(TRIM(SUBSTR(Game.`Name` FROM 4)), ', The')
|
||||
ELSE Game.`Name`
|
||||
END AS NameThe,
|
||||
view_Games_Roms.PlatformId,
|
||||
Games_Roms.PlatformId,
|
||||
AgeGroup.AgeGroupId,
|
||||
COUNT(view_Games_Roms.Id) AS RomCount
|
||||
COUNT(Games_Roms.Id) AS RomCount
|
||||
FROM
|
||||
Game
|
||||
LEFT JOIN AgeGroup ON Game.Id = AgeGroup.GameId
|
||||
LEFT JOIN view_Games_Roms ON Game.Id = view_Games_Roms.GameId" + platformWhereClause + @"
|
||||
LEFT JOIN Games_Roms ON Game.Id = Games_Roms.GameId" + platformWhereClause + @"
|
||||
LEFT JOIN AlternativeName ON Game.Id = AlternativeName.Game " + nameWhereClause + @"
|
||||
GROUP BY Game.Id
|
||||
HAVING RomCount > 0) Game
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
view_Games_Roms.GameId, COUNT(GameState.Id) AS RomSaveCount
|
||||
Games_Roms.GameId, COUNT(GameState.Id) AS RomSaveCount
|
||||
FROM
|
||||
GameState
|
||||
JOIN view_Games_Roms ON GameState.RomId = view_Games_Roms.Id
|
||||
JOIN Games_Roms ON GameState.RomId = Games_Roms.Id
|
||||
WHERE
|
||||
GameState.IsMediaGroup = 0
|
||||
AND GameState.UserId = @userid
|
||||
GROUP BY view_Games_Roms.GameId) RomSavedStates ON Game.Id = RomSavedStates.GameId
|
||||
GROUP BY Games_Roms.GameId) RomSavedStates ON Game.Id = RomSavedStates.GameId
|
||||
LEFT JOIN
|
||||
(SELECT
|
||||
RomMediaGroup.GameId,
|
||||
|
@@ -31,7 +31,7 @@ namespace gaseous_server.Controllers
|
||||
[Route("{UserId}")]
|
||||
[ProducesResponseType(typeof(Models.UserProfile), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ResponseCache(CacheProfileName = "Default30")]
|
||||
[ResponseCache(CacheProfileName = "5Minute")]
|
||||
public ActionResult GetUserProfile(string UserId)
|
||||
{
|
||||
Classes.UserProfile profile = new Classes.UserProfile();
|
||||
|
@@ -1,5 +1,3 @@
|
||||
using IGDB.Models;
|
||||
|
||||
namespace gaseous_server.Models
|
||||
{
|
||||
public class UserProfile
|
||||
@@ -7,13 +5,6 @@ namespace gaseous_server.Models
|
||||
public Guid UserId { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string Quip { get; set; }
|
||||
public NowPlayingItem? NowPlaying { get; set; }
|
||||
public class NowPlayingItem
|
||||
{
|
||||
public Game Game { get; set; }
|
||||
public Platform Platform { get; set; }
|
||||
public long Duration { get; set; }
|
||||
}
|
||||
public ProfileImageItem? Avatar { get; set; }
|
||||
public ProfileImageItem? ProfileBackground { get; set; }
|
||||
public Dictionary<string, object> Data { get; set; }
|
||||
|
@@ -48,9 +48,6 @@ Config.InitSettings();
|
||||
// write updated settings back to the config file
|
||||
Config.UpdateConfig();
|
||||
|
||||
// update default library path
|
||||
GameLibrary.UpdateDefaultLibraryPath();
|
||||
|
||||
// set api metadata source from config
|
||||
Communications.MetadataSource = Config.MetadataConfiguration.MetadataSource;
|
||||
|
||||
@@ -338,9 +335,6 @@ gaseous_server.Classes.Metadata.Platforms.AssignAllPlatformsToGameIdZero();
|
||||
// extract platform map if not present
|
||||
PlatformMapping.ExtractPlatformMap();
|
||||
|
||||
// migrate old firmware directory structure to new style
|
||||
Bios.MigrateToNewFolderStructure();
|
||||
|
||||
// add background tasks
|
||||
ProcessQueue.QueueItems.Add(new ProcessQueue.QueueItem(
|
||||
ProcessQueue.QueueItemType.SignatureIngestor)
|
||||
|
@@ -76,24 +76,4 @@ CREATE TABLE `User_GameFavouriteRoms` (
|
||||
`PlatformId`
|
||||
),
|
||||
CONSTRAINT `GameFavouriteRoms_Users` FOREIGN KEY (`UserId`) REFERENCES `Users` (`Id`) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
ALTER TABLE `Games_Roms`
|
||||
CHANGE `Path` `RelativePath` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL;
|
||||
|
||||
ALTER TABLE `Games_Roms`
|
||||
ADD CONSTRAINT Games_Roms_LibraryId FOREIGN KEY (`LibraryId`) REFERENCES `GameLibraries` (`Id`) ON DELETE CASCADE;
|
||||
|
||||
CREATE VIEW view_Games_Roms AS
|
||||
SELECT `Games_Roms`.*, CONCAT(
|
||||
`GameLibraries`.`Path`, '/', `Games_Roms`.`RelativePath`
|
||||
) AS `Path`, `GameLibraries`.`Name` AS `LibraryName`
|
||||
FROM
|
||||
`Games_Roms`
|
||||
JOIN `GameLibraries` ON `Games_Roms`.`LibraryId` = `GameLibraries`.`Id`;
|
||||
|
||||
CREATE VIEW view_UserTimeTracking AS
|
||||
SELECT *, DATE_ADD(
|
||||
SessionTime, INTERVAL SessionLength MINUTE
|
||||
) AS SessionEnd
|
||||
FROM UserTimeTracking;
|
||||
);
|
@@ -21,7 +21,7 @@
|
||||
<PackageReference Include="gaseous-signature-parser" Version="2.2.1" />
|
||||
<PackageReference Include="gaseous.IGDB" Version="1.0.2" />
|
||||
<PackageReference Include="hasheous-client" Version="1.0.2" />
|
||||
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="13.8.0" />
|
||||
<PackageReference Include="Magick.NET-Q8-AnyCPU" Version="14.0.0" />
|
||||
<PackageReference Include="sharpcompress" Version="0.37.2" />
|
||||
<PackageReference Include="Squid-Box.SevenZipSharp" Version="1.6.2.24" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.1" />
|
||||
|
@@ -26,63 +26,41 @@
|
||||
"/scripts/jquery.lazy.plugins.min.js",
|
||||
"/scripts/moment-with-locales.min.js",
|
||||
"/scripts/select2.min.js",
|
||||
"/scripts/filterformating.js",
|
||||
"/scripts/gamesformating.js",
|
||||
"/scripts/main.js",
|
||||
"/scripts/modals.js",
|
||||
"/scripts/preferences.js",
|
||||
"/scripts/account.js",
|
||||
"/scripts/libraries.js",
|
||||
"/scripts/notifications.js",
|
||||
"/scripts/rominfo.js",
|
||||
"/scripts/uploadrom.js"
|
||||
"/scripts/uploadrom.js",
|
||||
"/scripts/filterformating.js",
|
||||
"/scripts/gamesformating.js",
|
||||
"/scripts/main.js"
|
||||
];
|
||||
|
||||
let head = document.getElementsByTagName('head')[0];
|
||||
|
||||
// placeholder for global userProfile variable
|
||||
var userProfile;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- Background Images -->
|
||||
<div id="bgImages"></div>
|
||||
<div id="bgImage_Opacity"></div>
|
||||
// update script links
|
||||
for (let i = 0; i < scriptLinks.length; i++) {
|
||||
let newScript = document.createElement('script');
|
||||
newScript.src = scriptLinks[i] + '?v=' + AppVersion;
|
||||
newScript.type = "text/javascript";
|
||||
newScript.async = false;
|
||||
|
||||
<!-- Notifications -->
|
||||
<div id="notifications_target"></div>
|
||||
head.appendChild(newScript);
|
||||
}
|
||||
|
||||
<!-- Page Banner -->
|
||||
<div id="banner_target"></div>
|
||||
// update stylesheet links
|
||||
for (let i = 0; i < styleSheets.length; i++) {
|
||||
let newLink = document.createElement('link');
|
||||
newLink.rel = "stylesheet";
|
||||
newLink.href = styleSheets[i] + '?v=' + AppVersion;
|
||||
newLink.type = "text/css";
|
||||
|
||||
<!-- Page Content -->
|
||||
<div id="content"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// start the application
|
||||
let backgroundImageHandler = undefined;
|
||||
|
||||
async function loadScriptsAndStyles() {
|
||||
// update script links
|
||||
for (let i = 0; i < scriptLinks.length; i++) {
|
||||
let newScript = document.createElement('script');
|
||||
newScript.src = scriptLinks[i] + '?v=' + AppVersion;
|
||||
newScript.type = "text/javascript";
|
||||
newScript.async = false;
|
||||
|
||||
head.appendChild(newScript);
|
||||
}
|
||||
|
||||
// update stylesheet links
|
||||
for (let i = 0; i < styleSheets.length; i++) {
|
||||
let newLink = document.createElement('link');
|
||||
newLink.rel = "stylesheet";
|
||||
newLink.href = styleSheets[i] + '?v=' + AppVersion;
|
||||
newLink.type = "text/css";
|
||||
|
||||
head.appendChild(newLink);
|
||||
}
|
||||
head.appendChild(newLink);
|
||||
}
|
||||
|
||||
async function LoadPageContent(page, targetDiv) {
|
||||
@@ -105,53 +83,66 @@
|
||||
|
||||
backgroundImageHandler = new BackgroundImageRotator();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
async function startApp() {
|
||||
await loadScriptsAndStyles();
|
||||
<body>
|
||||
<!-- Background Images -->
|
||||
<div id="bgImages"></div>
|
||||
<div id="bgImage_Opacity"></div>
|
||||
|
||||
console.log("Starting Gaseous Games");
|
||||
console.log("App Version: " + AppVersion);
|
||||
console.log("First Run Status: " + FirstRunStatus);
|
||||
switch (FirstRunStatus) {
|
||||
case 0:
|
||||
case "0":
|
||||
// first run - load first run wizard
|
||||
await LoadPageContent('first', 'content');
|
||||
break;
|
||||
<!-- Notifications -->
|
||||
<div id="notifications_target"></div>
|
||||
|
||||
default:
|
||||
// first run - load login page or redirect if user already logged in
|
||||
<!-- Page Banner -->
|
||||
<div id="banner_target"></div>
|
||||
|
||||
await fetch('/api/v1.1/Account/Profile/Basic')
|
||||
.then(async response => {
|
||||
if (response.ok) {
|
||||
// user is signed in - start setting up the application
|
||||
console.log("User is logged in");
|
||||
userProfile = await response.json();
|
||||
<!-- Page Content -->
|
||||
<div id="content"></div>
|
||||
|
||||
// load page banner
|
||||
await LoadPageContent('banner', 'banner_target');
|
||||
<script type="text/javascript">
|
||||
// start the application
|
||||
let backgroundImageHandler = undefined;
|
||||
console.log("Starting Gaseous Games");
|
||||
console.log("App Version: " + AppVersion);
|
||||
console.log("First Run Status: " + FirstRunStatus);
|
||||
switch (FirstRunStatus) {
|
||||
case 0:
|
||||
case "0":
|
||||
// first run - load first run wizard
|
||||
LoadPageContent('first', 'content');
|
||||
break;
|
||||
|
||||
// load page content
|
||||
let pageSelection = getQueryString('page', 'string');
|
||||
default:
|
||||
// first run - load login page or redirect if user already logged in
|
||||
|
||||
if (!pageSelection) {
|
||||
pageSelection = GetPreference("DefaultHomePage", 'home');
|
||||
}
|
||||
await LoadPageContent(pageSelection, 'content');
|
||||
} else {
|
||||
// user is not signed in - load login page
|
||||
await LoadPageContent('login');
|
||||
fetch('/api/v1.1/Account/Profile/Basic')
|
||||
.then(async response => {
|
||||
if (response.ok) {
|
||||
// user is signed in - start setting up the application
|
||||
console.log("User is logged in");
|
||||
userProfile = await response.json();
|
||||
|
||||
// load page banner
|
||||
LoadPageContent('banner', 'banner_target');
|
||||
|
||||
// load page content
|
||||
let pageSelection = getQueryString('page', 'string');
|
||||
|
||||
if (!pageSelection) {
|
||||
pageSelection = GetPreference("DefaultHomePage", 'home');
|
||||
}
|
||||
})
|
||||
.catch(async (error) => {
|
||||
console.log(error);
|
||||
await LoadPageContent('login');
|
||||
});
|
||||
break;
|
||||
}
|
||||
LoadPageContent(pageSelection, 'content');
|
||||
} else {
|
||||
// user is not signed in - load login page
|
||||
LoadPageContent('login');
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
LoadPageContent('login');
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
window.document.addEventListener('DOMContentLoaded', startApp);
|
||||
</script>
|
||||
</body>
|
@@ -44,7 +44,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="banner_header_label" onclick="window.location.href = '/index.html';">Gaseous</div>
|
||||
<div id="banner_header_label" onclick="window.location.href = '/index.html';">Gaseous Games</div>
|
||||
</div>
|
||||
|
||||
<!-- page code -->
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<!-- <img src="/images/logo.png" style="display: block; margin: 20px auto; width: 100px;" /> -->
|
||||
<div class="loginwindow-logospace-logo"> </div>
|
||||
|
||||
<div id="loginwindow_header_label" class="loginwindow-logospace-label">Gaseous</div>
|
||||
<div id="loginwindow_header_label" class="loginwindow-logospace-label">Gaseous Games</div>
|
||||
|
||||
<div style="height: 20px;"> </div>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<div class="loginwindow-logospace-logo"> </div>
|
||||
<div class="loginwindow-logospace-label">
|
||||
<div>
|
||||
Gaseous
|
||||
Gaseous Games
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<div class="loginwindow-logospace-logo"> </div>
|
||||
<div class="loginwindow-logospace-label">
|
||||
<div>
|
||||
Gaseous
|
||||
Gaseous Games
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<div class="section" style="flex-grow:1;">
|
||||
<div class="section-header">General</div>
|
||||
<div class="section-body">
|
||||
<table class="romtable" cellspacing="0">
|
||||
<table class="romtable">
|
||||
<tr class="romrow">
|
||||
<th class="romcell">User Id</th>
|
||||
<td id="user-id" class="romcell"></td>
|
||||
|
@@ -366,18 +366,6 @@ class ProfileCard {
|
||||
this.Quip.classList.add('profile-card-quip');
|
||||
this.ProfileBody = document.createElement('div');
|
||||
this.ProfileBody.classList.add('profile-card-body');
|
||||
this.ProfileNowPlaying = document.createElement('div');
|
||||
this.ProfileNowPlaying.classList.add('profile-card-now-playing-body');
|
||||
this.ProfileNowPlayingLabel = document.createElement('div');
|
||||
this.ProfileNowPlayingLabel.classList.add('profile-card-now-playing-label');
|
||||
this.ProfileNowPlayingCover = document.createElement('div');
|
||||
this.ProfileNowPlayingCover.classList.add('profile-card-now-playing-cover');
|
||||
this.ProfileNowPlayingTitle = document.createElement('div');
|
||||
this.ProfileNowPlayingTitle.classList.add('profile-card-now-playing-title');
|
||||
this.ProfileNowPlayingPlatform = document.createElement('div');
|
||||
this.ProfileNowPlayingPlatform.classList.add('profile-card-now-playing-platform');
|
||||
this.ProfileNowPlayingDuration = document.createElement('div');
|
||||
this.ProfileNowPlayingDuration.classList.add('profile-card-now-playing-duration');
|
||||
this.Avatar = document.createElement('div');
|
||||
this.Avatar.classList.add('profile-card-avatar');
|
||||
|
||||
@@ -387,28 +375,12 @@ class ProfileCard {
|
||||
this.ProfileBody.appendChild(this.DisplayName);
|
||||
this.ProfileBody.appendChild(this.Quip);
|
||||
|
||||
// now playing
|
||||
this.ProfileNowPlaying.appendChild(this.ProfileNowPlayingLabel);
|
||||
this.ProfileNowPlaying.appendChild(this.ProfileNowPlayingCover);
|
||||
this.ProfileNowPlaying.appendChild(this.ProfileNowPlayingTitle);
|
||||
this.ProfileNowPlaying.appendChild(this.ProfileNowPlayingPlatform);
|
||||
this.ProfileNowPlaying.appendChild(this.ProfileNowPlayingDuration);
|
||||
|
||||
// assemble card
|
||||
this.Card.appendChild(this.BackgroundImage);
|
||||
this.Card.appendChild(this.ProfileBody);
|
||||
this.Card.appendChild(this.ProfileNowPlaying);
|
||||
this.Card.appendChild(this.Avatar);
|
||||
|
||||
this.ProfileData = null;
|
||||
const response = this.#FetchProfile(this);
|
||||
|
||||
// set timeout to refresh the profile card every 30 seconds
|
||||
let callingObject = this;
|
||||
setInterval(function () {
|
||||
callingObject.#FetchProfile(callingObject);
|
||||
}, 30000);
|
||||
|
||||
return this.Card;
|
||||
}
|
||||
|
||||
@@ -420,57 +392,12 @@ class ProfileCard {
|
||||
} else {
|
||||
const profile = await response.json();
|
||||
if (profile) {
|
||||
let stillUpdateAnyway = false;
|
||||
if (callingObject.ProfileData === null) {
|
||||
callingObject.ProfileData = profile;
|
||||
stillUpdateAnyway = true;
|
||||
this.Avatar.appendChild(new Avatar(callingObject.ProfileId, 50, 50));
|
||||
if (profile.profileBackground) {
|
||||
this.BackgroundImage.style = "background-image: url('/api/v1.1/UserProfile/" + callingObject.ProfileId + "/Background');";
|
||||
}
|
||||
|
||||
// update avatar if different
|
||||
if (callingObject.ProfileData.avatar !== profile.avatar || stillUpdateAnyway === true) {
|
||||
callingObject.Avatar.innerHTML = "";
|
||||
callingObject.Avatar.appendChild(new Avatar(callingObject.ProfileId, 50, 50));
|
||||
}
|
||||
|
||||
// update profile background if different
|
||||
if (callingObject.ProfileData.profileBackground !== profile.profileBackground || stillUpdateAnyway === true) {
|
||||
if (profile.profileBackground) {
|
||||
callingObject.BackgroundImage.style = "background-image: url('/api/v1.1/UserProfile/" + callingObject.ProfileId + "/Background');";
|
||||
} else {
|
||||
callingObject.BackgroundImage.style = "";
|
||||
}
|
||||
}
|
||||
|
||||
// update display name if different
|
||||
if (callingObject.ProfileData.displayName !== profile.displayName || stillUpdateAnyway === true) {
|
||||
callingObject.DisplayName.innerHTML = profile.displayName;
|
||||
}
|
||||
|
||||
// update quip if different
|
||||
if (callingObject.ProfileData.quip !== profile.quip || stillUpdateAnyway === true) {
|
||||
callingObject.Quip.innerHTML = profile.quip;
|
||||
}
|
||||
|
||||
if (profile.nowPlaying) {
|
||||
callingObject.ProfileNowPlayingLabel.innerHTML = "Now Playing";
|
||||
if (profile.nowPlaying.game.cover) {
|
||||
callingObject.ProfileNowPlayingCover.style = "background-image: url('/api/v1.1/Games/" + profile.nowPlaying.game.id + "/cover/" + profile.nowPlaying.game.cover.id + "/image/cover_big/" + profile.nowPlaying.game.cover.id + ".jpg');";
|
||||
} else {
|
||||
callingObject.ProfileNowPlayingCover.style = "background-image: url('/images/unknowngame.png');";
|
||||
}
|
||||
callingObject.ProfileNowPlayingTitle.innerHTML = profile.nowPlaying.game.name;
|
||||
callingObject.ProfileNowPlayingPlatform.innerHTML = profile.nowPlaying.platform.name;
|
||||
if (profile.nowPlaying.duration === 1) {
|
||||
callingObject.ProfileNowPlayingDuration.innerHTML = profile.nowPlaying.duration + " minute";
|
||||
} else {
|
||||
callingObject.ProfileNowPlayingDuration.innerHTML = profile.nowPlaying.duration + " minutes";
|
||||
}
|
||||
callingObject.ProfileNowPlaying.style.display = "";
|
||||
} else {
|
||||
callingObject.ProfileNowPlaying.style.display = "none";
|
||||
}
|
||||
|
||||
callingObject.ProfileData = profile;
|
||||
this.DisplayName.innerHTML = profile.displayName;
|
||||
this.Quip.innerHTML = profile.quip;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -134,8 +134,7 @@ h3 {
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-right: -50%;
|
||||
/* transform: translate(-50%, -50%); */
|
||||
transform: translateX(-50%) translateY(calc(-50% - .5px));
|
||||
transform: translate(-50%, -50%);
|
||||
min-width: 700px;
|
||||
max-width: 1000px;
|
||||
width: 60%;
|
||||
@@ -186,8 +185,8 @@ h3 {
|
||||
|
||||
.modal-window-tabs {
|
||||
background-color: var(--modal-tabs-background-color);
|
||||
/* backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px); */
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
display: block;
|
||||
flex-grow: 0;
|
||||
flex-shrink: 1;
|
||||
@@ -238,8 +237,8 @@ h3 {
|
||||
text-align: top;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
/* backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px); */
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.modal-window-header {
|
||||
@@ -314,7 +313,7 @@ h3 {
|
||||
|
||||
#banner_icon {
|
||||
/* background-color: white; */
|
||||
background-color: rgba(0, 22, 56, 0.2);
|
||||
background-color: rgba(0, 22, 56, 0.8);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
position: fixed;
|
||||
@@ -337,7 +336,7 @@ h3 {
|
||||
#banner_icon_image {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
filter: drop-shadow(1px 1px 0 rgb(180, 180, 180)) drop-shadow(-1px 1px 0 rgb(180, 180, 180)) drop-shadow(1px -1px 0 rgb(180, 180, 180)) drop-shadow(-1px -1px 0 rgb(180, 180, 180));
|
||||
filter: drop-shadow(1px 1px 0 rgb(90, 90, 90)) drop-shadow(-1px 1px 0 rgb(90, 90, 90)) drop-shadow(1px -1px 0 rgb(90, 90, 90)) drop-shadow(-1px -1px 0 rgb(90, 90, 90));
|
||||
}
|
||||
|
||||
.banner_button {
|
||||
@@ -417,7 +416,7 @@ h3 {
|
||||
|
||||
#banner_header {
|
||||
background: rgba(0, 22, 56, 0.8);
|
||||
background: linear-gradient(90deg, rgba(0, 22, 56, 0.2) 0%, rgba(0, 0, 0, 0.5) 100%);
|
||||
background: linear-gradient(90deg, rgba(0, 22, 56, 0.8) 0%, rgba(0, 0, 0, 0.8) 100%);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
position: fixed;
|
||||
@@ -436,7 +435,7 @@ h3 {
|
||||
font-size: 16pt;
|
||||
vertical-align: top;
|
||||
/*color: #edeffa;*/
|
||||
color: #FFFFFF;
|
||||
color: #7c70da;
|
||||
}
|
||||
|
||||
#banner_header_label {
|
||||
@@ -1192,8 +1191,8 @@ input[name='filter_panel_range_max'] {
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
background-color: white;
|
||||
filter: blur(64px);
|
||||
-webkit-filter: blur(64px);
|
||||
filter: blur(32px);
|
||||
-webkit-filter: blur(32px);
|
||||
}
|
||||
|
||||
.bgImage_LessBlur {
|
||||
@@ -2366,17 +2365,18 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
flex-direction: row;
|
||||
flex-wrap: nowrap;
|
||||
gap: 1px;
|
||||
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
.loginwindow-logospace {
|
||||
background-color: var(--login-logospace-background);
|
||||
background-color: var(--modal-tabs-background-color);
|
||||
width: 315px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.loginwindow_loginspace {
|
||||
background-color: var(--login-loginspace-background);
|
||||
background-color: var(--modal-window-background-color);
|
||||
padding: 20px;
|
||||
flex-grow: 1;
|
||||
}
|
||||
@@ -2425,7 +2425,7 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
font-size: 18pt;
|
||||
vertical-align: top;
|
||||
/*color: #edeffa;*/
|
||||
color: var(--login-logospace-label);
|
||||
color: white;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
@@ -2451,9 +2451,9 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
.dropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
background-color: var(--dropdown-background);
|
||||
background-color: var(--modal-background-color);
|
||||
border-radius: var(--standard-radius);
|
||||
border-color: var(--dropdown-border);
|
||||
border-color: var(--modal-border-color);
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
overflow: hidden;
|
||||
@@ -2465,13 +2465,15 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
filter: drop-shadow(5px 5px 10px #000);
|
||||
-webkit-filter: drop-shadow(5px 5px 10px #000);
|
||||
padding: 3px;
|
||||
backdrop-filter: blur(16px);
|
||||
-webkit-backdrop-filter: blur(16px);
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/* Links inside the dropdown */
|
||||
.dropdown-content a,
|
||||
.dropdown-content span {
|
||||
color: var(--dropdown-menu-text-color);
|
||||
color: white;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
@@ -2486,7 +2488,7 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
|
||||
/* Change color of dropdown links on hover */
|
||||
.dropdown-content a:hover {
|
||||
background-color: var(--dropdown-border);
|
||||
background-color: var(--modal-border-color);
|
||||
}
|
||||
|
||||
/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */
|
||||
@@ -2656,7 +2658,7 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
border-radius: var(--standard-radius);
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
border-color: var(--profile-card-border);
|
||||
border-color: rgba(173, 216, 230, 0.3);
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
@@ -2679,7 +2681,7 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
aspect-ratio: 4.17/1;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-color: var(--profile-card-background-image);
|
||||
background-color: rgb(0, 0, 130);
|
||||
}
|
||||
|
||||
.profile-card-body {
|
||||
@@ -2688,13 +2690,15 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-bottom: 20px;
|
||||
background-color: var(--profile-card-body-background);
|
||||
background-color: rgba(173, 216, 230, 0.3);
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.profile-card-display-name {
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: var(--profile-card-display-name-text-color);
|
||||
color: white;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -2703,47 +2707,7 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
.profile-card-quip {
|
||||
margin-top: 3px;
|
||||
font-style: italic;
|
||||
color: var(--profile-card-quip-text-color);
|
||||
}
|
||||
|
||||
.profile-card-now-playing-body {
|
||||
position: relative;
|
||||
min-height: 70px;
|
||||
background-color: var(--profile-card-body-background);
|
||||
padding-top: 0px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.profile-card-now-playing-label {
|
||||
font-style: italic;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.profile-card-now-playing-cover {
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
top: 25px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.profile-card-now-playing-title {
|
||||
margin-left: 50px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.profile-card-now-playing-platform {
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.profile-card-now-playing-duration {
|
||||
margin-top: 10px;
|
||||
margin-left: 50px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.password-rules {
|
||||
@@ -2842,6 +2806,8 @@ button:not(.select2-selection__choice__remove):not(.select2-selection__clear):no
|
||||
display: block;
|
||||
background: var(--section-body-background);
|
||||
background: linear-gradient(0deg, var(--section-body-background-solid) 25%, rgba(255, 255, 255, 0) 100%);
|
||||
backdrop-filter: blur(8px);
|
||||
--webkit-backdrop-filter: blur(8px);
|
||||
padding: 5px;
|
||||
vertical-align: bottom;
|
||||
content: "";
|
||||
|
@@ -71,7 +71,7 @@
|
||||
--button-blue-font-colour-disabled: var(--button-blue-font-colour);
|
||||
|
||||
/* select2 */
|
||||
--select2-background: rgb(43, 43, 43);
|
||||
--select2-background: var(--input-background);
|
||||
--select2-background-disabled: var(--input-background-disabled);
|
||||
--select2-border: var(--input-border);
|
||||
--select2-border-hover: var(--input-border-hover);
|
||||
@@ -106,28 +106,8 @@
|
||||
/* ------------------------------------------- */
|
||||
--modal-background-color: rgba(0, 0, 0, 0.4);
|
||||
--modal-border-color: rgba(255, 255, 255, 0.414);
|
||||
--modal-tabs-background-color: rgb(100, 100, 100);
|
||||
--modal-window-background-color: rgb(79, 79, 79);
|
||||
--modal-tabs-background-color: rgba(255, 255, 255, 0.2);
|
||||
--modal-window-background-color: rgba(70, 70, 70, 0.6);
|
||||
--modal-window-header-text-color: rgb(255, 255, 255);
|
||||
--modal-window-header-background-color: rgb(56, 56, 56);
|
||||
|
||||
/* dropdown */
|
||||
/* ------------------------------------------- */
|
||||
--dropdown-background: rgb(0, 0, 0);
|
||||
--dropdown-border: var(--modal-border-color);
|
||||
--dropdown-menu-text-color: rgb(255, 255, 255);
|
||||
|
||||
/* profile card */
|
||||
/* ------------------------------------------- */
|
||||
--profile-card-border: rgba(173, 216, 230, 0.3);
|
||||
--profile-card-background-image: rgb(0, 0, 130);
|
||||
--profile-card-body-background: rgb(133, 156, 163);
|
||||
--profile-card-display-name-text-color: rgb(255, 255, 255);
|
||||
--profile-card-quip-text-color: var(--profile-card-display-name-text-color);
|
||||
|
||||
/* login */
|
||||
/* ------------------------------------------- */
|
||||
--login-logospace-background: rgba(100, 100, 100, 0.7);
|
||||
--login-loginspace-background: rgba(79, 79, 79, 0.7);
|
||||
--login-logospace-label: rgb(255, 255, 255);
|
||||
}
|
Reference in New Issue
Block a user