crunchyroll support #49
|
@ -14,7 +14,7 @@ android {
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 4200 //00.04.200
|
versionCode 4200 //00.04.200
|
||||||
versionName "1.0.0-alpha3"
|
versionName "1.0.0-alpha4"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
resValue "string", "build_time", buildTime()
|
resValue "string", "build_time", buildTime()
|
||||||
|
|
|
@ -106,7 +106,7 @@ data class ContinueWatchingItem(
|
||||||
// @SerialName("completion_status") val completionStatus: Boolean,
|
// @SerialName("completion_status") val completionStatus: Boolean,
|
||||||
@SerialName("playhead") val playhead: Int,
|
@SerialName("playhead") val playhead: Int,
|
||||||
// not present in watchlist -> continue_watching_item
|
// 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
|
// EpisodePanel is used in ContinueWatchingItem
|
||||||
|
|
|
@ -81,7 +81,8 @@ class HomeFragment : Fragment() {
|
||||||
// continue watching
|
// continue watching
|
||||||
val upNextJob = lifecycleScope.launch {
|
val upNextJob = lifecycleScope.launch {
|
||||||
// TODO create EpisodeItemAdapter, which will start the playback of the selected episode immediately
|
// 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
|
binding.recyclerNewEpisodes.adapter = adapterUpNext
|
||||||
}
|
}
|
||||||
asyncJobList.add(upNextJob)
|
asyncJobList.add(upNextJob)
|
||||||
|
|
|
@ -23,7 +23,13 @@ fun Collection<Item>.toItemMediaList(): List<ItemMedia> {
|
||||||
|
|
||||||
@JvmName("toItemMediaListContinueWatchingItem")
|
@JvmName("toItemMediaListContinueWatchingItem")
|
||||||
fun Collection<ContinueWatchingItem>.toItemMediaList(): List<ItemMedia> {
|
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)
|
ItemMedia(it.panel.episodeMetadata.seriesId, it.panel.title, it.panel.images.thumbnail[0][0].source)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue