feat: use main-loop to watch seeding list

This commit is contained in:
Hachi-R
2024-11-06 19:10:13 -03:00
parent cd4715e00d
commit e0f7f34d14
9 changed files with 67 additions and 12 deletions

View File

@@ -60,14 +60,15 @@ export class PythonInstance {
);
}
public static async getStatus() {
if (this.downloadingGameId === -1) return null;
public static async getSeedingList() {
const response = await this.rpc.get<LibtorrentPayload | null>("/status");
if (response.data === null) return null;
return response.data?.seeding || [];
}
console.log(response.data);
public static async getStatus() {
const response = await this.rpc.get<LibtorrentPayload | null>("/status");
if (response.data?.downloading === null) return null;
try {
const {
@@ -80,7 +81,7 @@ export class PythonInstance {
folderName,
status,
gameId,
} = response.data;
} = response.data?.downloading!;
this.downloadingGameId = gameId;