feat: adding dexie

This commit is contained in:
Chubby Granny Chaser 2024-09-22 17:43:05 +01:00
parent ddd6ff7dbe
commit f860439fb5
No known key found for this signature in database
25 changed files with 311 additions and 345 deletions

View file

@ -1,14 +1,14 @@
import { DownloadManager, PythonInstance, startMainLoop } from "./services";
import {
downloadQueueRepository,
repackRepository,
// repackRepository,
userPreferencesRepository,
} from "./repository";
import { UserPreferences } from "./entity";
import { RealDebridClient } from "./services/real-debrid";
import { fetchDownloadSourcesAndUpdate } from "./helpers";
import { publishNewRepacksNotifications } from "./services/notifications";
import { MoreThan } from "typeorm";
// import { fetchDownloadSourcesAndUpdate } from "./helpers";
// import { publishNewRepacksNotifications } from "./services/notifications";
// import { MoreThan } from "typeorm";
import { HydraApi } from "./services/hydra-api";
import { uploadGamesBatch } from "./services/library-sync";
@ -40,17 +40,17 @@ const loadState = async (userPreferences: UserPreferences | null) => {
startMainLoop();
const now = new Date();
// const now = new Date();
fetchDownloadSourcesAndUpdate().then(async () => {
const newRepacksCount = await repackRepository.count({
where: {
createdAt: MoreThan(now),
},
});
// fetchDownloadSourcesAndUpdate().then(async () => {
// const newRepacksCount = await repackRepository.count({
// where: {
// createdAt: MoreThan(now),
// },
// });
if (newRepacksCount > 0) publishNewRepacksNotifications(newRepacksCount);
});
// if (newRepacksCount > 0) publishNewRepacksNotifications(newRepacksCount);
// });
};
userPreferencesRepository