From 685cb449b163ab99361e8e4ecad7850d65f552bd Mon Sep 17 00:00:00 2001 From: fallenbagel <98979876+fallenbagel@users.noreply.github.com> Date: Wed, 1 Apr 2026 21:07:34 +0800 Subject: [PATCH] refactor(watchlistsync): log media request creation after success instead of before (#2790) --- server/lib/watchlistsync.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/lib/watchlistsync.ts b/server/lib/watchlistsync.ts index c6bf7f21..550a6524 100644 --- a/server/lib/watchlistsync.ts +++ b/server/lib/watchlistsync.ts @@ -115,12 +115,6 @@ class WatchlistSync { for (const mediaItem of unavailableItems) { try { - logger.info("Creating media request from user's Plex Watchlist", { - label: 'Watchlist Sync', - userId: user.id, - mediaTitle: mediaItem.title, - }); - if (mediaItem.type === 'show' && !mediaItem.tvdbId) { throw new Error('Missing TVDB ID from Plex Metadata'); } @@ -156,6 +150,12 @@ class WatchlistSync { user, { isAutoRequest: true } ); + + logger.info("Created media request from user's Plex Watchlist", { + label: 'Watchlist Sync', + userId: user.id, + mediaTitle: mediaItem.title, + }); } catch (e) { if (!(e instanceof Error)) { continue;