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,21 +1,18 @@
|
||||
import { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { ChevronDown, ChevronUp, Play } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Progress } from '@/components/ui/progress';
|
||||
import { EpisodeSeenEditDialog } from '@/components/dialogs/EpisodeSeenEditDialog';
|
||||
import { getYear, getTmdbPosterUrl } from '@/lib/media-utils';
|
||||
import type { Season } from '@/types';
|
||||
import { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { ChevronDown, ChevronUp, Play } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import { EpisodeSeenEditDialog } from "@/components/dialogs/EpisodeSeenEditDialog";
|
||||
import { getYear, getTmdbPosterUrl } from "@/lib/media-utils";
|
||||
import type { Season } from "@/types";
|
||||
|
||||
interface SeasonsContainerProps {
|
||||
seasons: Season[];
|
||||
entryId: number;
|
||||
}
|
||||
|
||||
export function SeasonsContainer({
|
||||
seasons,
|
||||
entryId,
|
||||
}: SeasonsContainerProps) {
|
||||
export function SeasonsContainer({ seasons, entryId }: SeasonsContainerProps) {
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
|
||||
// Sort: specials (season 0) at bottom, rest latest to oldest
|
||||
@@ -48,8 +45,8 @@ export function SeasonsContainer({
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<ChevronDown className="mr-1 h-4 w-4" /> Show All (
|
||||
{sorted.length})
|
||||
<ChevronDown className="mr-1 h-4 w-4" /> Show All ({sorted.length}
|
||||
)
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
@@ -58,17 +55,12 @@ export function SeasonsContainer({
|
||||
);
|
||||
}
|
||||
|
||||
function SeasonItem({
|
||||
season,
|
||||
entryId,
|
||||
}: {
|
||||
season: Season;
|
||||
entryId: number;
|
||||
}) {
|
||||
function SeasonItem({ season, entryId }: { season: Season; entryId: number }) {
|
||||
const [dialogOpen, setDialogOpen] = useState(false);
|
||||
const watchedCount =
|
||||
season.episodes?.filter(
|
||||
(ep) => ep.date_first_seen || (ep.episodeSeens && ep.episodeSeens.length > 0)
|
||||
(ep) =>
|
||||
ep.date_first_seen || (ep.episodeSeens && ep.episodeSeens.length > 0),
|
||||
).length ?? 0;
|
||||
const totalEpisodes = season.episode_count || season.episodes?.length || 0;
|
||||
const progress = totalEpisodes > 0 ? (watchedCount / totalEpisodes) * 100 : 0;
|
||||
@@ -76,7 +68,11 @@ function SeasonItem({
|
||||
const nextUnwatched = season.episodes
|
||||
?.slice()
|
||||
.sort((a, b) => a.episode_number - b.episode_number)
|
||||
.find((ep) => !ep.date_first_seen && (!ep.episodeSeens || ep.episodeSeens.length === 0));
|
||||
.find(
|
||||
(ep) =>
|
||||
!ep.date_first_seen &&
|
||||
(!ep.episodeSeens || ep.episodeSeens.length === 0),
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -87,7 +83,7 @@ function SeasonItem({
|
||||
{/* Poster thumbnail */}
|
||||
<div className="h-16 w-11 shrink-0 overflow-hidden rounded bg-muted">
|
||||
<img
|
||||
src={getTmdbPosterUrl(season.poster_path, 'w92')}
|
||||
src={getTmdbPosterUrl(season.poster_path, "w92")}
|
||||
alt={season.name}
|
||||
className="h-full w-full object-cover"
|
||||
loading="lazy"
|
||||
|
||||
Reference in new issue
Block a user