Normalize to double quotes across all files with Prettier
This commit is contained in:
1 parent
73bff72cec
commit
a5659cf4c8
190 files changed
+9523
-8859
No files matched your search
@@ -1,19 +1,24 @@
|
||||
import { useState } from 'react';
|
||||
import { useParams, Link } from 'react-router-dom';
|
||||
import { useSeason, useSeasonEpisodes } from '@/hooks/useSeasons';
|
||||
import { useEntry, useEntrySeasons } from '@/hooks/useEntries';
|
||||
import { useLibraryStore } from '@/stores/useLibraryStore';
|
||||
import { EpisodeSeenEditDialog } from '@/components/dialogs/EpisodeSeenEditDialog';
|
||||
import { MarkSeasonWatchedDialog } from '@/components/dialogs/MarkSeasonWatchedDialog';
|
||||
import { StreamingDialog } from '@/components/streaming/StreamingDialog';
|
||||
import { useStreamingStore } from '@/stores/useStreamingStore';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { Progress } from '@/components/ui/progress';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Eye, CheckCircle2, ListChecks, PlayCircle } from 'lucide-react';
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
|
||||
import { getTmdbPosterUrl, getYear, formatDate } from '@/lib/media-utils';
|
||||
import type { Episode, EpisodeSeen } from '@/types';
|
||||
import { useState } from "react";
|
||||
import { useParams, Link } from "react-router-dom";
|
||||
import { useSeason, useSeasonEpisodes } from "@/hooks/useSeasons";
|
||||
import { useEntry, useEntrySeasons } from "@/hooks/useEntries";
|
||||
import { useLibraryStore } from "@/stores/useLibraryStore";
|
||||
import { EpisodeSeenEditDialog } from "@/components/dialogs/EpisodeSeenEditDialog";
|
||||
import { MarkSeasonWatchedDialog } from "@/components/dialogs/MarkSeasonWatchedDialog";
|
||||
import { StreamingDialog } from "@/components/streaming/StreamingDialog";
|
||||
import { useStreamingStore } from "@/stores/useStreamingStore";
|
||||
import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Eye, CheckCircle2, ListChecks, PlayCircle } from "lucide-react";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
TooltipTrigger,
|
||||
} from "@/components/ui/tooltip";
|
||||
import { getTmdbPosterUrl, getYear, formatDate } from "@/lib/media-utils";
|
||||
import type { Episode, EpisodeSeen } from "@/types";
|
||||
|
||||
export function SeasonPage() {
|
||||
const { entryId, seasonId } = useParams<{
|
||||
@@ -24,7 +29,9 @@ export function SeasonPage() {
|
||||
const { data: episodes = [] } = useSeasonEpisodes(parseInt(seasonId!, 10));
|
||||
const { data: entry } = useEntry(parseInt(entryId!, 10));
|
||||
const { data: entrySeasons } = useEntrySeasons(parseInt(entryId!, 10));
|
||||
const entryTitle = entry?.title ?? useLibraryStore.getState().entries.get(parseInt(entryId!, 10))?.title;
|
||||
const entryTitle =
|
||||
entry?.title ??
|
||||
useLibraryStore.getState().entries.get(parseInt(entryId!, 10))?.title;
|
||||
const { initialize, play } = useStreamingStore();
|
||||
const [dialogEpisode, setDialogEpisode] = useState<Episode | null>(null);
|
||||
const [showMarkAllDialog, setShowMarkAllDialog] = useState(false);
|
||||
@@ -34,7 +41,7 @@ export function SeasonPage() {
|
||||
if (!entry?.entryIds?.tmdb_id) return;
|
||||
initialize();
|
||||
play({
|
||||
type: 'tv',
|
||||
type: "tv",
|
||||
tmdbId: entry.entryIds.tmdb_id,
|
||||
imdbId: entry.entryIds?.imdb_id || undefined,
|
||||
season,
|
||||
@@ -60,8 +67,7 @@ export function SeasonPage() {
|
||||
|
||||
const watchedCount = episodes.filter(
|
||||
(ep: Episode) =>
|
||||
ep.date_first_seen ||
|
||||
(ep.episodeSeens && ep.episodeSeens.length > 0)
|
||||
ep.date_first_seen || (ep.episodeSeens && ep.episodeSeens.length > 0),
|
||||
).length;
|
||||
const totalEpisodes = episodes.length;
|
||||
const progress = totalEpisodes > 0 ? (watchedCount / totalEpisodes) * 100 : 0;
|
||||
@@ -74,16 +80,18 @@ export function SeasonPage() {
|
||||
to={`/entry/${entryId}`}
|
||||
className="hover:text-foreground transition-colors truncate max-w-50"
|
||||
>
|
||||
{entryTitle || 'Entry'}
|
||||
{entryTitle || "Entry"}
|
||||
</Link>
|
||||
<span>/</span>
|
||||
<span className="text-foreground font-medium">Season {season.season_number}</span>
|
||||
<span className="text-foreground font-medium">
|
||||
Season {season.season_number}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/* Header */}
|
||||
<div className="flex flex-col gap-4 sm:flex-row sm:gap-6">
|
||||
<img
|
||||
src={getTmdbPosterUrl(season.poster_path, 'w185')}
|
||||
src={getTmdbPosterUrl(season.poster_path, "w185")}
|
||||
alt={season.name}
|
||||
className="h-40 w-28 shrink-0 rounded-lg object-cover shadow-lg self-center sm:self-start sm:h-56 sm:w-36"
|
||||
/>
|
||||
@@ -137,7 +145,9 @@ export function SeasonPage() {
|
||||
const isWatched =
|
||||
!!episode.date_first_seen ||
|
||||
(episode.episodeSeens && episode.episodeSeens.length > 0);
|
||||
const seenDates = (episode.episodeSeens ?? []).map((s: EpisodeSeen) => s.date_seen);
|
||||
const seenDates = (episode.episodeSeens ?? []).map(
|
||||
(s: EpisodeSeen) => s.date_seen,
|
||||
);
|
||||
|
||||
return (
|
||||
<Link
|
||||
@@ -152,12 +162,15 @@ export function SeasonPage() {
|
||||
ev.preventDefault();
|
||||
ev.stopPropagation();
|
||||
if (!entry?.entryIds?.tmdb_id) return;
|
||||
handleWatchEpisode(season.season_number, episode.episode_number);
|
||||
handleWatchEpisode(
|
||||
season.season_number,
|
||||
episode.episode_number,
|
||||
);
|
||||
}}
|
||||
>
|
||||
{episode.still_path ? (
|
||||
<img
|
||||
src={getTmdbPosterUrl(episode.still_path, 'w300')}
|
||||
src={getTmdbPosterUrl(episode.still_path, "w300")}
|
||||
alt={episode.name}
|
||||
className="h-full w-full object-cover transition-[filter] group-hover/thumb:brightness-50"
|
||||
loading="lazy"
|
||||
@@ -229,7 +242,7 @@ export function SeasonPage() {
|
||||
{/* Watch button — always clickable to add another seen record */}
|
||||
<Button
|
||||
size="icon"
|
||||
variant={isWatched ? 'secondary' : 'outline'}
|
||||
variant={isWatched ? "secondary" : "outline"}
|
||||
className="h-8 w-8 shrink-0 self-center"
|
||||
onClick={(ev) => {
|
||||
ev.preventDefault();
|
||||
@@ -249,7 +262,9 @@ export function SeasonPage() {
|
||||
{dialogEpisode && (
|
||||
<EpisodeSeenEditDialog
|
||||
open={!!dialogEpisode}
|
||||
onOpenChange={(open) => { if (!open) setDialogEpisode(null); }}
|
||||
onOpenChange={(open) => {
|
||||
if (!open) setDialogEpisode(null);
|
||||
}}
|
||||
mode="create"
|
||||
episodeId={dialogEpisode.id}
|
||||
entryId={parseInt(entryId!, 10)}
|
||||
|
||||
Reference in new issue
Block a user