mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-10 20:10:54 +00:00
UI changes tmdb logo
This commit is contained in:
parent
2599fd85d7
commit
a5a5358f7b
1 changed files with 19 additions and 5 deletions
|
|
@ -8,12 +8,13 @@ import {
|
||||||
Platform,
|
Platform,
|
||||||
InteractionManager,
|
InteractionManager,
|
||||||
AppState,
|
AppState,
|
||||||
|
Image,
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { useFocusEffect, useIsFocused } from '@react-navigation/native';
|
import { useFocusEffect, useIsFocused } from '@react-navigation/native';
|
||||||
|
|
||||||
import { MaterialIcons } from '@expo/vector-icons';
|
import { MaterialIcons } from '@expo/vector-icons';
|
||||||
import { LinearGradient } from 'expo-linear-gradient';
|
import { LinearGradient } from 'expo-linear-gradient';
|
||||||
import FastImage from '@d11/react-native-fast-image';
|
// Replaced FastImage with standard Image for logos
|
||||||
import { BlurView as ExpoBlurView } from 'expo-blur';
|
import { BlurView as ExpoBlurView } from 'expo-blur';
|
||||||
import { BlurView as CommunityBlurView } from '@react-native-community/blur';
|
import { BlurView as CommunityBlurView } from '@react-native-community/blur';
|
||||||
import Constants, { ExecutionEnvironment } from 'expo-constants';
|
import Constants, { ExecutionEnvironment } from 'expo-constants';
|
||||||
|
|
@ -37,6 +38,7 @@ import { logger } from '../../utils/logger';
|
||||||
import { TMDBService } from '../../services/tmdbService';
|
import { TMDBService } from '../../services/tmdbService';
|
||||||
import TrailerService from '../../services/trailerService';
|
import TrailerService from '../../services/trailerService';
|
||||||
import TrailerPlayer from '../video/TrailerPlayer';
|
import TrailerPlayer from '../video/TrailerPlayer';
|
||||||
|
import { isTmdbUrl } from '../../utils/logoUtils';
|
||||||
|
|
||||||
const { width, height } = Dimensions.get('window');
|
const { width, height } = Dimensions.get('window');
|
||||||
const isTablet = width >= 768;
|
const isTablet = width >= 768;
|
||||||
|
|
@ -892,6 +894,18 @@ const HeroSection: React.FC<HeroSectionProps> = memo(({
|
||||||
const imageSource = useMemo(() =>
|
const imageSource = useMemo(() =>
|
||||||
bannerImage || metadata.banner || metadata.poster
|
bannerImage || metadata.banner || metadata.poster
|
||||||
, [bannerImage, metadata.banner, metadata.poster]);
|
, [bannerImage, metadata.banner, metadata.poster]);
|
||||||
|
|
||||||
|
// Prefer TMDB logo when enrichment is enabled; fallback to addon's logo
|
||||||
|
const logoUri = useMemo(() => {
|
||||||
|
const candidate = metadata?.logo as string | undefined;
|
||||||
|
if (!candidate) return undefined;
|
||||||
|
if (settings?.enrichMetadataWithTMDB) {
|
||||||
|
// If the current logo is a TMDB URL, use it; otherwise still use available logo
|
||||||
|
if (isTmdbUrl(candidate)) return candidate;
|
||||||
|
return candidate;
|
||||||
|
}
|
||||||
|
return candidate;
|
||||||
|
}, [metadata.logo, settings?.enrichMetadataWithTMDB]);
|
||||||
|
|
||||||
// Performance optimization: Lazy loading setup
|
// Performance optimization: Lazy loading setup
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -1498,11 +1512,11 @@ const HeroSection: React.FC<HeroSectionProps> = memo(({
|
||||||
{/* Optimized Title/Logo */}
|
{/* Optimized Title/Logo */}
|
||||||
<Animated.View style={[styles.logoContainer, titleCardAnimatedStyle]}>
|
<Animated.View style={[styles.logoContainer, titleCardAnimatedStyle]}>
|
||||||
<Animated.View style={[styles.titleLogoContainer, logoAnimatedStyle]}>
|
<Animated.View style={[styles.titleLogoContainer, logoAnimatedStyle]}>
|
||||||
{shouldLoadSecondaryData && metadata.logo && !logoLoadError ? (
|
{shouldLoadSecondaryData && logoUri && !logoLoadError ? (
|
||||||
<FastImage
|
<Image
|
||||||
source={{ uri: metadata.logo }}
|
source={{ uri: logoUri }}
|
||||||
style={isTablet ? styles.tabletTitleLogo : styles.titleLogo}
|
style={isTablet ? styles.tabletTitleLogo : styles.titleLogo}
|
||||||
resizeMode={FastImage.resizeMode.contain}
|
resizeMode={'contain'}
|
||||||
onError={() => {
|
onError={() => {
|
||||||
runOnJS(setLogoLoadError)(true);
|
runOnJS(setLogoLoadError)(true);
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue