add up next to home screen
for now up next will show the series and not play the actual episode
This commit is contained in:
@ -368,4 +368,21 @@ object Crunchyroll {
|
||||
return objects(objects)
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*/
|
||||
suspend fun upNextAccount(n: Int = 20): ContinueWatchingList {
|
||||
val watchlistEndpoint = "/content/v1/$accountID/up_next_account"
|
||||
val parameters = listOf("locale" to locale, "n" to n)
|
||||
|
||||
val resultUpNextAccount = request(watchlistEndpoint, parameters)
|
||||
val list: ContinueWatchingList = resultUpNextAccount.component1()?.obj()?.let {
|
||||
json.decodeFromString(it.toString())
|
||||
} ?: NoneContinueWatchingList
|
||||
|
||||
// val objects = list.items.map{ it.panel.episodeMetadata.seriesId }
|
||||
// return objects(objects)
|
||||
return list
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,15 +17,19 @@ enum class SortBy(val str: String) {
|
||||
/**
|
||||
* search, browse, watchlist data types (all collections)
|
||||
*/
|
||||
|
||||
// TODO make generic
|
||||
@Serializable
|
||||
data class Collection(
|
||||
@SerialName("total") val total: Int,
|
||||
@SerialName("items") val items: List<Item>
|
||||
)
|
||||
|
||||
// TODO don't use aliases
|
||||
typealias SearchCollection = Collection
|
||||
typealias BrowseResult = Collection
|
||||
typealias Watchlist = Collection
|
||||
typealias UpNextAccount = Collection
|
||||
|
||||
@Serializable
|
||||
data class SearchResult(
|
||||
@ -44,9 +48,10 @@ data class ContinueWatchingItem(
|
||||
@SerialName("panel") val panel: EpisodePanel,
|
||||
@SerialName("new") val new: Boolean,
|
||||
@SerialName("new_content") val newContent: Boolean,
|
||||
@SerialName("is_favorite") val isFavorite: Boolean,
|
||||
@SerialName("never_watched") val neverWatched: Boolean,
|
||||
@SerialName("completion_status") val completionStatus: Boolean,
|
||||
// not present in up_next_account's continue_watching_item
|
||||
// @SerialName("is_favorite") val isFavorite: Boolean,
|
||||
// @SerialName("never_watched") val neverWatched: Boolean,
|
||||
// @SerialName("completion_status") val completionStatus: Boolean,
|
||||
@SerialName("playhead") val playhead: Int,
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user