refactor(watchlistsync): log media request creation after success instead of before (#2790)
This commit is contained in:
@@ -115,12 +115,6 @@ class WatchlistSync {
|
|||||||
|
|
||||||
for (const mediaItem of unavailableItems) {
|
for (const mediaItem of unavailableItems) {
|
||||||
try {
|
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) {
|
if (mediaItem.type === 'show' && !mediaItem.tvdbId) {
|
||||||
throw new Error('Missing TVDB ID from Plex Metadata');
|
throw new Error('Missing TVDB ID from Plex Metadata');
|
||||||
}
|
}
|
||||||
@@ -156,6 +150,12 @@ class WatchlistSync {
|
|||||||
user,
|
user,
|
||||||
{ isAutoRequest: true }
|
{ isAutoRequest: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
logger.info("Created media request from user's Plex Watchlist", {
|
||||||
|
label: 'Watchlist Sync',
|
||||||
|
userId: user.id,
|
||||||
|
mediaTitle: mediaItem.title,
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (!(e instanceof Error)) {
|
if (!(e instanceof Error)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user