refactor(watchlistsync): log media request creation after success instead of before (#2790)

This commit is contained in:
fallenbagel
2026-04-01 21:07:34 +08:00
committed by GitHub
parent 036d000f26
commit 685cb449b1

View File

@@ -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;