feat: adding import download source

This commit is contained in:
Chubby Granny Chaser 2024-06-03 02:12:05 +01:00
parent ddd9ea69df
commit 48e07370e4
No known key found for this signature in database
70 changed files with 925 additions and 1261 deletions

View file

@ -1,30 +1,14 @@
import { gameRepository } from "@main/repository";
import { searchRepacks } from "../helpers/search-games";
import { registerEvent } from "../register-event";
import { sortBy } from "lodash-es";
const getLibrary = async () =>
gameRepository
.find({
where: {
isDeleted: false,
},
order: {
createdAt: "desc",
},
relations: {
repack: true,
},
})
.then((games) =>
sortBy(
games.map((game) => ({
...game,
repacks: searchRepacks(game.title),
})),
(game) => (game.status !== "removed" ? 0 : 1)
)
);
gameRepository.find({
where: {
isDeleted: false,
},
order: {
createdAt: "desc",
},
});
registerEvent("getLibrary", getLibrary);