feat: multi-page improvements, bug fixes, and new features
Library: - Exclude hidden entries from all/movies/tv/favorites tabs (only show in hidden tab) Entry Details: - Move favorite, mark watched, and more actions to top-right as icon-only buttons with tooltips - Fix season card play button — marks next unwatched episode as seen Seasons Page: - Fix episode watch button (was a TODO stub, now calls createEpisodeSeen) Episode Page: - Fix UI not updating after deleting the last watch record — invalidate season episodes query on delete Dashboard: - Fix Top Genres 404 — was calling non-existent GET /statistics, now uses /statistics/watch-time - Fix TopGenresChart genre counting (Genre objects were wrongly cast as strings) - Add LibraryGrowthChart (cumulative titles added over time) - Add MediaTypeChart (Movies vs TV Series donut chart) Home Page: - Add TrendingSlider hero at top of page with auto-advance, dots, and prev/next nav - Fix slider prev/next buttons (stable callbacks via ref, plain buttons, reactive library state) - Add debounce (400ms) to search input - Add Top Rated section (movies & TV) - Add Upcoming section (movies) - Replace inline "More" expand with link to /discover/:category Discover Page (new): - Full-page TMDB browser per category (trending/popular/top-rated/upcoming) - Movie/TV tab toggle - IntersectionObserver infinite scroll Calendar: - Fix large season numbers — use season.season_number instead of season_id (DB primary key) Backend: - Add fetchTopRated() and fetchUpcoming() to tmdbService - Add GET /entries/tmdb/top-rated/:type and /entries/tmdb/upcoming/movie routes
This commit is contained in:
1 parent
d60d142d17
commit
ab20a5e64f
23 files changed
+820
-104
No files matched your search
@@ -107,80 +107,91 @@ export function EntryDetailsPage() {
|
||||
|
||||
{/* Main content */}
|
||||
<div className="mx-auto max-w-4xl">
|
||||
{/* Action buttons — top right */}
|
||||
<div className="flex justify-end gap-1 -mt-10 relative z-10 mb-2">
|
||||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant={e.favorit ? 'default' : 'outline'}
|
||||
size="icon"
|
||||
className="h-9 w-9"
|
||||
onClick={toggleFavorite}
|
||||
disabled={updateEntry.isPending}
|
||||
>
|
||||
{updateEntry.isPending ? (
|
||||
<Loader2 className="h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<Heart className={`h-4 w-4 ${e.favorit ? 'fill-current' : ''}`} />
|
||||
)}
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>{e.favorit ? 'Unfavorite' : 'Favorite'}</TooltipContent>
|
||||
</Tooltip>
|
||||
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="icon"
|
||||
className="h-9 w-9"
|
||||
onClick={() => setShowSeenDialog(true)}
|
||||
>
|
||||
<Eye className="h-4 w-4" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>Mark Watched</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" size="icon" className="h-9 w-9">
|
||||
<MoreHorizontal className="h-4 w-4" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="end" className="w-56">
|
||||
<DropdownMenuItem onClick={() => setShowRatingDialog(true)}>
|
||||
<Star className="mr-2 h-4 w-4" />
|
||||
Rate this
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
onClick={() =>
|
||||
updateEntry.mutate({ id: e.id, data: { hidden: !e.hidden } })
|
||||
}
|
||||
>
|
||||
<EyeOff className="mr-2 h-4 w-4" />
|
||||
{e.hidden ? 'Unhide' : 'Hide'}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => refreshEntry.mutate(e.id)} disabled={refreshEntry.isPending}>
|
||||
<RefreshCw className={`mr-2 h-4 w-4 ${refreshEntry.isPending ? 'animate-spin' : ''}`} />
|
||||
{refreshEntry.isPending ? 'Refreshing...' : 'Refresh details'}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setShowCollectionDialog(true)}>
|
||||
<FolderPlus className="mr-2 h-4 w-4" />
|
||||
Add to collection
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setShowMediaDialog(true)}>
|
||||
<ImageIcon className="mr-2 h-4 w-4" />
|
||||
Manage media
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setShowSettings(true)}>
|
||||
<Settings className="mr-2 h-4 w-4" />
|
||||
Settings
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
|
||||
{/* Two-column header: sticky poster | info */}
|
||||
<div className="flex flex-col gap-6 -mt-16 relative items-start sm:flex-row sm:gap-8 sm:-mt-24">
|
||||
{/* LEFT: Sticky poster + actions */}
|
||||
<div className="sm:sticky sm:top-20 w-32 sm:w-44 shrink-0 space-y-3 self-start mx-auto sm:mx-0">
|
||||
<div className="flex flex-col gap-6 relative items-start sm:flex-row sm:gap-8 sm:-mt-8">
|
||||
{/* LEFT: Sticky poster */}
|
||||
<div className="sm:sticky sm:top-20 w-32 sm:w-44 shrink-0 self-start mx-auto sm:mx-0">
|
||||
<img
|
||||
src={poster}
|
||||
alt={e.title}
|
||||
className="w-full aspect-2/3 rounded-xl object-cover shadow-2xl ring-1 ring-border/50"
|
||||
/>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Button
|
||||
variant={e.favorit ? 'default' : 'outline'}
|
||||
size="sm"
|
||||
className="w-full justify-start"
|
||||
onClick={toggleFavorite}
|
||||
disabled={updateEntry.isPending}
|
||||
>
|
||||
{updateEntry.isPending ? (
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
) : (
|
||||
<Heart className={`mr-2 h-4 w-4 ${e.favorit ? 'fill-current' : ''}`} />
|
||||
)}
|
||||
{e.favorit ? 'Favorited' : 'Favorite'}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="w-full justify-start"
|
||||
onClick={() => setShowSeenDialog(true)}
|
||||
>
|
||||
<Eye className="mr-2 h-4 w-4" />
|
||||
Mark Watched
|
||||
</Button>
|
||||
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="ghost" size="sm" className="w-full justify-start">
|
||||
<MoreHorizontal className="mr-2 h-4 w-4" />
|
||||
More actions
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent align="start" side="right" className="w-56">
|
||||
<DropdownMenuItem onClick={() => setShowRatingDialog(true)}>
|
||||
<Star className="mr-2 h-4 w-4" />
|
||||
Rate this
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
onClick={() =>
|
||||
updateEntry.mutate({ id: e.id, data: { hidden: !e.hidden } })
|
||||
}
|
||||
>
|
||||
<EyeOff className="mr-2 h-4 w-4" />
|
||||
{e.hidden ? 'Unhide' : 'Hide'}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => refreshEntry.mutate(e.id)} disabled={refreshEntry.isPending}>
|
||||
<RefreshCw className={`mr-2 h-4 w-4 ${refreshEntry.isPending ? 'animate-spin' : ''}`} />
|
||||
{refreshEntry.isPending ? 'Refreshing...' : 'Refresh details'}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setShowCollectionDialog(true)}>
|
||||
<FolderPlus className="mr-2 h-4 w-4" />
|
||||
Add to collection
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setShowMediaDialog(true)}>
|
||||
<ImageIcon className="mr-2 h-4 w-4" />
|
||||
Manage media
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem onClick={() => setShowSettings(true)}>
|
||||
<Settings className="mr-2 h-4 w-4" />
|
||||
Settings
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* RIGHT: Entry info */}
|
||||
|
||||
Reference in new issue
Block a user