mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 08:43:57 +00:00
feat: add ablity to pause and resume the seeding process
This commit is contained in:
@@ -18,6 +18,8 @@ import {
|
||||
LibtorrentStatus,
|
||||
LibtorrentPayload,
|
||||
ProcessPayload,
|
||||
PauseSeedingPayload,
|
||||
ResumeSeedingPayload,
|
||||
} from "./types";
|
||||
import { pythonInstanceLogger as logger } from "../logger";
|
||||
|
||||
@@ -133,6 +135,26 @@ export class PythonInstance {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
static async pauseSeeding(gameId: number) {
|
||||
await this.rpc
|
||||
.post("/action", {
|
||||
action: "pause-seeding",
|
||||
game_id: gameId,
|
||||
} as PauseSeedingPayload)
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
static async resumeSeeding(gameId: number, magnet: string, savePath: string) {
|
||||
await this.rpc
|
||||
.post("/action", {
|
||||
action: "resume-seeding",
|
||||
game_id: gameId,
|
||||
magnet,
|
||||
save_path: savePath,
|
||||
} as ResumeSeedingPayload)
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
static async pauseDownload() {
|
||||
await this.rpc
|
||||
.post("/action", {
|
||||
|
||||
Reference in New Issue
Block a user