···12121313# Backend URL(s) - can be a single URL or comma-separated list (e.g., "https://server1.com,https://server2.com,https://server3.com")
1414VITE_BACKEND_URL=https://server1.com,https://server2.com,https://server3.com
1515+1616+# Trakt integration setup. Get these at https://trakt.tv/oauth/applications
1717+VITE_TRAKT_CLIENT_ID=
1818+VITE_TRAKT_CLIENT_SECRET=
+46
src/backend/metadata/tmdb.ts
···474474 if (posterPath) return imgUrl;
475475}
476476477477+/**
478478+ * Fetches the poster URL for a movie or show from TMDB by ID.
479479+ * Use this when importing from external sources (e.g. Trakt) that may not have poster URLs.
480480+ */
481481+export async function getPosterForMedia(
482482+ tmdbId: string,
483483+ type: "movie" | "show",
484484+): Promise<string | undefined> {
485485+ try {
486486+ const tmdbType =
487487+ type === "movie" ? TMDBContentTypes.MOVIE : TMDBContentTypes.TV;
488488+ const details = await getMediaDetails(tmdbId, tmdbType, false);
489489+ const posterPath =
490490+ (details as TMDBMovieData | TMDBShowData).poster_path ?? null;
491491+ return getMediaPoster(posterPath);
492492+ } catch {
493493+ return undefined;
494494+ }
495495+}
496496+477497export async function getCollectionDetails(collectionId: number): Promise<any> {
478498 return get<any>(`/collection/${collectionId}`);
479499}
···491511 still_path: e.still_path,
492512 overview: e.overview,
493513 }));
514514+}
515515+516516+/**
517517+ * Resolve TMDB season and episode IDs for a show. Use when external sources
518518+ * (e.g. Trakt) only provide season/episode numbers.
519519+ */
520520+export async function getEpisodeIds(
521521+ showTmdbId: string,
522522+ seasonNumber: number,
523523+ episodeNumber: number,
524524+): Promise<{ seasonId: string; episodeId: string } | null> {
525525+ try {
526526+ const data = await get<TMDBSeason>(
527527+ `/tv/${showTmdbId}/season/${seasonNumber}`,
528528+ );
529529+ const episode = data.episodes.find(
530530+ (e) => e.episode_number === episodeNumber,
531531+ );
532532+ if (!episode) return null;
533533+ return {
534534+ seasonId: data.id.toString(),
535535+ episodeId: episode.id.toString(),
536536+ };
537537+ } catch {
538538+ return null;
539539+ }
494540}
495541496542export async function getMovieFromExternalId(