KitsuApi

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class KitsuAnimeAttributes(val titles: KitsuApi.KitsuTitles?, val canonicalTitle: String?, val posterImage: KitsuApi.KitsuPosterImage?, val synopsis: String?, val startDate: String?, val endDate: String?, val episodeCount: Int?, val episodeLength: Int?)
Link copied to clipboard
data class KitsuAnimeData(val id: String, val attributes: KitsuApi.KitsuAnimeAttributes)
Link copied to clipboard
data class KitsuLinks(val first: String?, val next: String?, val last: String?, val related: String?)
Link copied to clipboard
data class KitsuNode(val id: String, val attributes: KitsuApi.KitsuNodeAttributes, val relationships: KitsuApi.KitsuRelationships?, var anime: KitsuApi.KitsuAnimeData?)
Link copied to clipboard
data class KitsuNodeAttributes(val titles: KitsuApi.KitsuTitles?, val canonicalTitle: String?, val posterImage: KitsuApi.KitsuPosterImage?, val synopsis: String?, val startDate: String?, val endDate: String?, val episodeCount: Int?, val episodeLength: Int?, val name: String?, val location: String?, val createdAt: String?, val avatar: KitsuApi.KitsuUserAvatar?, val progress: Int?, val ratingTwenty: Float?, val updatedAt: String?, val status: String?)
Link copied to clipboard
data class KitsuPosterImage(val large: String?, val medium: String?)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
data class KitsuResponse(val links: KitsuApi.KitsuLinks?, val data: List<KitsuApi.KitsuNode>, val included: List<KitsuApi.KitsuAnimeData>?)
Link copied to clipboard
data class KitsuTitles(val enJp: String?, val jaJp: String?)
Link copied to clipboard
data class KitsuUserAvatar(val original: String?)
Link copied to clipboard
data class ResponseToken(val tokenType: String, val expiresIn: Int, val accessToken: String, val refreshToken: String)

Properties

Link copied to clipboard
open override val createAccountUrl: String

Link to a website for creating a new account

Link copied to clipboard
open override val hasInApp: Boolean = true

Has in app login support, aka login with a dialog

Link copied to clipboard
open val hasOAuth2: Boolean = false

Has OAuth2 login support, including login, loginRequest and refreshToken

Link copied to clipboard
open val hasPin: Boolean = false

Has on device pin support, aka login with a QR code

Link copied to clipboard
open override val icon: ERROR CLASS: Unresolved name: kitsu_icon

Drawable icon of the service

Link copied to clipboard
open override val idPrefix: String
Link copied to clipboard

The requirements to login in app

Link copied to clipboard
open override val mainUrl: String
Link copied to clipboard
open override var name: String
Link copied to clipboard
open val redirectUrlIdentifier: String? = null

The sensitive redirect URL from OAuth should contain "/redirectUrlIdentifier" to trigger the login

Link copied to clipboard

Set this to true if the user updates something on the list like watch status or score

Link copied to clipboard
open val requiresLogin: Boolean = true

If this service requires an account to use

Link copied to clipboard

Currently unused, but will be used to correctly render the UI. This should specify what sync watch types can be used with this service.

Link copied to clipboard
open override val syncIdName: SyncIdName

Allows certain providers to open pages from library links.

Functions

Link copied to clipboard
suspend fun getAnimeIdByTitle(title: String): String?
Link copied to clipboard
Link copied to clipboard
open suspend fun invalidateToken(token: AuthToken): Nothing

An optional security measure to make sure that even if an attacker gets ahold of the token, it will be invalid.

Link copied to clipboard

Is this url a valid redirect url for this service?

Link copied to clipboard
open suspend override fun library(auth: AuthData?): SyncAPI.LibraryMetadata?

Get the current library/bookmarks of this service

Link copied to clipboard
open suspend override fun load(auth: AuthData?, id: String): SyncAPI.SyncResult?

Get metadata about an item

Link copied to clipboard
open suspend fun login(payload: AuthPinData): AuthToken?

Pin login, this will be called periodically while logging in to check if the pin has been verified by the user

open suspend fun login(redirectUrl: String, payload: String?): AuthToken?

OAuth2 login from a valid redirectUrl, and payload given in loginRequest

open suspend override fun login(form: AuthLoginResponse): AuthToken?

In app login

Link copied to clipboard
Link copied to clipboard

OAuth2 login request, asking the service to provide a url to open in the browser

Link copied to clipboard
open suspend fun pinRequest(): AuthPinData?

Pin login request, asking the service to provide an verificationUrl to display with a QR code

Link copied to clipboard
open suspend override fun refreshToken(token: AuthToken): AuthToken

OAuth2 token refresh, this ensures that all token passed to other functions will be valid

Link copied to clipboard
open suspend override fun search(auth: AuthData?, query: String): List<SyncAPI.SyncSearchResult>?

Search this service for any results for a given query

Link copied to clipboard
open suspend override fun status(auth: AuthData?, id: String): SyncAPI.AbstractSyncStatus?

Get the current status of an item

Link copied to clipboard
Link copied to clipboard
open suspend override fun updateStatus(auth: AuthData?, id: String, newStatus: SyncAPI.AbstractSyncStatus): Boolean

Modify the current status of an item

Link copied to clipboard
open override fun urlToId(url: String): String?

Helper function, may be used in the future

Link copied to clipboard
open suspend override fun user(token: AuthToken?): AuthUser?

Get the visible user account