diff --git a/server/lib/availabilitySync.ts b/server/lib/availabilitySync.ts index 38f3fa384..f5bb3affd 100644 --- a/server/lib/availabilitySync.ts +++ b/server/lib/availabilitySync.ts @@ -45,7 +45,7 @@ class AvailabilitySync { if (admin?.plexToken) { this.plexClient = new PlexAPI({ plexToken: admin.plexToken }); } else { - logger.error('An admin is not configured.'); + logger.warn('Plex is not configured. Skipping availability sync.'); } for await (const media of this.loadAvailableMediaPaginated(pageSize)) { diff --git a/server/lib/watchlistsync.ts b/server/lib/watchlistsync.ts index 0fd90f64d..9fdbcdcd8 100644 --- a/server/lib/watchlistsync.ts +++ b/server/lib/watchlistsync.ts @@ -17,6 +17,18 @@ class WatchlistSync { public async syncWatchlist() { const userRepository = getRepository(User); + const admin = await userRepository.findOne({ + select: { id: true, plexToken: true }, + where: { id: 1 }, + }); + + if (!admin?.plexToken) { + logger.warn('Skipping watchlist sync for admin without plex token', { + label: 'Plex Watchlist Sync', + }); + return; + } + // Get users who actually have plex tokens const users = await userRepository .createQueryBuilder('user') diff --git a/src/components/IssueDetails/index.tsx b/src/components/IssueDetails/index.tsx index 171f90a81..da5e58cb7 100644 --- a/src/components/IssueDetails/index.tsx +++ b/src/components/IssueDetails/index.tsx @@ -8,6 +8,7 @@ import IssueComment from '@app/components/IssueDetails/IssueComment'; import IssueDescription from '@app/components/IssueDetails/IssueDescription'; import { issueOptions } from '@app/components/IssueModal/constants'; import useDeepLinks from '@app/hooks/useDeepLinks'; +import useSettings from '@app/hooks/useSettings'; import { Permission, useUser } from '@app/hooks/useUser'; import globalMessages from '@app/i18n/globalMessages'; import Error from '@app/pages/_error'; @@ -76,6 +77,7 @@ const isMovie = (movie: MovieDetails | TvDetails): movie is MovieDetails => { const IssueDetails = () => { const { addToast } = useToasts(); + const { currentSettings } = useSettings(); const router = useRouter(); const intl = useIntl(); const [showDeleteModal, setShowDeleteModal] = useState(false); @@ -361,7 +363,7 @@ const IssueDetails = () => {
- {issueData?.media.plexUrl && ( + {currentSettings.plexLoginEnabled && issueData?.media.plexUrl && (
- {issueData?.media.plexUrl && ( + {currentSettings.plexLoginEnabled && issueData?.media.plexUrl && (