forked from recloudstream/cloudstream
future proofed SyncID
This commit is contained in:
parent
cd166cb0d3
commit
df95931d0a
3 changed files with 9 additions and 5 deletions
|
@ -138,7 +138,11 @@ interface SyncAPI : OAuth2API {
|
|||
data class LibraryItem(
|
||||
override val name: String,
|
||||
override val url: String,
|
||||
/** Unique unchanging string used for data storage */
|
||||
/**
|
||||
* Unique unchanging string used for data storage.
|
||||
* This should be the actual id when you change scores and status
|
||||
* since score changes from library might get added in the future.
|
||||
**/
|
||||
val syncId: String,
|
||||
val episodesCompleted: Int?,
|
||||
val episodesTotal: Int?,
|
||||
|
|
|
@ -72,7 +72,7 @@ class LocalList : SyncAPI {
|
|||
it.second.stringRes
|
||||
}.mapValues { group ->
|
||||
group.value.mapNotNull {
|
||||
getBookmarkedData(it.first)?.toLibraryItem()
|
||||
getBookmarkedData(it.first)?.toLibraryItem(it.first.toString())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,16 +55,16 @@ object DataStoreHelper {
|
|||
@JsonProperty("quality") override var quality: SearchQuality? = null,
|
||||
@JsonProperty("posterHeaders") override var posterHeaders: Map<String, String>? = null,
|
||||
) : SearchResponse {
|
||||
fun toLibraryItem(): SyncAPI.LibraryItem {
|
||||
fun toLibraryItem(id: String): SyncAPI.LibraryItem {
|
||||
return SyncAPI.LibraryItem(
|
||||
name,
|
||||
url,
|
||||
url,
|
||||
id,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
apiName, type, posterUrl, posterHeaders, quality, id
|
||||
apiName, type, posterUrl, posterHeaders, quality, this.id
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue