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

pull/3196/head
Ryan Cohen 1 year 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(
unavailableItems.map(async (mediaItem) => {
for (const mediaItem of unavailableItems) {
try {
logger.info("Creating media request from user's Plex Watchlist", {
label: 'Watchlist Sync',
@ -108,7 +107,7 @@ class WatchlistSync {
!user.settings?.watchlistSyncTv) &&
mediaItem.type === 'show')
) {
return;
continue;
}
await MediaRequest.request(
@ -125,7 +124,7 @@ class WatchlistSync {
);
} catch (e) {
if (!(e instanceof Error)) {
return;
continue;
}
switch (e.constructor) {
@ -153,8 +152,7 @@ class WatchlistSync {
});
}
}
})
);
}
}
}

Loading…
Cancel
Save