Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple metadata data sources #474

Open
wants to merge 53 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
4075976
Bump Hasheous-Client version
michael-j-green Oct 2, 2024
32f6a86
Migrate away from system version file to fetch
michael-j-green Oct 2, 2024
4a76436
Hide favourite icon in similar games list + minor UI tweaks and fixes
michael-j-green Oct 2, 2024
bca4dd1
Various BIOS file bug fixes
michael-j-green Oct 2, 2024
574d3bc
WIP
michael-j-green Oct 17, 2024
f25b3d0
WIP - Can now pull via the Hasheous metadata proxy
michael-j-green Oct 18, 2024
478044a
WIP - Images are now pulled via Hasheous proxy
michael-j-green Oct 19, 2024
48e4f17
Fixed ratings loading in the preferences
michael-j-green Oct 19, 2024
53c7928
WIP - Bug hunting
michael-j-green Oct 20, 2024
b3ca94b
WIP
michael-j-green Oct 21, 2024
f99eec2
WIP - All server communications can now use Hasheous
michael-j-green Oct 22, 2024
f19214b
Settings UI changes complete
michael-j-green Oct 28, 2024
8b9d7c6
Merge v1.7.7 update - #445
michael-j-green Oct 24, 2024
6f5b520
Updated to the latest version of EJS (see: https://github.com/Emulato…
michael-j-green Oct 24, 2024
e8ca8ca
Fix for EJS version bump
michael-j-green Oct 25, 2024
b1fcfec
Fix for generating launch links
michael-j-green Oct 30, 2024
74171b5
WIP
michael-j-green Nov 17, 2024
ca2dbfb
WIP
michael-j-green Nov 20, 2024
173e492
WIP
michael-j-green Dec 6, 2024
2303ab5
WIP
michael-j-green Dec 6, 2024
142f3ed
WIP
michael-j-green Dec 14, 2024
7a98279
WIP
michael-j-green Dec 15, 2024
a859d87
WIP
michael-j-green Dec 15, 2024
c724d92
WIP
michael-j-green Dec 18, 2024
ffd4dcb
WIP
michael-j-green Dec 19, 2024
ae41fae
WIP
michael-j-green Dec 26, 2024
c170d98
WIP
michael-j-green Dec 27, 2024
1727a62
WIP
michael-j-green Dec 28, 2024
42370a9
WIP
michael-j-green Jan 1, 2025
97645af
WIP
michael-j-green Jan 2, 2025
8153c42
WIP
michael-j-green Jan 3, 2025
fc0d164
WIP
michael-j-green Jan 6, 2025
da98b1c
WIP
michael-j-green Jan 6, 2025
202c2c0
WIP
michael-j-green Jan 7, 2025
7c327ee
WIP
michael-j-green Jan 7, 2025
6863f65
WIP
michael-j-green Jan 8, 2025
f8b9ca3
WIP
michael-j-green Jan 8, 2025
9e93ed1
WIP
michael-j-green Jan 8, 2025
aa90b4e
WIP
michael-j-green Jan 9, 2025
a0a8495
WIP
michael-j-green Jan 9, 2025
86c207e
WIP
michael-j-green Jan 10, 2025
d07300e
WIP
michael-j-green Jan 10, 2025
9145688
Merge branch 'main' into michael-j-green/issue86
michael-j-green Jan 10, 2025
25ce697
WIP
michael-j-green Jan 11, 2025
68bd3d8
WIP
michael-j-green Jan 11, 2025
27e5e3f
WIP
michael-j-green Jan 27, 2025
101456a
WIP
michael-j-green Jan 28, 2025
b87c040
WIP
michael-j-green Jan 30, 2025
68069c5
WIP
michael-j-green Feb 6, 2025
62181f2
WIP
michael-j-green Feb 8, 2025
e2e3d4a
WIP
michael-j-green Feb 8, 2025
38cb58c
WIP
michael-j-green Feb 9, 2025
718a314
WIP
michael-j-green Feb 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
FROM mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm

RUN apt-get update && apt-get install -y p7zip-full
RUN mkdir -p /workspace/gaseous-server/wwwroot/emulators/EmulatorJS
RUN wget https://cdn.emulatorjs.org/releases/4.0.12.7z
RUN 7z x -y -o/workspace/gaseous-server/wwwroot/emulators/EmulatorJS 4.0.12.7z
# update apt-get
RUN apt-get update

# download and unzip EmulatorJS from CDN
RUN apt-get install -y p7zip-full default-jdk nodejs wget
RUN mkdir -p out/wwwroot/emulators/EmulatorJS
RUN wget https://cdn.emulatorjs.org/releases/4.1.1.7z
RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.1.1.7z
23 changes: 11 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name": "C# (.NET)",
"name": "Gaseous C# (.NET)",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
//"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-bookworm",
"dockerComposeFile": "docker-compose.yml",
"service": "development",
"workspaceFolder": "/workspace",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5198],
"forwardPorts": [
5198
],
"portsAttributes": {
"5198": {
"protocol": "http"
}
"5198": {
"protocol": "http"
}
},

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "dotnet restore",

