don't show fully watched episodes in "Up next"
This commit is contained in:
		| @ -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) | ||||
|     } | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user