nullable receiver in TraktEpisodeMappingService

This commit is contained in:
skoruppa 2026-04-30 11:26:24 +02:00
parent 7a0cc2c03b
commit 263dd8db70

View file

@ -198,10 +198,9 @@ object TraktEpisodeMappingService {
// Find the addon episode entry // Find the addon episode entry
val addonEntry = addonEpisodes.firstOrNull { val addonEntry = addonEpisodes.firstOrNull {
it.season == requestedSeason && it.episode == requestedEpisode it.season == requestedSeason && it.episode == requestedEpisode
} ?: if (!requestedVideoId.isNullOrBlank()) { } ?: addonEpisodes.firstOrNull {
addonEpisodes.firstOrNull { it.videoId == requestedVideoId } !requestedVideoId.isNullOrBlank() && it.videoId == requestedVideoId
} else null } ?: return null
?: return null
// Try title match first // Try title match first
val titleToMatch = addonEntry.title?.takeIf { it.isNotBlank() } ?: requestedTitle val titleToMatch = addonEntry.title?.takeIf { it.isNotBlank() } ?: requestedTitle