Merge branch 'main' into feature/aria2-for-http-downloads

This commit is contained in:
Chubby Granny Chaser 2024-07-03 20:30:52 +01:00 committed by GitHub
commit 26aad178ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 142 additions and 153 deletions

View file

@ -1,6 +1,6 @@
import { Game } from "@main/entity";
import { Downloader } from "@shared";
import { TorrentDownloader } from "./torrent-downloader";
import { PythonInstance } from "./python-instance";
import { WindowManager } from "../window-manager";
import { downloadQueueRepository, gameRepository } from "@main/repository";
import { publishDownloadCompleteNotification } from "../notifications";
@ -16,7 +16,7 @@ export class DownloadManager {
if (this.currentDownloader === Downloader.RealDebrid) {
status = await RealDebridDownloader.getStatus();
} else {
status = await TorrentDownloader.getStatus();
status = await PythonInstance.getStatus();
}
if (status) {
@ -65,7 +65,7 @@ export class DownloadManager {
if (this.currentDownloader === Downloader.RealDebrid) {
await RealDebridDownloader.pauseDownload();
} else {
await TorrentDownloader.pauseDownload();
await PythonInstance.pauseDownload();
}
WindowManager.mainWindow?.setProgressBar(-1);
@ -77,7 +77,7 @@ export class DownloadManager {
RealDebridDownloader.startDownload(game);
this.currentDownloader = Downloader.RealDebrid;
} else {
TorrentDownloader.startDownload(game);
PythonInstance.startDownload(game);
this.currentDownloader = Downloader.Torrent;
}
}
@ -86,7 +86,7 @@ export class DownloadManager {
if (this.currentDownloader === Downloader.RealDebrid) {
RealDebridDownloader.cancelDownload(gameId);
} else {
TorrentDownloader.cancelDownload(gameId);
PythonInstance.cancelDownload(gameId);
}
WindowManager.mainWindow?.setProgressBar(-1);
@ -98,7 +98,7 @@ export class DownloadManager {
RealDebridDownloader.startDownload(game);
this.currentDownloader = Downloader.RealDebrid;
} else {
TorrentDownloader.startDownload(game);
PythonInstance.startDownload(game);
this.currentDownloader = Downloader.Torrent;
}
}