Add poster popup, selectable title, collection media previews and library toggles
- Collection edit dialog shows the current poster and backdrop when available - Entry details: title is selectable (action row no longer overlays it) - Entry details: clicking the poster opens it full size in a dialog - Library: Favorites and Hidden are toggles that combine with the type tabs
This commit is contained in:
1 parent
c74e54bc2a
commit
834e02e76b
6 files changed
+258
-114
No files matched your search
@@ -2,7 +2,7 @@ import { getMediaUrl, getTmdbImageUrl } from "@/lib/api";
|
||||
import { getBackdropUrl, getPosterUrl } from "@/lib/media-utils";
|
||||
import type { Collection, Media } from "@/types";
|
||||
|
||||
const DEFAULT_POSTER = "/images/default-poster.png";
|
||||
export const DEFAULT_POSTER = "/images/default-poster.png";
|
||||
|
||||
/**
|
||||
* Collection poster: uploaded poster, then the collection's own TMDB poster,
|
||||
@@ -13,7 +13,12 @@ export function getCollectionDisplayPosterUrl(collection: Collection): string {
|
||||
(m: Media) => m.type === "poster" && m.is_selected,
|
||||
);
|
||||
if (selectedPoster?.path) {
|
||||
return getMediaUrl("collections", "posters", "preview", selectedPoster.path);
|
||||
return getMediaUrl(
|
||||
"collections",
|
||||
"posters",
|
||||
"preview",
|
||||
selectedPoster.path,
|
||||
);
|
||||
}
|
||||
|
||||
if (collection.poster_path) {
|
||||
@@ -39,7 +44,12 @@ export function getCollectionDisplayBackdropUrl(
|
||||
(m: Media) => m.type === "backdrop" && m.is_selected,
|
||||
);
|
||||
if (selectedBackdrop?.path) {
|
||||
return getMediaUrl("collections", "backdrops", "full", selectedBackdrop.path);
|
||||
return getMediaUrl(
|
||||
"collections",
|
||||
"backdrops",
|
||||
"full",
|
||||
selectedBackdrop.path,
|
||||
);
|
||||
}
|
||||
|
||||
if (collection.backdrop_path) {
|
||||
|
||||
@@ -29,6 +29,22 @@ export function getPosterUrl(entry: Entry): string {
|
||||
return DEFAULT_POSTER;
|
||||
}
|
||||
|
||||
/** Same source as getPosterUrl, but at original resolution. */
|
||||
export function getFullPosterUrl(entry: Entry): string {
|
||||
const selectedPoster = entry.isInLibrary
|
||||
? entry.medias?.find((m: Media) => m.type === "poster" && m.is_selected)
|
||||
: undefined;
|
||||
if (selectedPoster?.path) {
|
||||
return getMediaUrl("entries", "posters", "full", selectedPoster.path);
|
||||
}
|
||||
|
||||
if (entry.poster_path) {
|
||||
return getTmdbImageUrl(entry.poster_path, "original");
|
||||
}
|
||||
|
||||
return DEFAULT_POSTER;
|
||||
}
|
||||
|
||||
export function getBackdropUrl(entry: Entry): string {
|
||||
if (entry.medias) {
|
||||
const selectedBackdrop = entry.medias.find(
|
||||
|
||||
Reference in new issue
Block a user