fix for anime ids tvdb+kitsu

This commit is contained in:
chrisk325 2026-03-13 19:12:17 +05:30 committed by GitHub
parent dd6b0ffb46
commit 72b953b39e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2029,12 +2029,17 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
// Remove 'series:' prefix if present to be safe, though parsing logic above usually handles it
stremioEpisodeId = episodeId.replace(/^series:/, '');
} else if (!seasonNum) {
// No season (e.g., mal:57658:1) - use id:episode format
stremioEpisodeId = `${id}:${episodeNum}`;
// No season (e.g., kitsu:12345:1, mal:57658:1) - use showIdStr:episode format.
// Use showIdStr (parsed from episodeId) rather than outer `id` so that when the
// show has multiple IDs (e.g. tvdb+kitsu), we preserve the namespace that the
// episode actually belongs to (e.g. kitsu:animeId:epNum, not tvdb:showId:epNum).
const baseId = showIdStr && showIdStr !== id ? showIdStr : id;
stremioEpisodeId = `${baseId}:${episodeNum}`;
} else {
stremioEpisodeId = `${id}:${seasonNum}:${episodeNum}`;
const baseId = showIdStr && showIdStr !== id ? showIdStr : id;
stremioEpisodeId = `${baseId}:${seasonNum}:${episodeNum}`;
}
if (__DEV__) console.log(' [loadEpisodeStreams] Using ID as both TMDB and Stremio ID:', tmdbId);
if (__DEV__) console.log(' [loadEpisodeStreams] Using ID as both TMDB and Stremio ID:', tmdbId, '| stremioEpisodeId:', stremioEpisodeId);
}
// Extract episode info from the episodeId for logging