2021-11-12 16:55:54 +00:00
|
|
|
package com.lagradost.cloudstream3.syncproviders
|
|
|
|
|
2022-04-18 00:26:13 +00:00
|
|
|
import com.lagradost.cloudstream3.*
|
2021-11-12 16:55:54 +00:00
|
|
|
|
2021-11-20 00:41:37 +00:00
|
|
|
interface SyncAPI : OAuth2API {
|
2022-04-01 20:05:34 +00:00
|
|
|
val mainUrl: String
|
|
|
|
|
|
|
|
/**
|
|
|
|
-1 -> None
|
|
|
|
0 -> Watching
|
|
|
|
1 -> Completed
|
|
|
|
2 -> OnHold
|
|
|
|
3 -> Dropped
|
|
|
|
4 -> PlanToWatch
|
|
|
|
5 -> ReWatching
|
|
|
|
*/
|
|
|
|
suspend fun score(id: String, status: SyncStatus): Boolean
|
|
|
|
|
|
|
|
suspend fun getStatus(id: String): SyncStatus?
|
|
|
|
|
|
|
|
suspend fun getResult(id: String): SyncResult?
|
|
|
|
|
|
|
|
suspend fun search(name: String): List<SyncSearchResult>?
|
|
|
|
|
2022-04-18 00:26:13 +00:00
|
|
|
fun getIdFromUrl(url : String) : String
|
|
|
|
|
2021-11-12 16:55:54 +00:00
|
|
|
data class SyncSearchResult(
|
2022-04-18 00:26:13 +00:00
|
|
|
override val name: String,
|
|
|
|
override val apiName: String,
|
|
|
|
var syncId: String,
|
|
|
|
override val url: String,
|
|
|
|
override var posterUrl: String?,
|
|
|
|
override var type: TvType? = null,
|
|
|
|
override var quality: SearchQuality? = null,
|
|
|
|
override var posterHeaders: Map<String, String>? = null,
|
|
|
|
override var id: Int? = null,
|
|
|
|
) : SearchResponse
|
2021-11-12 16:55:54 +00:00
|
|
|
|
|
|
|
data class SyncNextAiring(
|
|
|
|
val episode: Int,
|
|
|
|
val unixTime: Long,
|
|
|
|
)
|
|
|
|
|
|
|
|
data class SyncStatus(
|
|
|
|
val status: Int,
|
|
|
|
/** 1-10 */
|
|
|
|
val score: Int?,
|
|
|
|
val watchedEpisodes: Int?,
|
|
|
|
var isFavorite: Boolean? = null,
|
2022-04-03 15:00:50 +00:00
|
|
|
var maxEpisodes : Int? = null,
|
2021-11-12 16:55:54 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
data class SyncResult(
|
|
|
|
/**Used to verify*/
|
|
|
|
var id: String,
|
|
|
|
|
|
|
|
var totalEpisodes: Int? = null,
|
|
|
|
|
|
|
|
var title: String? = null,
|
|
|
|
/**1-1000*/
|
|
|
|
var publicScore: Int? = null,
|
|
|
|
/**In minutes*/
|
|
|
|
var duration: Int? = null,
|
|
|
|
var synopsis: String? = null,
|
|
|
|
var airStatus: ShowStatus? = null,
|
|
|
|
var nextAiring: SyncNextAiring? = null,
|
2022-04-01 20:05:34 +00:00
|
|
|
var studio: List<String>? = null,
|
2021-11-12 16:55:54 +00:00
|
|
|
var genres: List<String>? = null,
|
2022-04-02 22:06:35 +00:00
|
|
|
var synonyms: List<String>? = null,
|
2022-06-17 20:43:42 +00:00
|
|
|
var trailers: List<String>? = null,
|
2022-04-02 22:06:35 +00:00
|
|
|
var isAdult : Boolean? = null,
|
2022-04-03 01:13:02 +00:00
|
|
|
var posterUrl: String? = null,
|
|
|
|
var backgroundPosterUrl : String? = null,
|
2021-11-12 16:55:54 +00:00
|
|
|
|
|
|
|
/** In unixtime */
|
|
|
|
var startDate: Long? = null,
|
|
|
|
/** In unixtime */
|
|
|
|
var endDate: Long? = null,
|
|
|
|
var recommendations: List<SyncSearchResult>? = null,
|
|
|
|
var nextSeason: SyncSearchResult? = null,
|
|
|
|
var prevSeason: SyncSearchResult? = null,
|
2022-04-03 17:11:18 +00:00
|
|
|
var actors: List<ActorData>? = null,
|
2021-11-12 16:55:54 +00:00
|
|
|
)
|
|
|
|
}
|