Skip to content

Commit

Permalink
0.0.10 (#65)
Browse files Browse the repository at this point in the history
igdb metadata
  • Loading branch information
narafrost authored Dec 30, 2023
2 parents c4f364c + f19dd57 commit 0803110
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AbstractScanner from "./abstract";
import { BASE_STORE, BASE_URL, anonKey } from "../smoke.config";
import { BASE_URL, anonKey } from "../smoke.config";
const { ipcRenderer } = require("electron");

const fetch = async (url, data): Promise<any> => {
Expand All @@ -17,22 +17,18 @@ const fetch = async (url, data): Promise<any> => {
})
}

export default class SmokeMetadata extends AbstractScanner {
export default class IGDBMetadata extends AbstractScanner {

// TODO save images locally
async scrapGame(game) {
const data = await fetch(`/search-game/${game.id}`, {
query: game.name
});

const cover = data?.result?.cover ? `${BASE_STORE}/${data?.result?.cover}` : null;
const banner = data?.result?.banner ? `${BASE_STORE}/${data?.result?.banner}` : null;

return {
...game,
name: data?.result?.name || game.name,
image: cover,
banner: banner,
name: game.name,
image: data?.result?.cover,
banner: data?.result?.banner,
description: "No description yet",
};
}
Expand Down
6 changes: 3 additions & 3 deletions app-back/Services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { abstractServices } from "./abstract";
import EqualGamesScanner from "./Scanner/equalGames";
import LocalStorage from "./Storage/local";
import WindowsEmulatorManager from "./Emulator/windows";
import SmokeMetadata from "./Metadata/smoke";
import IGDBMetadata from "./Metadata/igdb";
import WindowsModManager from "./Mods/windows";
import AccountManager from "./Account/smoke";
import WindowsController from "./Controller/windows";
Expand All @@ -21,7 +21,7 @@ export const availableServices = {
},
Metadata: {
abstract: abstractServices.Metadata,
Smoke: SmokeMetadata,
IGDB: IGDBMetadata,
},
Mods: {
abstract: abstractServices.Mods,
Expand Down Expand Up @@ -52,7 +52,7 @@ export const availableServices = {
export const defaultServices = {
Account: ['Smoke'],
Emulator: ['Windows'],
Metadata: ['Smoke'],
Metadata: ['IGDB'],
Mods: ['Windows'],
Scanner: ['EqualGames'],
Storage: ['Local'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"author": "Flare, Forge.",
"description": "all-in-one game launcher",
"license": "CC-BY-SA-4.0",
"version": "0.0.9",
"version": "0.0.10",
"main": "./app-back/.build/index.js",
"scripts": {
" DEVELOPMENT SCRIPTS --------------": "",
Expand Down

0 comments on commit 0803110

Please sign in to comment.