feat: get seed status

This commit is contained in:
Hachi-R 2024-11-08 18:28:58 -03:00
parent 9c9c0e6c09
commit c556a00e4a
4 changed files with 26 additions and 0 deletions

View file

@ -123,6 +123,16 @@ export class PythonInstance {
}
}
public static async getSeedStatus() {
const response = await this.rpc.get<LibtorrentPayload[] | null>(
"/seed-status"
);
if (response.data === null) return [];
return response.data;
}
static async pauseDownload() {
await this.rpc
.post("/action", {

View file

@ -25,6 +25,7 @@ export interface LibtorrentPayload {
numPeers: number;
numSeeds: number;
downloadSpeed: number;
uploadSpeed: number;
bytesDownloaded: number;
fileSize: number;
folderName: string;

View file

@ -10,6 +10,7 @@ export const startMainLoop = async () => {
watchProcesses(),
DownloadManager.watchDownloads(),
AchievementWatcherManager.watchAchievements(),
DownloadManager.getSeedStatus(),
]);
await sleep(1500);