Compare commits
1 Commits
main
...
preview-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca9074b111 |
@@ -277,9 +277,18 @@ class PlexTvAPI extends ExternalAPI {
|
|||||||
}> {
|
}> {
|
||||||
try {
|
try {
|
||||||
const watchlistCache = cacheManager.getCache('plexwatchlist');
|
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>(
|
let cachedWatchlist = watchlistCache.data.get<PlexWatchlistCache>(
|
||||||
this.authToken
|
this.authToken
|
||||||
);
|
);
|
||||||
|
logger.debug(`Found cached watchlist: ${!!cachedWatchlist}`, {
|
||||||
|
cachedWatchlist,
|
||||||
|
label: 'Plex.TV Metadata API',
|
||||||
|
});
|
||||||
|
|
||||||
const response = await this.axios.get<WatchlistResponse>(
|
const response = await this.axios.get<WatchlistResponse>(
|
||||||
'/library/sections/watchlist/all',
|
'/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 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) {
|
if (response.status >= 200 && response.status <= 299) {
|
||||||
cachedWatchlist = {
|
cachedWatchlist = {
|
||||||
|
|||||||
Reference in New Issue
Block a user