fix crash after clicking on the highlight play button

This commit is contained in:
2021-01-01 13:08:25 +01:00
parent 75ecac6144
commit e4ac01605f
3 changed files with 25 additions and 19 deletions

View File

@ -125,6 +125,14 @@ object AoDParser {
return media
}
fun markAsWatched(mediaId: Int, episodeId: Int) = GlobalScope.launch {
val episode = getMediaById(mediaId).getEpisodeById(episodeId)
episode.watched = true
sendCallback(episode.watchedCallback)
Log.d(javaClass.name, "Marked episode ${episode.id} as watched")
}
// TODO don't use jsoup here
fun sendCallback(callbackPath: String) = GlobalScope.launch(Dispatchers.IO) {
val headers = mutableMapOf(