From dc5f964211f80842a433885346066aea10605f2a Mon Sep 17 00:00:00 2001 From: lardbit Date: Fri, 16 Aug 2024 08:57:24 -0500 Subject: [PATCH] create quality profiles --- src/frontend/src/app/api.service.ts | 9 ++++ .../settings/quality-profiles.component.html | 3 ++ .../settings/quality-profiles.component.ts | 46 +++++++++++++------ .../migrations/0096_auto_20240816_1352.py | 23 ++++++++++ .../migrations/0097_auto_20240816_1353.py | 23 ++++++++++ src/nefarious/models.py | 7 +-- 6 files changed, 95 insertions(+), 16 deletions(-) create mode 100644 src/nefarious/migrations/0096_auto_20240816_1352.py create mode 100644 src/nefarious/migrations/0097_auto_20240816_1353.py diff --git a/src/frontend/src/app/api.service.ts b/src/frontend/src/app/api.service.ts index 3694c3f5..1a22e7be 100644 --- a/src/frontend/src/app/api.service.ts +++ b/src/frontend/src/app/api.service.ts @@ -379,6 +379,15 @@ export class ApiService { ); } + public createQualityProfile(data: any): Observable { + return this.http.post(this.API_URL_QUALITY_PROFILES, data, {headers: this._requestHeaders()}).pipe( + map((data: any) => { + // append this new quality profile + this.qualityProfiles.push(data); + }), + ); + } + public searchTorrents(query: string, mediaType: string): Observable { return this.http.get(`${this.API_URL_SEARCH_TORRENTS}?q=${query}&media_type=${mediaType}`, {headers: this._requestHeaders()}).pipe( map((data: any) => { diff --git a/src/frontend/src/app/settings/quality-profiles.component.html b/src/frontend/src/app/settings/quality-profiles.component.html index a080e1ed..e17c1439 100644 --- a/src/frontend/src/app/settings/quality-profiles.component.html +++ b/src/frontend/src/app/settings/quality-profiles.component.html @@ -4,6 +4,9 @@