Browse Source

fix crash if media is present in metadb, but season/episode are not present

develop
Jannik 1 month ago
parent
commit
69c9666d2b
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
  1. 5
      app/src/main/java/org/mosad/teapod/ui/activity/player/PlayerViewModel.kt

5
app/src/main/java/org/mosad/teapod/ui/activity/player/PlayerViewModel.kt

@ -168,11 +168,12 @@ class PlayerViewModel(application: Application) : AndroidViewModel(application)
episode.id == episodeId
} ?: NoneEpisode
// TODO improve handling of none present seasons/episodes
// update current episode meta
currentEpisodeMeta = if (mediaMeta is TVShowMeta && currentEpisode.episodeNumber != null) {
(mediaMeta as TVShowMeta)
.seasons[currentEpisode.seasonNumber - 1]
.episodes[currentEpisode.episodeNumber!! - 1]
.seasons.getOrNull(currentEpisode.seasonNumber - 1)
?.episodes?.getOrNull(currentEpisode.episodeNumber!! - 1)
} else {
null
}

Loading…
Cancel
Save

Du besuchst diese Seite mit einem veralteten IPv4-Internetzugang. Möglicherweise treten in Zukunft Probleme mit der Erreichbarkeit und Performance auf. Bitte frage deinen Internetanbieter oder Netzwerkadministrator nach IPv6-Unterstützung.
You are visiting this site with an outdated IPv4 internet access. You may experience problems with accessibility and performance in the future. Please ask your ISP or network administrator for IPv6 support.
Weitere Infos | More Information
Klicke zum schließen | Click to close