Pass back peers from Web UI when adding a magnet in attempt to speed it up
This commit is contained in:
parent
21b1bd9e7d
commit
f337ab1837
8 changed files with 77 additions and 27 deletions
|
|
@ -22,6 +22,7 @@ export interface TorrentDetails {
|
|||
export interface AddTorrentResponse {
|
||||
id: number | null;
|
||||
details: TorrentDetails;
|
||||
seen_peers?: Array<string>;
|
||||
}
|
||||
|
||||
export interface ListTorrentsResponse {
|
||||
|
|
@ -147,7 +148,10 @@ export const API = {
|
|||
},
|
||||
|
||||
uploadTorrent: (data: string | File, opts?: {
|
||||
listOnly?: boolean, selectedFiles?: Array<number>, unpopularTorrent?: boolean,
|
||||
listOnly?: boolean,
|
||||
selectedFiles?: Array<number>,
|
||||
unpopularTorrent?: boolean,
|
||||
initialPeers?: Array<string>,
|
||||
}): Promise<AddTorrentResponse> => {
|
||||
opts = opts || {};
|
||||
let url = '/torrents?&overwrite=true';
|
||||
|
|
@ -160,6 +164,9 @@ export const API = {
|
|||
if (opts.unpopularTorrent) {
|
||||
url += '&peer_connect_timeout=20&peer_read_write_timeout=60';
|
||||
}
|
||||
if (opts.initialPeers) {
|
||||
url += `&initial_peers=${opts.initialPeers.join(',')}`;
|
||||
}
|
||||
return makeRequest('POST', url, data)
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue