feat: adding notification when all repacks are migrated

This commit is contained in:
Chubby Granny Chaser 2024-09-27 03:27:02 +01:00
parent d88e06e289
commit 17febcd88a
No known key found for this signature in database
31 changed files with 308 additions and 390 deletions

View file

@ -3,7 +3,6 @@ import { gameRepository } from "@main/repository";
import { registerEvent } from "../register-event";
import type { GameShop } from "@types";
import { getFileBase64 } from "@main/helpers";
import { steamGamesWorker } from "@main/workers";
import { createGame } from "@main/services/library-sync";
@ -36,20 +35,12 @@ const addGameToLibrary = async (
? steamUrlBuilder.icon(objectID, steamGame.clientIcon)
: null;
await gameRepository
.insert({
title,
iconUrl,
objectID,
shop,
})
.then(() => {
if (iconUrl) {
getFileBase64(iconUrl).then((base64) =>
gameRepository.update({ objectID }, { iconUrl: base64 })
);
}
});
await gameRepository.insert({
title,
iconUrl,
objectID,
shop,
});
}
const game = await gameRepository.findOne({ where: { objectID } });