API: torrents: add "isSequential" torrent property

This commit is contained in:
Jesse Chan
2020-12-23 20:07:49 +08:00
parent 038ee3f7f1
commit 61b6b61569
9 changed files with 71 additions and 2 deletions

View File

@@ -21,6 +21,8 @@ export const addTorrentByURLSchema = object({
isBasePath: boolean().optional(),
// Whether destination contains completed contents [default: false]
isCompleted: boolean().optional(),
// Whether contents of a torrent should be downloaded sequentially [default: false]
isSequential: boolean().optional(),
// Whether to start torrent [default: false]
start: boolean().optional(),
});
@@ -39,6 +41,8 @@ export const addTorrentByFileSchema = object({
isBasePath: boolean().optional(),
// Whether destination contains completed contents [default: false]
isCompleted: boolean().optional(),
// Whether contents of a torrent should be downloaded sequentially [default: false]
isSequential: boolean().optional(),
// Whether to start torrent [default: false]
start: boolean().optional(),
});

View File

@@ -27,6 +27,8 @@ export interface TorrentProperties {
eta: number;
hash: string;
isPrivate: boolean;
// If sequential download is enabled
isSequential: boolean;
message: string;
name: string;
peersConnected: number;

View File

@@ -71,6 +71,14 @@ export interface SetTorrentsPriorityOptions {
priority: TorrentPriority;
}
// PATCH /api/torrents/sequential
export interface SetTorrentsSequentialOptions {
// An array of string representing hashes of torrents to operate on
hashes: Array<TorrentProperties['hash']>;
// If sequential download is enabled
isSequential: boolean;
}
// PATCH /api/torrents/trackers
export interface SetTorrentsTrackersOptions {
// An array of string representing hashes of torrents to operate on