From 1f2c5a0238cce423da56d53612bc89f8967bbd2f Mon Sep 17 00:00:00 2001 From: Tzahi12345 Date: Sat, 1 Apr 2023 18:59:23 -0400 Subject: [PATCH] Fixed an issue where subs would only display 10 of their videos in the subscription component (#851) Fixed an issue where a sub would get stuck in the downloading state Fixed UI bug in the subscriptions component --- backend/subscriptions.js | 3 ++- src/app/components/recent-videos/recent-videos.component.ts | 2 +- .../subscription/subscription/subscription.component.html | 5 +++-- .../subscription/subscription/subscription.component.scss | 3 +++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/backend/subscriptions.js b/backend/subscriptions.js index b957d68..64d6c3c 100644 --- a/backend/subscriptions.js +++ b/backend/subscriptions.js @@ -432,7 +432,8 @@ async function getAllSubscriptions() { } async function getSubscription(subID) { - const sub = await db_api.getRecord('subscriptions', {id: subID}); + // stringify and parse because we may override the 'downloading' property + const sub = JSON.parse(JSON.stringify(await db_api.getRecord('subscriptions', {id: subID}))); // now with the download_queue, we may need to override 'downloading' const current_downloads = await db_api.getRecords('download_queue', {running: true, sub_id: sub.id}, true); if (!sub['downloading']) sub['downloading'] = current_downloads > 0; diff --git a/src/app/components/recent-videos/recent-videos.component.ts b/src/app/components/recent-videos/recent-videos.component.ts index 1231eb8..c7e716f 100644 --- a/src/app/components/recent-videos/recent-videos.component.ts +++ b/src/app/components/recent-videos/recent-videos.component.ts @@ -215,7 +215,7 @@ export class RecentVideosComponent implements OnInit { const range = [current_file_index, current_file_index + this.pageSize]; const fileTypeFilter = this.getFileTypeFilter(); const favoriteFilter = this.getFavoriteFilter(); - this.postsService.getAllFiles(sort, range, this.search_mode ? this.search_text : null, fileTypeFilter as FileTypeFilter, favoriteFilter, this.sub_id).subscribe(res => { + this.postsService.getAllFiles(sort, this.usePaginator ? range : null, this.search_mode ? this.search_text : null, fileTypeFilter as FileTypeFilter, favoriteFilter, this.sub_id).subscribe(res => { this.file_count = res['file_count']; this.paged_data = res['files']; for (let i = 0; i < this.paged_data.length; i++) { diff --git a/src/app/subscription/subscription/subscription.component.html b/src/app/subscription/subscription/subscription.component.html index fa0172a..661279a 100644 --- a/src/app/subscription/subscription/subscription.component.html +++ b/src/app/subscription/subscription/subscription.component.html @@ -9,8 +9,9 @@
-
- + +
+
diff --git a/src/app/subscription/subscription/subscription.component.scss b/src/app/subscription/subscription/subscription.component.scss index 373c448..d82a706 100644 --- a/src/app/subscription/subscription/subscription.component.scss +++ b/src/app/subscription/subscription/subscription.component.scss @@ -62,15 +62,18 @@ left: 25px; position: fixed; bottom: 25px; + z-index: 99999; } .save-icon { bottom: 1px; position: relative; + z-index: 99999; } .watch-button { left: 90px; position: fixed; bottom: 25px; + z-index: 99999; } \ No newline at end of file