mirror of
https://github.com/fallenbagel/jellyseerr.git
synced 2025-12-24 02:39:18 -05:00
Compare commits
1 Commits
preview-se
...
preview-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca9074b111 |
@@ -277,9 +277,18 @@ class PlexTvAPI extends ExternalAPI {
|
||||
}> {
|
||||
try {
|
||||
const watchlistCache = cacheManager.getCache('plexwatchlist');
|
||||
logger.debug('Fetching watchlist from Plex.TV', {
|
||||
offset,
|
||||
size,
|
||||
label: 'Plex.TV Metadata API',
|
||||
});
|
||||
let cachedWatchlist = watchlistCache.data.get<PlexWatchlistCache>(
|
||||
this.authToken
|
||||
);
|
||||
logger.debug(`Found cached watchlist: ${!!cachedWatchlist}`, {
|
||||
cachedWatchlist,
|
||||
label: 'Plex.TV Metadata API',
|
||||
});
|
||||
|
||||
const response = await this.axios.get<WatchlistResponse>(
|
||||
'/library/sections/watchlist/all',
|
||||
@@ -296,6 +305,10 @@ class PlexTvAPI extends ExternalAPI {
|
||||
}
|
||||
);
|
||||
|
||||
logger.debug(`Watchlist fetch returned status ${response.status}`, {
|
||||
label: 'Plex.TV Metadata API',
|
||||
});
|
||||
|
||||
// If we don't recieve HTTP 304, the watchlist has been updated and we need to update the cache.
|
||||
if (response.status >= 200 && response.status <= 299) {
|
||||
cachedWatchlist = {
|
||||
|
||||
Reference in New Issue
Block a user