Added methods to modify download state

Added missing optionalJwt calls in several routes
This commit is contained in:
Isaac Abadi
2021-08-10 21:32:13 -06:00
parent ecef8842ae
commit ebfa49240c
7 changed files with 245 additions and 51 deletions

View File

@@ -413,24 +413,38 @@ export class PostsService implements CanActivate {
return this.http.post(this.path + 'getSubscriptions', {}, this.httpOptions);
}
// current downloads
getCurrentDownloads() {
return this.http.get(this.path + 'downloads', this.httpOptions);
}
// current download
getCurrentDownload(download_uid) {
return this.http.post(this.path + 'download', {download_uid: download_uid}, this.httpOptions);
}
// clear downloads. download_id is optional, if it exists only 1 download will be cleared
clearDownloads(delete_all = false, session_id = null, download_id = null) {
return this.http.post(this.path + 'clearDownloads', {delete_all: delete_all,
download_id: download_id,
session_id: session_id ? session_id : this.session_id}, this.httpOptions);
pauseDownload(download_uid) {
return this.http.post(this.path + 'pauseDownload', {download_uid: download_uid}, this.httpOptions);
}
resumeDownload(download_uid) {
return this.http.post(this.path + 'resumeDownload', {download_uid: download_uid}, this.httpOptions);
}
restartDownload(download_uid) {
return this.http.post(this.path + 'restartDownload', {download_uid: download_uid}, this.httpOptions);
}
cancelDownload(download_uid) {
return this.http.post(this.path + 'cancelDownload', {download_uid: download_uid}, this.httpOptions);
}
clearDownload(download_uid) {
return this.http.post(this.path + 'clearDownload', {download_uid: download_uid}, this.httpOptions);
}
clearFinishedDownloads() {
return this.http.post(this.path + 'clearFinishedDownloads', {}, this.httpOptions);
}
// updates the server to the latest version
updateServer(tag) {
return this.http.post(this.path + 'updateServer', {tag: tag}, this.httpOptions);
}