mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-11 17:45:38 +00:00
fix tmdb enrichment overriding addon provided metadata even when turned off
This commit is contained in:
parent
41adf5913f
commit
7ed65d59d3
1 changed files with 15 additions and 9 deletions
|
|
@ -823,6 +823,9 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
|
|||
|
||||
// Store addon logo before TMDB enrichment overwrites it
|
||||
const addonLogo = (finalMetadata as any).logo;
|
||||
const addonName = finalMetadata.name;
|
||||
const addonDescription = finalMetadata.description;
|
||||
const addonBanner = finalMetadata.banner;
|
||||
|
||||
|
||||
try {
|
||||
|
|
@ -857,8 +860,8 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
|
|||
|
||||
finalMetadata = {
|
||||
...finalMetadata,
|
||||
name: localized.title || finalMetadata.name,
|
||||
description: localized.overview || finalMetadata.description,
|
||||
name: (addonName && addonName.trim()) ? addonName : (localized.title || finalMetadata.name),
|
||||
description: (addonDescription && addonDescription.trim()) ? addonDescription : (localized.overview || finalMetadata.description),
|
||||
movieDetails: movieDetailsObj,
|
||||
...(productionInfo.length > 0 && { networks: productionInfo }),
|
||||
};
|
||||
|
|
@ -894,8 +897,8 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
|
|||
|
||||
finalMetadata = {
|
||||
...finalMetadata,
|
||||
name: localized.name || finalMetadata.name,
|
||||
description: localized.overview || finalMetadata.description,
|
||||
name: (addonName && addonName.trim()) ? addonName : (localized.name || finalMetadata.name),
|
||||
description: (addonDescription && addonDescription.trim()) ? addonDescription : (localized.overview || finalMetadata.description),
|
||||
tvDetails,
|
||||
...(productionInfo.length > 0 && { networks: productionInfo }),
|
||||
};
|
||||
|
|
@ -927,7 +930,7 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
|
|||
if (tmdbIdForLogo) {
|
||||
const logoUrl = await tmdbService.getContentLogo(contentType, tmdbIdForLogo, preferredLanguage);
|
||||
// Use TMDB logo if found, otherwise fall back to addon logo
|
||||
finalMetadata.logo = logoUrl || addonLogo || undefined;
|
||||
finalMetadata.logo = addonLogo || logoUrl || undefined;
|
||||
if (__DEV__) {
|
||||
console.log('[useMetadata] Logo fetch result:', {
|
||||
contentType,
|
||||
|
|
@ -967,12 +970,15 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
|
|||
}
|
||||
|
||||
// Clear banner field if TMDB banner enrichment is enabled to prevent flash
|
||||
if (settings.enrichMetadataWithTMDB && settings.tmdbEnrichBanners && !finalMetadata.banner) {
|
||||
finalMetadata = {
|
||||
...finalMetadata,
|
||||
banner: undefined, // Let useMetadataAssets handle banner via TMDB
|
||||
if (settings.enrichMetadataWithTMDB && settings.tmdbEnrichBanners) {
|
||||
if (!addonBanner && !finalMetadata.banner) {
|
||||
finalMetadata = {
|
||||
...finalMetadata,
|
||||
banner: undefined,
|
||||
// Let useMetadataAssets handle banner via TMDB
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Preserve existing collection if it was set by fetchProductionInfo
|
||||
setMetadata((prev) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue