don't show fully watched episodes in "Up next"
parent
e8bf63a666
commit
4505f95309
|
@ -14,7 +14,7 @@ android {
|
|||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 4200 //00.04.200
|
||||
versionName "1.0.0-alpha3"
|
||||
versionName "1.0.0-alpha4"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
resValue "string", "build_time", buildTime()
|
||||
|
|
|
@ -106,7 +106,7 @@ data class ContinueWatchingItem(
|
|||
// @SerialName("completion_status") val completionStatus: Boolean,
|
||||
@SerialName("playhead") val playhead: Int,
|
||||
// not present in watchlist -> continue_watching_item
|
||||
// @SerialName("fully_watched") val fullyWatched: Boolean,
|
||||
@SerialName("fully_watched") val fullyWatched: Boolean = false,
|
||||
)
|
||||
|
||||
// EpisodePanel is used in ContinueWatchingItem
|
||||
|
|
|
@ -81,7 +81,8 @@ class HomeFragment : Fragment() {
|
|||
// continue watching
|
||||
val upNextJob = lifecycleScope.launch {
|
||||
// TODO create EpisodeItemAdapter, which will start the playback of the selected episode immediately
|
||||
adapterUpNext = MediaItemAdapter(Crunchyroll.upNextAccount().toItemMediaList())
|
||||
adapterUpNext = MediaItemAdapter(Crunchyroll.upNextAccount().items
|
||||
.filter { !it.fullyWatched }.toItemMediaList())
|
||||
binding.recyclerNewEpisodes.adapter = adapterUpNext
|
||||
}
|
||||
asyncJobList.add(upNextJob)
|
||||
|
|
|
@ -23,7 +23,13 @@ fun Collection<Item>.toItemMediaList(): List<ItemMedia> {
|
|||
|
||||
@JvmName("toItemMediaListContinueWatchingItem")
|
||||
fun Collection<ContinueWatchingItem>.toItemMediaList(): List<ItemMedia> {
|
||||
return this.items.map {
|
||||
return items.map {
|
||||
ItemMedia(it.panel.episodeMetadata.seriesId, it.panel.title, it.panel.images.thumbnail[0][0].source)
|
||||
}
|
||||
}
|
||||
|
||||
fun List<ContinueWatchingItem>.toItemMediaList(): List<ItemMedia> {
|
||||
return this.map {
|
||||
ItemMedia(it.panel.episodeMetadata.seriesId, it.panel.title, it.panel.images.thumbnail[0][0].source)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue