Fix collection images and entry settings toggles

- Show the uploaded backdrop on the collection details page; it only
  looked at the TMDB backdrop and ignored the collection's media
- Fall back to the first entry's poster for collections without a poster
  on both the collections grid and the details page
- Read the live entry from the library store in EntrySettingsDialog so
  toggles reflect the new value instead of a stale prop snapshot
This commit is contained in:
X4Lo committed 2026-11-03 16:25:12 +00:00
1 parent a9e4eea856
commit 72600cbc5d
4 files changed
+73 -21

No files matched your search

@@ -9,6 +9,7 @@ import { Switch } from "@/components/ui/switch";
import { Separator } from "@/components/ui/separator";
import { useUpdateEntry, useUpdateEntryRatings } from "@/hooks/useEntries";
import { StarRating } from "@/components/ui/star-rating";
import { useLibraryStore } from "@/stores/useLibraryStore";
import type { Entry } from "@/types";
interface EntrySettingsDialogProps {
@@ -20,8 +21,12 @@ interface EntrySettingsDialogProps {
export function EntrySettingsDialog({
open,
onOpenChange,
entry,
entry: entryProp,
}: EntrySettingsDialogProps) {
// The entry prop can be a stale snapshot (e.g. from a collection query), so
// read the live copy from the library store, which updates on every mutation.
const storeEntry = useLibraryStore((s) => s.entries.get(entryProp.id));
const entry = storeEntry ? { ...entryProp, ...storeEntry } : entryProp;
const updateEntry = useUpdateEntry();
const updateRatings = useUpdateEntryRatings();