mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-17 15:32:01 +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 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({
|
const { segments: skipIntervals, outroSegment } = useSkipSegments({
|
||||||
imdbId: resolvedImdbId || (id?.startsWith('tt') ? id : undefined),
|
imdbId: resolvedImdbId || (id?.startsWith('tt') ? id : undefined),
|
||||||
type,
|
type,
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import { clearCustomNameCache } from '../utils/catalogNameUtils';
|
||||||
import { BlurView } from 'expo-blur';
|
import { BlurView } from 'expo-blur';
|
||||||
import CustomAlert from '../components/CustomAlert';
|
import CustomAlert from '../components/CustomAlert';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useCollections } from '../hooks/useCollections';
|
||||||
|
|
||||||
// Optional iOS Glass effect (expo-glass-effect) with safe fallback for CatalogSettingsScreen
|
// Optional iOS Glass effect (expo-glass-effect) with safe fallback for CatalogSettingsScreen
|
||||||
let GlassViewComp: any = null;
|
let GlassViewComp: any = null;
|
||||||
|
|
@ -265,6 +266,7 @@ const createStyles = (colors: any) => StyleSheet.create({
|
||||||
});
|
});
|
||||||
|
|
||||||
const CatalogSettingsScreen = () => {
|
const CatalogSettingsScreen = () => {
|
||||||
|
const { collections } = useCollections();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [settings, setSettings] = useState<CatalogSetting[]>([]);
|
const [settings, setSettings] = useState<CatalogSetting[]>([]);
|
||||||
const [groupedSettings, setGroupedSettings] = useState<GroupedCatalogs>({});
|
const [groupedSettings, setGroupedSettings] = useState<GroupedCatalogs>({});
|
||||||
|
|
@ -618,6 +620,41 @@ const CatalogSettingsScreen = () => {
|
||||||
</View>
|
</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]) => (
|
{Object.entries(groupedSettings).map(([addonId, group]) => (
|
||||||
<View key={addonId} style={styles.addonSection}>
|
<View key={addonId} style={styles.addonSection}>
|
||||||
<Text style={styles.addonTitle}>
|
<Text style={styles.addonTitle}>
|
||||||
|
|
|
||||||
|
|
@ -763,40 +763,19 @@ const HomeScreen = () => {
|
||||||
// Only show a limited number of catalogs initially for performance
|
// Only show a limited number of catalogs initially for performance
|
||||||
const catalogsToShow = catalogs.slice(0, visibleCatalogCount);
|
const catalogsToShow = catalogs.slice(0, visibleCatalogCount);
|
||||||
|
|
||||||
// Build catalog items first
|
// Show collections at the top, before catalog rows
|
||||||
const catalogItems: HomeScreenListItem[] = [];
|
for (const collection of collections) {
|
||||||
|
data.push({ type: 'collection', collection, key: `collection-${collection.id}` });
|
||||||
|
}
|
||||||
|
|
||||||
catalogsToShow.forEach((catalog, index) => {
|
catalogsToShow.forEach((catalog, index) => {
|
||||||
if (catalog) {
|
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]) {
|
} 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
|
// Add a "Load More" button if there are more catalogs to show
|
||||||
if (catalogs.length > visibleCatalogCount && catalogs.filter(c => c).length > visibleCatalogCount) {
|
if (catalogs.length > visibleCatalogCount && catalogs.filter(c => c).length > visibleCatalogCount) {
|
||||||
data.push({ type: 'loadMore', key: 'load-more' });
|
data.push({ type: 'loadMore', key: 'load-more' });
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ export const ContentDiscoverySettingsContent: React.FC<ContentDiscoverySettingsC
|
||||||
<SettingItem
|
<SettingItem
|
||||||
title="Collections"
|
title="Collections"
|
||||||
description="Organize catalogs into folders"
|
description="Organize catalogs into folders"
|
||||||
icon="folder-open"
|
icon="folder"
|
||||||
renderControl={() => <ChevronRight />}
|
renderControl={() => <ChevronRight />}
|
||||||
onPress={() => navigation.navigate('Collections')}
|
onPress={() => navigation.navigate('Collections')}
|
||||||
isTablet={isTablet}
|
isTablet={isTablet}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue