youtube-dl refactor (#956)

* Consolidated all youtube-dl calls into one function
* Downloads can now be cancelled and better "paused"
* Removed node-youtube-dl dependency
* Added ability to manually check a subscription, and to cancel a subscription check

---------

Co-authored-by: Dedy Martadinata S <dedyms@proton.me>
This commit is contained in:
Tzahi12345
2023-11-27 12:55:53 -05:00
committed by GitHub
parent 99c5cf590e
commit 0565cf24a6
23 changed files with 653 additions and 332 deletions

View File

@@ -113,7 +113,8 @@ import {
Archive,
Subscription,
RestartDownloadResponse,
TaskType
TaskType,
CheckSubscriptionRequest
} from '../api-types';
import { isoLangs } from './dialogs/user-profile-dialog/locales_list';
import { Title } from '@angular/platform-browser';
@@ -566,8 +567,18 @@ export class PostsService implements CanActivate {
return this.http.post<SuccessObject>(this.path + 'updateSubscription', {subscription: subscription}, this.httpOptions);
}
unsubscribe(sub: SubscriptionRequestData, deleteMode = false) {
const body: UnsubscribeRequest = {sub: sub, deleteMode: deleteMode};
checkSubscription(sub_id: string) {
const body: CheckSubscriptionRequest = {sub_id: sub_id};
return this.http.post<SuccessObject>(this.path + 'checkSubscription', body, this.httpOptions);
}
cancelCheckSubscription(sub_id: string) {
const body: CheckSubscriptionRequest = {sub_id: sub_id};
return this.http.post<SuccessObject>(this.path + 'cancelCheckSubscription', body, this.httpOptions);
}
unsubscribe(sub_id: string, deleteMode = false) {
const body: UnsubscribeRequest = {sub_id: sub_id, deleteMode: deleteMode};
return this.http.post<UnsubscribeResponse>(this.path + 'unsubscribe', body, this.httpOptions)
}