diff --git a/src/components/player/AndroidVideoPlayer.tsx b/src/components/player/AndroidVideoPlayer.tsx index 5933a1ef..955c5d85 100644 --- a/src/components/player/AndroidVideoPlayer.tsx +++ b/src/components/player/AndroidVideoPlayer.tsx @@ -271,8 +271,6 @@ const AndroidVideoPlayer: React.FC = () => { const nextEpisodeHook = useNextEpisode(type, season, episode, groupedEpisodes, (metadataResult as any)?.groupedEpisodes, episodeId); - const currentTmdbId = (metadata as any)?.tmdbId || (metadata as any)?.external_ids?.tmdb_id; - const { segments: skipIntervals, outroSegment } = useSkipSegments({ imdbId: resolvedImdbId || (id?.startsWith('tt') ? id : undefined), type, diff --git a/src/screens/CatalogSettingsScreen.tsx b/src/screens/CatalogSettingsScreen.tsx index 320d7252..c850fb98 100644 --- a/src/screens/CatalogSettingsScreen.tsx +++ b/src/screens/CatalogSettingsScreen.tsx @@ -26,6 +26,7 @@ import { clearCustomNameCache } from '../utils/catalogNameUtils'; import { BlurView } from 'expo-blur'; import CustomAlert from '../components/CustomAlert'; import { useTranslation } from 'react-i18next'; +import { useCollections } from '../hooks/useCollections'; // Optional iOS Glass effect (expo-glass-effect) with safe fallback for CatalogSettingsScreen let GlassViewComp: any = null; @@ -265,6 +266,7 @@ const createStyles = (colors: any) => StyleSheet.create({ }); const CatalogSettingsScreen = () => { + const { collections } = useCollections(); const [loading, setLoading] = useState(true); const [settings, setSettings] = useState([]); const [groupedSettings, setGroupedSettings] = useState({}); @@ -618,6 +620,41 @@ const CatalogSettingsScreen = () => { )} + {/* Collections Section */} + {collections.length > 0 && ( + + COLLECTIONS + + navigation.navigate('Collections' as any)} + activeOpacity={0.7} + > + + {collections.length} collection{collections.length !== 1 ? 's' : ''} + + + Manage + + + + {collections.map((collection) => ( + + + {collection.title} + + {collection.folders.length} folder{collection.folders.length !== 1 ? 's' : ''} + + + + ))} + + + )} + {Object.entries(groupedSettings).map(([addonId, group]) => ( diff --git a/src/screens/HomeScreen.tsx b/src/screens/HomeScreen.tsx index 3e68a183..ba57eac4 100644 --- a/src/screens/HomeScreen.tsx +++ b/src/screens/HomeScreen.tsx @@ -763,40 +763,19 @@ const HomeScreen = () => { // Only show a limited number of catalogs initially for performance const catalogsToShow = catalogs.slice(0, visibleCatalogCount); - // Build catalog items first - const catalogItems: HomeScreenListItem[] = []; + // Show collections at the top, before catalog rows + for (const collection of collections) { + data.push({ type: 'collection', collection, key: `collection-${collection.id}` }); + } + catalogsToShow.forEach((catalog, index) => { if (catalog) { - catalogItems.push({ type: 'catalog', catalog, key: `${catalog.addon}-${catalog.id}-${index}` }); + data.push({ type: 'catalog', catalog, key: `${catalog.addon}-${catalog.id}-${index}` }); } else if (catalogsLoading && pendingCatalogIndexes[index]) { - catalogItems.push({ type: 'placeholder', key: `placeholder-${index}` }); + data.push({ type: 'placeholder', key: `placeholder-${index}` }); } }); - // Interleave collections after the first 2 catalog rows, then after each subsequent collection - let catalogIndex = 0; - const collectionsToInsert = [...collections]; - const INSERT_AFTER_ROW = 2; // Insert collections after 2nd catalog row - - for (let i = 0; i < catalogItems.length; i++) { - data.push(catalogItems[i]); - catalogIndex++; - - if (catalogIndex === INSERT_AFTER_ROW && collectionsToInsert.length > 0) { - for (const collection of collectionsToInsert) { - data.push({ type: 'collection', collection, key: `collection-${collection.id}` }); - } - collectionsToInsert.length = 0; - } - } - - // If we didn't reach INSERT_AFTER_ROW, append remaining collections at the end - if (collectionsToInsert.length > 0) { - for (const collection of collectionsToInsert) { - data.push({ type: 'collection', collection, key: `collection-${collection.id}` }); - } - } - // Add a "Load More" button if there are more catalogs to show if (catalogs.length > visibleCatalogCount && catalogs.filter(c => c).length > visibleCatalogCount) { data.push({ type: 'loadMore', key: 'load-more' }); diff --git a/src/screens/settings/ContentDiscoverySettingsScreen.tsx b/src/screens/settings/ContentDiscoverySettingsScreen.tsx index df427039..fd026095 100644 --- a/src/screens/settings/ContentDiscoverySettingsScreen.tsx +++ b/src/screens/settings/ContentDiscoverySettingsScreen.tsx @@ -123,7 +123,7 @@ export const ContentDiscoverySettingsContent: React.FC } onPress={() => navigation.navigate('Collections')} isTablet={isTablet}