// Configure tool-specific properties.
"customizations": {
"vscode": {
Expand All @@ -38,11 +36,12 @@
"ms-dotnettools.vscodeintellicode-csharp",
"Zignd.html-css-class-completion",
"PWABuilder.pwa-studio",
"ms-azuretools.vscode-docker"
"ms-azuretools.vscode-docker",
"SonarSource.sonarlint-vscode",
"oderwat.indent-rainbow"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
}
12 changes: 3 additions & 9 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,14 @@ RUN dotnet restore "gaseous-server/gaseous-server.csproj" -a $TARGETARCH
# Build and publish a release
RUN dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained true -c Release -o out -a $TARGETARCH

# Build Gaseous CLI
# Restore as distinct layers
RUN dotnet restore "gaseous-cli/gaseous-cli.csproj" -a $TARGETARCH
# Build and publish a release
RUN dotnet publish "gaseous-cli/gaseous-cli.csproj" --use-current-runtime --self-contained true -c Release -o out -a $TARGETARCH

# update apt-get
RUN apt-get update

# # download and unzip EmulatorJS from CDN
# download and unzip EmulatorJS from CDN
RUN apt-get install -y p7zip-full
RUN mkdir -p out/wwwroot/emulators/EmulatorJS
RUN wget https://cdn.emulatorjs.org/releases/4.0.12.7z
RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.0.12.7z
RUN wget https://cdn.emulatorjs.org/releases/4.1.1.7z
RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.1.1.7z

# clean up apt-get
RUN apt-get clean && rm -rf /var/lib/apt/lists
Expand Down
12 changes: 3 additions & 9 deletions build/Dockerfile-EmbeddedDB
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,14 @@ RUN dotnet restore "gaseous-server/gaseous-server.csproj" -a $TARGETARCH
# Build and publish a release
RUN dotnet publish "gaseous-server/gaseous-server.csproj" --use-current-runtime --self-contained true -c Release -o out -a $TARGETARCH

# Build Gaseous CLI
# Restore as distinct layers
RUN dotnet restore "gaseous-cli/gaseous-cli.csproj" -a $TARGETARCH
# Build and publish a release
RUN dotnet publish "gaseous-cli/gaseous-cli.csproj" --use-current-runtime --self-contained true -c Release -o out -a $TARGETARCH

# update apt-get
RUN apt-get update

# # download and unzip EmulatorJS from CDN
# download and unzip EmulatorJS from CDN
RUN apt-get install -y p7zip-full
RUN mkdir -p out/wwwroot/emulators/EmulatorJS
RUN wget https://cdn.emulatorjs.org/releases/4.0.12.7z
RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.0.12.7z
RUN wget https://cdn.emulatorjs.org/releases/4.1.1.7z
RUN 7z x -y -oout/wwwroot/emulators/EmulatorJS 4.1.1.7z

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
Expand Down
35 changes: 34 additions & 1 deletion gaseous-server/Classes/Bios.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using gaseous_server.Classes.Metadata;
using HasheousClient.Models.Metadata.IGDB;

namespace gaseous_server.Classes
{
Expand All @@ -11,6 +13,37 @@ public Bios()

}

public static void ImportBiosFile(string FilePath, Common.hashObject Hash, ref Dictionary<string, object> BiosFileInfo)
{
BiosFileInfo.Add("type", "bios");
BiosFileInfo.Add("status", "notimported");

foreach (Classes.Bios.BiosItem biosItem in Classes.Bios.GetBios())
{
if (biosItem.Available == false)
{
if (biosItem.hash == Hash.md5hash)
{
string biosPath = Path.Combine(Config.LibraryConfiguration.LibraryFirmwareDirectory, biosItem.hash + ".bios");
Logging.Log(Logging.LogType.Information, "Import BIOS File", " " + FilePath + " is a BIOS file - moving to " + biosPath);

File.Move(FilePath, biosItem.biosPath, true);

BiosFileInfo.Add("name", biosItem.filename);
BiosFileInfo.Add("platform", Platforms.GetPlatform(biosItem.platformid));
BiosFileInfo["status"] = "imported";
}
}
else
{
if (biosItem.hash == Hash.md5hash)
{
BiosFileInfo["status"] = "duplicate";
}
}
}
}

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
Expand Down Expand Up @@ -94,7 +127,7 @@ private static List<BiosItem> BuildBiosList()
{
if (platformMapping.Bios != null)
{
IGDB.Models.Platform platform = Metadata.Platforms.GetPlatform(platformMapping.IGDBId);
Platform platform = Metadata.Platforms.GetPlatform(platformMapping.IGDBId);

foreach (Models.PlatformMapping.PlatformMapItem.EmulatorBiosItem emulatorBios in platformMapping.Bios)
{
Expand Down
Loading
Loading