feat: adding steam client icon cache

This commit is contained in:
Chubby Granny Chaser 2024-05-18 21:55:12 +01:00
parent e5fec91062
commit 19f022e0f6
No known key found for this signature in database
23 changed files with 184 additions and 145 deletions

View file

@ -1,5 +1,5 @@
import { stateManager } from "./state-manager";
import { repackersOn1337x } from "./constants";
import { repackersOn1337x, seedsPath } from "./constants";
import {
getNewGOGGames,
getNewRepacksFromUser,
@ -11,7 +11,6 @@ import {
import {
gameRepository,
repackRepository,
steamGameRepository,
userPreferencesRepository,
} from "./repository";
import { TorrentDownloader } from "./services";
@ -20,6 +19,8 @@ import { Notification } from "electron";
import { t } from "i18next";
import { GameStatus } from "@shared";
import { In } from "typeorm";
import fs from "node:fs";
import path from "node:path";
import { RealDebridClient } from "./services/real-debrid";
startProcessWatcher();
@ -69,18 +70,15 @@ const checkForNewRepacks = async (userPreferences: UserPreferences | null) => {
};
const loadState = async (userPreferences: UserPreferences | null) => {
const [repacks, steamGames] = await Promise.all([
repackRepository.find({
order: {
createdAt: "desc",
},
}),
steamGameRepository.find({
order: {
name: "asc",
},
}),
]);
const repacks = await repackRepository.find({
order: {
createdAt: "desc",
},
});
const steamGames = JSON.parse(
fs.readFileSync(path.join(seedsPath, "steam-games.json"), "utf-8")
);
stateManager.setValue("repacks", repacks);
stateManager.setValue("steamGames", steamGames);