fix for edge case anime ids imdb+kitsu

This commit is contained in:
chrisk325 2026-03-14 03:07:00 +05:30 committed by GitHub
parent d0bfd3550a
commit 3900b57a16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2016,16 +2016,18 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
} }
if (__DEV__) console.log('✅ [loadEpisodeStreams] Converted to TMDB ID:', tmdbId); if (__DEV__) console.log('✅ [loadEpisodeStreams] Converted to TMDB ID:', tmdbId);
// Ensure consistent format // Ensure consistent format or fallback to episodeId if parsing failed.
// Ensure consistent format or fallback to episodeId if parsing failed // If the episode's namespace differs from the show's tt id (e.g. kitsu:48363:8
// This handles cases where 'tt' is used for a unique episode ID directly // on a tt-identified show), use showIdStr so we request via the correct namespace.
if (!seasonNum && !episodeNum) { if (!seasonNum && !episodeNum) {
stremioEpisodeId = episodeId; stremioEpisodeId = episodeId;
} else if (!seasonNum) { } else if (!seasonNum) {
// No season (e.g., mal:57658:1) - use id:episode format // No season (e.g., kitsu:48363:8, mal:57658:1)
stremioEpisodeId = `${id}:${episodeNum}`; const baseId = showIdStr && showIdStr !== id ? showIdStr : id;
stremioEpisodeId = `${baseId}:${episodeNum}`;
} else { } else {
stremioEpisodeId = `${id}:${seasonNum}:${episodeNum}`; const baseId = showIdStr && showIdStr !== id ? showIdStr : id;
stremioEpisodeId = `${baseId}:${seasonNum}:${episodeNum}`;
} }
if (__DEV__) console.log('🔧 [loadEpisodeStreams] Normalized episode ID for addons:', stremioEpisodeId); if (__DEV__) console.log('🔧 [loadEpisodeStreams] Normalized episode ID for addons:', stremioEpisodeId);
} else { } else {