mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 00:33:49 +03:00
revert: partially revert changes in getStatus
This commit is contained in:
parent
6295637b48
commit
e8fc71b36b
@ -16,8 +16,9 @@ import {
|
||||
StartDownloadPayload,
|
||||
PauseDownloadPayload,
|
||||
LibtorrentStatus,
|
||||
LibtorrentPayload,
|
||||
ProcessPayload,
|
||||
LibtorrentSeedingPayload,
|
||||
LibtorrentDownloadingPayload,
|
||||
} from "./types";
|
||||
import { pythonInstanceLogger as logger } from "../logger";
|
||||
|
||||
@ -61,15 +62,17 @@ export class PythonInstance {
|
||||
}
|
||||
|
||||
public static async getSeedingList() {
|
||||
const response = await this.rpc.get<LibtorrentPayload>("/seed-list");
|
||||
const response = await this.rpc.get<LibtorrentSeedingPayload[] | null>(
|
||||
"/seed-list"
|
||||
);
|
||||
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public static async getStatus() {
|
||||
const response = await this.rpc.get<LibtorrentPayload | null>("/status");
|
||||
const response = await this.rpc.get<LibtorrentDownloadingPayload | null>("/status");
|
||||
|
||||
if (response.data?.downloading) {
|
||||
if (response.data) {
|
||||
try {
|
||||
const {
|
||||
progress,
|
||||
@ -81,7 +84,7 @@ export class PythonInstance {
|
||||
folderName,
|
||||
status,
|
||||
gameId,
|
||||
} = response.data.downloading;
|
||||
} = response.data;
|
||||
|
||||
this.downloadingGameId = gameId;
|
||||
|
||||
|
@ -20,7 +20,7 @@ export enum LibtorrentStatus {
|
||||
Seeding = 5,
|
||||
}
|
||||
|
||||
export interface LibtorrentGamePayload {
|
||||
export interface LibtorrentDownloadingPayload {
|
||||
progress: number;
|
||||
numPeers: number;
|
||||
numSeeds: number;
|
||||
@ -32,11 +32,6 @@ export interface LibtorrentGamePayload {
|
||||
gameId: number;
|
||||
}
|
||||
|
||||
export interface LibtorrentPayload {
|
||||
downloading?: LibtorrentGamePayload;
|
||||
seeding: LibtorrentGamePayload[];
|
||||
}
|
||||
|
||||
export interface LibtorrentSeedingPayload {
|
||||
progress: number;
|
||||
numPeers: number;
|
||||
|
Loading…
Reference in New Issue
Block a user