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,7 +1,7 @@
|
||||
import { format } from 'date-fns';
|
||||
import type { EntrySeen, EpisodeSeen } from '@/types';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Pencil, Trash2 } from 'lucide-react';
|
||||
import { format } from "date-fns";
|
||||
import type { EntrySeen, EpisodeSeen } from "@/types";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Pencil, Trash2 } from "lucide-react";
|
||||
|
||||
interface EpisodeWatchHistoryProps {
|
||||
watchHistory: (EntrySeen | EpisodeSeen)[];
|
||||
@@ -40,11 +40,11 @@ export function EpisodeWatchHistory({
|
||||
>
|
||||
<td className="px-4 py-2">
|
||||
{record.date_seen
|
||||
? format(new Date(record.date_seen), 'MMM d, yyyy')
|
||||
: '-'}
|
||||
? format(new Date(record.date_seen), "MMM d, yyyy")
|
||||
: "-"}
|
||||
</td>
|
||||
<td className="px-4 py-2 text-muted-foreground">
|
||||
{record.seen_with || '-'}
|
||||
{record.seen_with || "-"}
|
||||
</td>
|
||||
<td className="px-4 py-2">
|
||||
<div className="flex justify-end gap-1">
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { ChevronRight } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { EntryCard, EntryCardSkeleton } from './EntryCard';
|
||||
import type { TmdbEntry } from '@/types';
|
||||
import { useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { ChevronRight } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
||||
import { EntryCard, EntryCardSkeleton } from "./EntryCard";
|
||||
import type { TmdbEntry } from "@/types";
|
||||
|
||||
interface TrendingGridProps {
|
||||
title: string;
|
||||
@@ -22,8 +22,8 @@ export function TrendingGrid({
|
||||
isLoading,
|
||||
category,
|
||||
}: TrendingGridProps) {
|
||||
const [activeTab, setActiveTab] = useState<'movie' | 'tv'>('movie');
|
||||
const entries = activeTab === 'movie' ? movieEntries : tvEntries;
|
||||
const [activeTab, setActiveTab] = useState<"movie" | "tv">("movie");
|
||||
const entries = activeTab === "movie" ? movieEntries : tvEntries;
|
||||
const displayEntries = entries.slice(0, 14);
|
||||
|
||||
return (
|
||||
@@ -33,7 +33,7 @@ export function TrendingGrid({
|
||||
<div className="flex items-center gap-3">
|
||||
<Tabs
|
||||
value={activeTab}
|
||||
onValueChange={(v) => setActiveTab(v as 'movie' | 'tv')}
|
||||
onValueChange={(v) => setActiveTab(v as "movie" | "tv")}
|
||||
>
|
||||
<TabsList className="h-8">
|
||||
<TabsTrigger value="movie" className="text-xs px-3">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { ChevronLeft, ChevronRight, Star } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { useCreateEntry } from '@/hooks/useEntries';
|
||||
import { useLibraryStore } from '@/stores/useLibraryStore';
|
||||
import type { TmdbEntry } from '@/types';
|
||||
import { useState, useEffect, useCallback, useRef } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { ChevronLeft, ChevronRight, Star } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useCreateEntry } from "@/hooks/useEntries";
|
||||
import { useLibraryStore } from "@/stores/useLibraryStore";
|
||||
import type { TmdbEntry } from "@/types";
|
||||
|
||||
interface TrendingSliderProps {
|
||||
entries: TmdbEntry[];
|
||||
@@ -48,14 +48,14 @@ export function TrendingSlider({ entries, isLoading }: TrendingSliderProps) {
|
||||
|
||||
const safeIndex = currentIndex < display.length ? currentIndex : 0;
|
||||
const item = display[safeIndex];
|
||||
const title = item.title || item.name || 'Untitled';
|
||||
const title = item.title || item.name || "Untitled";
|
||||
const backdropUrl = item.backdrop_path
|
||||
? `https://image.tmdb.org/t/p/w1280${item.backdrop_path}`
|
||||
: null;
|
||||
const isTv = item.media_type === 'tv' || !!item.name;
|
||||
const isTv = item.media_type === "tv" || !!item.name;
|
||||
|
||||
const matchedEntry = Array.from(libraryEntries.values()).find(
|
||||
(e) => e.entryIds?.tmdb_id === item.id
|
||||
(e) => e.entryIds?.tmdb_id === item.id,
|
||||
);
|
||||
const isInLibrary = !!matchedEntry;
|
||||
|
||||
@@ -77,14 +77,20 @@ export function TrendingSlider({ entries, isLoading }: TrendingSliderProps) {
|
||||
<button
|
||||
type="button"
|
||||
className="absolute left-3 top-1/2 -translate-y-1/2 z-20 h-10 w-10 rounded-full bg-black/40 text-white hover:bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center cursor-pointer"
|
||||
onClick={(e) => { e.stopPropagation(); prev(); }}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
prev();
|
||||
}}
|
||||
>
|
||||
<ChevronLeft className="h-5 w-5" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
className="absolute right-3 top-1/2 -translate-y-1/2 z-20 h-10 w-10 rounded-full bg-black/40 text-white hover:bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center cursor-pointer"
|
||||
onClick={(e) => { e.stopPropagation(); next(); }}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
next();
|
||||
}}
|
||||
>
|
||||
<ChevronRight className="h-5 w-5" />
|
||||
</button>
|
||||
@@ -94,7 +100,7 @@ export function TrendingSlider({ entries, isLoading }: TrendingSliderProps) {
|
||||
<div className="max-w-2xl space-y-3">
|
||||
<div className="flex items-center gap-2 text-white/70 text-sm">
|
||||
<span className="uppercase font-medium tracking-wider text-xs bg-white/20 backdrop-blur-sm px-2 py-0.5 rounded">
|
||||
{isTv ? 'TV Series' : 'Movie'}
|
||||
{isTv ? "TV Series" : "Movie"}
|
||||
</span>
|
||||
{item.vote_average > 0 && (
|
||||
<span className="flex items-center gap-1">
|
||||
@@ -122,7 +128,9 @@ export function TrendingSlider({ entries, isLoading }: TrendingSliderProps) {
|
||||
<Button
|
||||
size="sm"
|
||||
className="rounded-full px-5"
|
||||
onClick={() => createEntry.mutate({ tmdb_id: item.id, is_tvserie: isTv })}
|
||||
onClick={() =>
|
||||
createEntry.mutate({ tmdb_id: item.id, is_tvserie: isTv })
|
||||
}
|
||||
disabled={createEntry.isPending}
|
||||
>
|
||||
Add to Library
|
||||
@@ -140,8 +148,8 @@ export function TrendingSlider({ entries, isLoading }: TrendingSliderProps) {
|
||||
onClick={() => setCurrentIndex(i)}
|
||||
className={`h-1.5 rounded-full transition-all ${
|
||||
i === currentIndex
|
||||
? 'w-6 bg-white'
|
||||
: 'w-1.5 bg-white/40 hover:bg-white/60'
|
||||
? "w-6 bg-white"
|
||||
: "w-1.5 bg-white/40 hover:bg-white/60"
|
||||
}`}
|
||||
/>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user