mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-21 08:12:18 +00:00
use random group icon for collection group
This commit is contained in:
parent
abd661e8a2
commit
2ad6b8b942
1 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import { getCollectionDetails, getMediaPoster } from "@/backend/metadata/tmdb";
|
||||||
import { IconPatch } from "@/components/buttons/IconPatch";
|
import { IconPatch } from "@/components/buttons/IconPatch";
|
||||||
import { Icon, Icons } from "@/components/Icon";
|
import { Icon, Icons } from "@/components/Icon";
|
||||||
import { MediaCard } from "@/components/media/MediaCard";
|
import { MediaCard } from "@/components/media/MediaCard";
|
||||||
|
import { UserIcons } from "@/components/UserIcon";
|
||||||
import { Flare } from "@/components/utils/Flare";
|
import { Flare } from "@/components/utils/Flare";
|
||||||
import { useIsMobile } from "@/hooks/useIsMobile";
|
import { useIsMobile } from "@/hooks/useIsMobile";
|
||||||
import { CarouselNavButtons } from "@/pages/discover/components/CarouselNavButtons";
|
import { CarouselNavButtons } from "@/pages/discover/components/CarouselNavButtons";
|
||||||
|
|
@ -168,6 +169,14 @@ export function CollectionOverlay({
|
||||||
const handleBookmarkCollection = () => {
|
const handleBookmarkCollection = () => {
|
||||||
if (!collection?.parts) return;
|
if (!collection?.parts) return;
|
||||||
|
|
||||||
|
// Get all available user icons and select one randomly
|
||||||
|
const userIconList = Object.values(UserIcons);
|
||||||
|
const randomIcon =
|
||||||
|
userIconList[Math.floor(Math.random() * userIconList.length)];
|
||||||
|
|
||||||
|
// Format the group name with the random icon
|
||||||
|
const groupName = `[${randomIcon}]${collectionName}`;
|
||||||
|
|
||||||
collection.parts.forEach((movie) => {
|
collection.parts.forEach((movie) => {
|
||||||
const year = movie.release_date
|
const year = movie.release_date
|
||||||
? new Date(movie.release_date).getFullYear()
|
? new Date(movie.release_date).getFullYear()
|
||||||
|
|
@ -184,7 +193,7 @@ export function CollectionOverlay({
|
||||||
poster: getMediaPoster(movie.poster_path) || "/placeholder.png",
|
poster: getMediaPoster(movie.poster_path) || "/placeholder.png",
|
||||||
};
|
};
|
||||||
|
|
||||||
addBookmarkWithGroups(meta, [collectionName]);
|
addBookmarkWithGroups(meta, [groupName]);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue