mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Merge branch 'recloudstream:master' into master
This commit is contained in:
commit
9895ebc9ab
2 changed files with 27 additions and 13 deletions
|
@ -440,9 +440,9 @@ class SimklApi(index: Int) : AccountManager(index), SyncAPI {
|
||||||
interceptor = interceptor
|
interceptor = interceptor
|
||||||
).isSuccessful
|
).isSuccessful
|
||||||
} else {
|
} else {
|
||||||
val statusResponse = status?.let { setStatus ->
|
val statusResponse = this.status?.let { setStatus ->
|
||||||
val newStatus =
|
val newStatus =
|
||||||
SimklListStatusType.values()
|
SimklListStatusType.entries
|
||||||
.firstOrNull { it.value == setStatus }?.originalName
|
.firstOrNull { it.value == setStatus }?.originalName
|
||||||
?: SimklListStatusType.Watching.originalName!!
|
?: SimklListStatusType.Watching.originalName!!
|
||||||
|
|
||||||
|
@ -479,9 +479,14 @@ class SimklApi(index: Int) : AccountManager(index), SyncAPI {
|
||||||
).isSuccessful
|
).isSuccessful
|
||||||
} ?: true
|
} ?: true
|
||||||
|
|
||||||
|
// You cannot rate if you are planning to watch it.
|
||||||
|
val shouldRate =
|
||||||
|
score != null && status != SimklListStatusType.Planning.value
|
||||||
|
val realScore = if (shouldRate) score else null
|
||||||
|
|
||||||
val historyResponse =
|
val historyResponse =
|
||||||
// Only post if there are episodes or score to upload
|
// Only post if there are episodes or score to upload
|
||||||
if (addEpisodes != null || score != null) {
|
if (addEpisodes != null || shouldRate) {
|
||||||
app.post(
|
app.post(
|
||||||
"${this.url}/sync/history",
|
"${this.url}/sync/history",
|
||||||
json = StatusRequest(
|
json = StatusRequest(
|
||||||
|
@ -492,8 +497,8 @@ class SimklApi(index: Int) : AccountManager(index), SyncAPI {
|
||||||
ids,
|
ids,
|
||||||
addEpisodes?.first,
|
addEpisodes?.first,
|
||||||
addEpisodes?.second,
|
addEpisodes?.second,
|
||||||
score,
|
realScore,
|
||||||
score?.let { time },
|
realScore?.let { time },
|
||||||
)
|
)
|
||||||
), movies = emptyList()
|
), movies = emptyList()
|
||||||
),
|
),
|
||||||
|
@ -827,7 +832,13 @@ class SimklApi(index: Int) : AccountManager(index), SyncAPI {
|
||||||
|
|
||||||
if (foundItem != null) {
|
if (foundItem != null) {
|
||||||
return SimklSyncStatus(
|
return SimklSyncStatus(
|
||||||
status = foundItem.status?.let { SyncWatchType.fromInternalId(SimklListStatusType.fromString(it)?.value) }
|
status = foundItem.status?.let {
|
||||||
|
SyncWatchType.fromInternalId(
|
||||||
|
SimklListStatusType.fromString(
|
||||||
|
it
|
||||||
|
)?.value
|
||||||
|
)
|
||||||
|
}
|
||||||
?: return null,
|
?: return null,
|
||||||
score = foundItem.user_rating,
|
score = foundItem.user_rating,
|
||||||
watchedEpisodes = foundItem.watched_episodes_count,
|
watchedEpisodes = foundItem.watched_episodes_count,
|
||||||
|
@ -839,7 +850,7 @@ class SimklApi(index: Int) : AccountManager(index), SyncAPI {
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
return SimklSyncStatus(
|
return SimklSyncStatus(
|
||||||
status = SyncWatchType.fromInternalId(SimklListStatusType.None.value) ,
|
status = SyncWatchType.fromInternalId(SimklListStatusType.None.value),
|
||||||
score = 0,
|
score = 0,
|
||||||
watchedEpisodes = 0,
|
watchedEpisodes = 0,
|
||||||
maxEpisodes = if (searchResult.type == "movie") 0 else searchResult.total_episodes,
|
maxEpisodes = if (searchResult.type == "movie") 0 else searchResult.total_episodes,
|
||||||
|
@ -859,8 +870,10 @@ class SimklApi(index: Int) : AccountManager(index), SyncAPI {
|
||||||
val builder = SimklScoreBuilder.Builder()
|
val builder = SimklScoreBuilder.Builder()
|
||||||
.apiUrl(this.mainUrl)
|
.apiUrl(this.mainUrl)
|
||||||
.score(status.score, simklStatus?.oldScore)
|
.score(status.score, simklStatus?.oldScore)
|
||||||
.status(status.status.internalId, (status as? SimklSyncStatus)?.oldStatus?.let { oldStatus ->
|
.status(
|
||||||
SimklListStatusType.values().firstOrNull {
|
status.status.internalId,
|
||||||
|
(status as? SimklSyncStatus)?.oldStatus?.let { oldStatus ->
|
||||||
|
SimklListStatusType.entries.firstOrNull {
|
||||||
it.originalName == oldStatus
|
it.originalName == oldStatus
|
||||||
}?.value
|
}?.value
|
||||||
})
|
})
|
||||||
|
@ -996,7 +1009,7 @@ class SimklApi(index: Int) : AccountManager(index), SyncAPI {
|
||||||
val list = getSyncListSmart() ?: return null
|
val list = getSyncListSmart() ?: return null
|
||||||
|
|
||||||
val baseMap =
|
val baseMap =
|
||||||
SimklListStatusType.values()
|
SimklListStatusType.entries
|
||||||
.filter { it.value >= 0 && it.value != SimklListStatusType.ReWatching.value }
|
.filter { it.value >= 0 && it.value != SimklListStatusType.ReWatching.value }
|
||||||
.associate {
|
.associate {
|
||||||
it.stringRes to emptyList<SyncAPI.LibraryItem>()
|
it.stringRes to emptyList<SyncAPI.LibraryItem>()
|
||||||
|
|
|
@ -681,6 +681,7 @@ open class ResultFragmentPhone : FullScreenPlayer() {
|
||||||
resultMetaYear.setText(d.yearText)
|
resultMetaYear.setText(d.yearText)
|
||||||
resultMetaDuration.setText(d.durationText)
|
resultMetaDuration.setText(d.durationText)
|
||||||
resultMetaRating.setText(d.ratingText)
|
resultMetaRating.setText(d.ratingText)
|
||||||
|
resultMetaStatus.setText(d.onGoingText)
|
||||||
resultMetaContentRating.setText(d.contentRatingText)
|
resultMetaContentRating.setText(d.contentRatingText)
|
||||||
resultCastText.setText(d.actorsText)
|
resultCastText.setText(d.actorsText)
|
||||||
resultNextAiring.setText(d.nextAiringEpisode)
|
resultNextAiring.setText(d.nextAiringEpisode)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue