From 048fa967f2e5b23831ac9917c703934c50ef75f0 Mon Sep 17 00:00:00 2001 From: David Fernandez Alcoba Date: Sat, 5 Aug 2023 11:56:07 +0200 Subject: [PATCH] fix: multiple notifications for available media --- server/job/jellyfinsync/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/job/jellyfinsync/index.ts b/server/job/jellyfinsync/index.ts index dff1ea479..2f73b4b03 100644 --- a/server/job/jellyfinsync/index.ts +++ b/server/job/jellyfinsync/index.ts @@ -311,13 +311,15 @@ class JobJellyfinSync { // setting the status to AVAILABLE if all of a type is there, partially if some, // and then not modifying the status if there are 0 items existingSeason.status = - totalStandard >= season.episode_count + totalStandard >= season.episode_count || + existingSeason.status === MediaStatus.AVAILABLE ? MediaStatus.AVAILABLE : totalStandard > 0 ? MediaStatus.PARTIALLY_AVAILABLE : existingSeason.status; existingSeason.status4k = - this.enable4kShow && total4k >= season.episode_count + (this.enable4kShow && total4k >= season.episode_count) || + existingSeason.status === MediaStatus.AVAILABLE ? MediaStatus.AVAILABLE : this.enable4kShow && total4k > 0 ? MediaStatus.PARTIALLY_AVAILABLE