From 0bb6c65c28b172208c6bfb63413d31ed021f460f Mon Sep 17 00:00:00 2001 From: Ryan Cohen Date: Wed, 17 Aug 2022 13:06:07 +0900 Subject: [PATCH] fix: filter out season requests that are not unknown status --- server/entity/MediaRequest.ts | 6 ++---- server/lib/watchlistsync.ts | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/entity/MediaRequest.ts b/server/entity/MediaRequest.ts index a02733964..3cf653e35 100644 --- a/server/entity/MediaRequest.ts +++ b/server/entity/MediaRequest.ts @@ -249,10 +249,8 @@ export class MediaRequest { ...media.seasons .filter( (season) => - season[requestBody.is4k ? 'status4k' : 'status'] === - MediaStatus.AVAILABLE || - season[requestBody.is4k ? 'status4k' : 'status'] === - MediaStatus.PARTIALLY_AVAILABLE + season[requestBody.is4k ? 'status4k' : 'status'] !== + MediaStatus.UNKNOWN ) .map((season) => season.seasonNumber), ]; diff --git a/server/lib/watchlistsync.ts b/server/lib/watchlistsync.ts index aa3332b6b..c1092f54e 100644 --- a/server/lib/watchlistsync.ts +++ b/server/lib/watchlistsync.ts @@ -26,7 +26,9 @@ class WatchlistSync { }, }); - Promise.all(users.map((user) => this.syncUserWatchlist(user))); + for (const user of users) { + await this.syncUserWatchlist(user); + } } private async syncUserWatchlist(user: User) {