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
val addonEntry = addonEpisodes.firstOrNull {
it.season == requestedSeason && it.episode == requestedEpisode
} ?: if (!requestedVideoId.isNullOrBlank()) {
addonEpisodes.firstOrNull { it.videoId == requestedVideoId }
} else null
?: return null
} ?: addonEpisodes.firstOrNull {
!requestedVideoId.isNullOrBlank() && it.videoId == requestedVideoId
} ?: return null
// Try title match first
val titleToMatch = addonEntry.title?.takeIf { it.isNotBlank() } ?: requestedTitle