From a0e5332897975d81cb556a47d2377a7fb8cdc74f Mon Sep 17 00:00:00 2001 From: tapframe Date: Fri, 24 Oct 2025 21:09:06 +0530 Subject: [PATCH] updated collectionscreen to display movies by release order --- src/components/metadata/CollectionSection.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/metadata/CollectionSection.tsx b/src/components/metadata/CollectionSection.tsx index 2b57f58c..7d85c9c0 100644 --- a/src/components/metadata/CollectionSection.tsx +++ b/src/components/metadata/CollectionSection.tsx @@ -116,6 +116,17 @@ export const CollectionSection: React.FC = ({ } }; + // Sort collection movies by year (oldest to newest) + const sortedCollectionMovies = React.useMemo(() => { + if (!collectionMovies) return []; + + return [...collectionMovies].sort((a, b) => { + const yearA = a.year ? parseInt(a.year.toString()) : 0; + const yearB = b.year ? parseInt(b.year.toString()) : 0; + return yearA - yearB; // Oldest to newest + }); + }, [collectionMovies]); + const renderItem = ({ item }: { item: StreamingContent }) => ( = ({ {collectionName} item.id} horizontal