feat: adding new messages to hero panel

This commit is contained in:
Chubby Granny Chaser
2024-05-24 00:26:21 +01:00
parent a240c3ae24
commit d431c01d1b
28 changed files with 398 additions and 358 deletions

View File

@@ -10,7 +10,7 @@ const addGameToLibrary = async (
_event: Electron.IpcMainInvokeEvent,
objectID: string,
title: string,
gameShop: GameShop,
shop: GameShop,
executablePath: string | null
) => {
return gameRepository
@@ -19,7 +19,7 @@ const addGameToLibrary = async (
objectID,
},
{
shop: gameShop,
shop,
status: null,
executablePath,
isDeleted: false,
@@ -40,7 +40,7 @@ const addGameToLibrary = async (
title,
iconUrl,
objectID,
shop: gameShop,
shop,
executablePath,
})
.then(() => {

View File

@@ -1,33 +1,18 @@
import {
gameRepository,
repackRepository,
userPreferencesRepository,
} from "@main/repository";
import { gameRepository, repackRepository } from "@main/repository";
import { registerEvent } from "../register-event";
import type { GameShop } from "@types";
import type { StartGameDownloadPayload } from "@types";
import { getFileBase64, getSteamAppAsset } from "@main/helpers";
import { DownloadManager } from "@main/services";
import { Downloader } from "@shared";
import { stateManager } from "@main/state-manager";
import { Not } from "typeorm";
const startGameDownload = async (
_event: Electron.IpcMainInvokeEvent,
repackId: number,
objectID: string,
title: string,
gameShop: GameShop,
downloadPath: string
payload: StartGameDownloadPayload
) => {
const userPreferences = await userPreferencesRepository.findOne({
where: { id: 1 },
});
const downloader = userPreferences?.realDebridApiToken
? Downloader.RealDebrid
: Downloader.Torrent;
const { repackId, objectID, title, shop, downloadPath, downloader } = payload;
const [game, repack] = await Promise.all([
gameRepository.findOne({
@@ -83,7 +68,7 @@ const startGameDownload = async (
iconUrl,
objectID,
downloader,
shop: gameShop,
shop,
status: "active",
downloadPath,
repack: { id: repackId },