mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Merge remote-tracking branch 'origin/master' into clipboard
This commit is contained in:
commit
55ab5a45af
4 changed files with 28 additions and 15 deletions
|
@ -230,7 +230,7 @@ dependencies {
|
||||||
// Downloading & Networking
|
// Downloading & Networking
|
||||||
implementation("androidx.work:work-runtime:2.9.0")
|
implementation("androidx.work:work-runtime:2.9.0")
|
||||||
implementation("androidx.work:work-runtime-ktx:2.9.0")
|
implementation("androidx.work:work-runtime-ktx:2.9.0")
|
||||||
implementation("com.github.Blatzar:NiceHttp:0.4.5") // HTTP Lib
|
implementation("com.github.Blatzar:NiceHttp:0.4.11") // HTTP Lib
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register("androidSourcesJar", Jar::class) {
|
tasks.register("androidSourcesJar", Jar::class) {
|
||||||
|
|
|
@ -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,
|
||||||
|
@ -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>()
|
||||||
|
|
|
@ -678,6 +678,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)
|
||||||
|
|
|
@ -10,7 +10,6 @@ import com.lagradost.cloudstream3.utils.TestingUtils
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.cancel
|
import kotlinx.coroutines.cancel
|
||||||
import okhttp3.internal.toImmutableList
|
|
||||||
|
|
||||||
class TestViewModel : ViewModel() {
|
class TestViewModel : ViewModel() {
|
||||||
data class TestProgress(
|
data class TestProgress(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue