fix(watchlist): disable Jellyseerr's watchlist for Plex users (#1398)

This PR resolves a conflict between the Plex and Jellyseerr watchlists by deactivating the
Jellyseerr watchlist for Plex.

fix #1344
This commit is contained in:
Gauthier
2025-02-26 10:47:11 +01:00
committed by GitHub
parent 27112be933
commit 4eddbaa71b
4 changed files with 111 additions and 101 deletions

View File

@@ -837,7 +837,8 @@ discoverRoutes.get<Record<string, unknown>, WatchlistResponse>(
select: ['id', 'plexToken'],
});
if (activeUser) {
if (activeUser && !activeUser?.plexToken) {
// Non-Plex users can only see their own watchlist
const [result, total] = await getRepository(Watchlist).findAndCount({
where: { requestedBy: { id: activeUser?.id } },
relations: {
@@ -866,6 +867,7 @@ discoverRoutes.get<Record<string, unknown>, WatchlistResponse>(
});
}
// List watchlist from Plex
const plexTV = new PlexTvAPI(activeUser.plexToken);
const watchlist = await plexTV.getWatchlist({ offset });