mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 07:21:58 +00:00
Fix collections placement, catalog settings integration, and icon
- Move collections to top of home screen instead of interleaved - Add Collections section in Catalog Settings screen with manage link - Fix Feather icon (folder-open -> folder) in settings - Fix duplicate currentTmdbId declaration in AndroidVideoPlayer (upstream bug) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
c6216cb95d
commit
611a6b49e9
4 changed files with 45 additions and 31 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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<CatalogSetting[]>([]);
|
||||
const [groupedSettings, setGroupedSettings] = useState<GroupedCatalogs>({});
|
||||
|
|
@ -618,6 +620,41 @@ const CatalogSettingsScreen = () => {
|
|||
</View>
|
||||
)}
|
||||
|
||||
{/* Collections Section */}
|
||||
{collections.length > 0 && (
|
||||
<View style={styles.addonSection}>
|
||||
<Text style={styles.addonTitle}>COLLECTIONS</Text>
|
||||
<View style={styles.card}>
|
||||
<TouchableOpacity
|
||||
style={styles.groupHeader}
|
||||
onPress={() => navigation.navigate('Collections' as any)}
|
||||
activeOpacity={0.7}
|
||||
>
|
||||
<Text style={styles.groupTitle}>
|
||||
{collections.length} collection{collections.length !== 1 ? 's' : ''}
|
||||
</Text>
|
||||
<View style={styles.groupHeaderRight}>
|
||||
<Text style={[styles.enabledCount, { color: colors.primary }]}>Manage</Text>
|
||||
<MaterialIcons name="keyboard-arrow-right" size={24} color={colors.primary} />
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
{collections.map((collection) => (
|
||||
<View
|
||||
key={collection.id}
|
||||
style={styles.catalogItem}
|
||||
>
|
||||
<View style={styles.catalogInfo}>
|
||||
<Text style={styles.catalogName}>{collection.title}</Text>
|
||||
<Text style={styles.catalogType}>
|
||||
{collection.folders.length} folder{collection.folders.length !== 1 ? 's' : ''}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
|
||||
{Object.entries(groupedSettings).map(([addonId, group]) => (
|
||||
<View key={addonId} style={styles.addonSection}>
|
||||
<Text style={styles.addonTitle}>
|
||||
|
|
|
|||
|
|
@ -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' });
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ export const ContentDiscoverySettingsContent: React.FC<ContentDiscoverySettingsC
|
|||
<SettingItem
|
||||
title="Collections"
|
||||
description="Organize catalogs into folders"
|
||||
icon="folder-open"
|
||||
icon="folder"
|
||||
renderControl={() => <ChevronRight />}
|
||||
onPress={() => navigation.navigate('Collections')}
|
||||
isTablet={isTablet}
|
||||
|
|
|
|||
Loading…
Reference in a new issue