+ {/* Breadcrumb */}
+
+ {view !== 'series' ? (
+
+ ) : (
+ All Series
+ )}
+ {selectedSeries && (
+ <>
+ /
+ {view === 'episodes' ? (
+
+ ) : (
+
+ {selectedSeries.title}
+
+ )}
+ >
+ )}
+ {selectedSeason && (
+ <>
+ /
+
+ {selectedSeason.title}
+
+ >
+ )}
+
+
+ {view === 'series' && (
+
+
+
+
+
+ {loading ? (
+
+ ) : error ? (
+
+ ) : series.length === 0 ? (
+
+
No TV shows found
+
Each series should be a folder containing season subdirectories with video files.
+
+ ) : (
+
+ {filteredSeries.map((s) => (
+
+ ))}
+
+ )}
+
+
+ )}
+
+ {view === 'seasons' && selectedSeries && (
+
+ {/* Series info header */}
+
+ {selectedSeries.posterUrl && (
+ // eslint-disable-next-line @next/next/no-img-element
+

+ )}
+
+
{selectedSeries.title}
+ {(selectedSeries.year || selectedSeries.genres.length > 0) && (
+
+ {selectedSeries.year && {selectedSeries.year}}
+ {selectedSeries.genres.map((g) => (
+ {g}
+ ))}
+
+ )}
+ {selectedSeries.plot && (
+
{selectedSeries.plot}
+ )}
+
+ {/* Delete series button */}
+
+ {confirming && (
+
+ )}
+
+
+
+
+ {loading ? (
+
+ ) : error ? (
+
+ ) : seasons.length === 0 ? (
+
+ No seasons found.
+
+ ) : (
+
+ {seasons.map((season) => (
+
+ ))}
+
+ )}
+
+ )}
+
+ {view === 'episodes' && selectedSeason && (
+
+ {loading ? (
+
+ ) : error ? (
+
+ ) : episodes.length === 0 ? (
+
+ No episodes found.
+
+ ) : (
+
+ {episodes.map((ep) => (
+ setPlayingEpisode(ep)}
+ />
+ ))}
+
+ )}
+
+ )}
+
+ )
+}
+
+function ErrorMsg({ message }: { message: string }) {
+ return (
+