fix: request watchlist items sequentially to prevent bypassing quota (#3667)

pull/3196/head
Ryan Cohen 7 months ago committed by GitHub
parent 246887efa1
commit b40ba07a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -79,8 +79,7 @@ class WatchlistSync {
) )
); );
await Promise.all( for (const mediaItem of unavailableItems) {
unavailableItems.map(async (mediaItem) => {
try { try {
logger.info("Creating media request from user's Plex Watchlist", { logger.info("Creating media request from user's Plex Watchlist", {
label: 'Watchlist Sync', label: 'Watchlist Sync',
@ -108,7 +107,7 @@ class WatchlistSync {
!user.settings?.watchlistSyncTv) && !user.settings?.watchlistSyncTv) &&
mediaItem.type === 'show') mediaItem.type === 'show')
) { ) {
return; continue;
} }
await MediaRequest.request( await MediaRequest.request(
@ -125,7 +124,7 @@ class WatchlistSync {
); );
} catch (e) { } catch (e) {
if (!(e instanceof Error)) { if (!(e instanceof Error)) {
return; continue;
} }
switch (e.constructor) { switch (e.constructor) {
@ -153,8 +152,7 @@ class WatchlistSync {
}); });
} }
} }
}) }
);
} }
} }

Loading…
Cancel
Save