Skip to content

Commit bd24e46

Browse files
committed
ci: fix builds
1 parent 9a9b618 commit bd24e46

File tree

3 files changed

+34
-30
lines changed

3 files changed

+34
-30
lines changed

Moflix/src/main/kotlin/com/bnyro/Moflix.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import com.lagradost.cloudstream3.utils.*
99
import com.lagradost.cloudstream3.utils.AppUtils.parseJson
1010
import com.lagradost.cloudstream3.utils.AppUtils.toJson
1111
import org.jsoup.Jsoup
12-
import kotlin.math.roundToInt
1312

1413
open class Moflix : MainAPI() {
1514
override var name = "Moflix"
@@ -92,7 +91,7 @@ open class Moflix : MainAPI() {
9291
val description = res.title?.description
9392
val trailers = res.title?.videos?.filter { it.category.equals("trailer", true) }
9493
?.mapNotNull { it.src }
95-
val rating = "${res.title?.rating}".toRatingInt()
94+
val score = res.title?.rating?.let { Score.from10(it) }
9695
val actors = res.credits?.actors?.mapNotNull {
9796
ActorData(
9897
Actor(it.name ?: return@mapNotNull null, it.poster),
@@ -122,7 +121,7 @@ open class Moflix : MainAPI() {
122121
this.season = episode.seasonNumber
123122
this.episode = episode.episodeNumber
124123
this.posterUrl = episode.poster
125-
this.rating = episode.rating?.times(10)?.roundToInt()
124+
this.score = Score.from(episode.rating, 1)
126125
this.description = episode.description
127126
this.addDate(episode.releaseDate?.substringBefore("T"))
128127
}
@@ -135,7 +134,7 @@ open class Moflix : MainAPI() {
135134
this.showStatus = getStatus(res.title?.status)
136135
this.plot = description
137136
this.tags = tags
138-
this.rating = rating
137+
this.score = score
139138
this.actors = actors
140139
this.duration = duration
141140
this.recommendations = recommendations
@@ -159,7 +158,7 @@ open class Moflix : MainAPI() {
159158
this.comingSoon = res.title?.status.equals("upcoming", true)
160159
this.plot = description
161160
this.tags = tags
162-
this.rating = rating
161+
this.score = score
163162
this.actors = actors
164163
this.duration = duration
165164
this.recommendations = recommendations

Netzkino/src/main/kotlin/com/bnyro/NetzkinoProvider.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import com.lagradost.cloudstream3.LoadResponse
77
import com.lagradost.cloudstream3.LoadResponse.Companion.addActors
88
import com.lagradost.cloudstream3.MainAPI
99
import com.lagradost.cloudstream3.MainPageRequest
10+
import com.lagradost.cloudstream3.Score
1011
import com.lagradost.cloudstream3.SearchResponse
1112
import com.lagradost.cloudstream3.SubtitleFile
1213
import com.lagradost.cloudstream3.TvType
@@ -73,7 +74,9 @@ open class NetzkinoProvider : MainAPI() {
7374
this.plot = response.content
7475
this.duration = response.customFields.duration.firstOrNull()?.toIntOrNull()?.div(60)
7576
this.year = response.customFields.jahr.firstOrNull()?.toIntOrNull()
76-
this.rating = response.customFields.imdbBewertung.firstOrNull()?.toFloatOrNull()?.roundToInt()
77+
this.score = response.customFields.imdbBewertung.firstOrNull()?.toFloatOrNull()?.let {
78+
Score.from10(it.roundToInt())
79+
}
7780
addActors(response.customFields.stars.map { it.split(",") }.flatten())
7881
}
7982
}

build.gradle.kts

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import com.lagradost.cloudstream3.gradle.CloudstreamExtension
21
import com.android.build.gradle.BaseExtension
2+
import com.lagradost.cloudstream3.gradle.CloudstreamExtension
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
35

46
buildscript {
57
repositories {
68
google()
79
mavenCentral()
8-
// Shitpack repo which contains our tools and dependencies
10+
// Jitpack repo which contains our tools and dependencies
911
maven("https://jitpack.io")
1012
}
1113

@@ -44,43 +46,43 @@ subprojects {
4446

4547
defaultConfig {
4648
minSdk = 21
47-
compileSdkVersion(33)
48-
targetSdk = 33
49+
compileSdkVersion(35)
50+
targetSdk = 35
4951
}
5052

5153
compileOptions {
5254
sourceCompatibility = JavaVersion.VERSION_1_8
5355
targetCompatibility = JavaVersion.VERSION_1_8
5456
}
5557

56-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
57-
kotlinOptions {
58-
jvmTarget = "1.8" // Required
59-
// Disables some unnecessary features
60-
freeCompilerArgs = freeCompilerArgs +
61-
"-Xno-call-assertions" +
62-
"-Xno-param-assertions" +
63-
"-Xno-receiver-assertions"
58+
tasks.withType<KotlinJvmCompile> {
59+
compilerOptions {
60+
jvmTarget.set(JvmTarget.JVM_1_8) // Required
61+
freeCompilerArgs.addAll(
62+
"-Xno-call-assertions",
63+
"-Xno-param-assertions",
64+
"-Xno-receiver-assertions"
65+
)
6466
}
6567
}
6668
}
6769

6870
dependencies {
69-
val apk by configurations
71+
val cloudstream by configurations
7072
val implementation by configurations
7173

72-
// Stubs for all Cloudstream classes
73-
apk("com.lagradost:cloudstream3:pre-release")
74+
// Stubs for all cloudstream classes
75+
cloudstream("com.lagradost:cloudstream3:pre-release")
7476

75-
// these dependencies can include any of those which are added by the app,
76-
// but you dont need to include any of them if you dont need them
77-
// https://github.com/recloudstream/cloudstream/blob/master/app/build.gradle
78-
implementation(kotlin("stdlib")) // adds standard kotlin features
79-
implementation("com.github.Blatzar:NiceHttp:0.4.13") // http library
80-
implementation("org.jsoup:jsoup:1.18.1") // html parser
81-
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.17.2")
82-
implementation("com.fasterxml.jackson.core:jackson-databind:2.17.2")
83-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
77+
// These dependencies can include any of those which are added by the app,
78+
// but you don't need to include any of them if you don't need them.
79+
// https://github.com/recloudstream/cloudstream/blob/master/app/build.gradle.kts
80+
implementation(kotlin("stdlib")) // Adds Standard Kotlin Features
81+
implementation("com.github.Blatzar:NiceHttp:0.4.13") // HTTP Lib
82+
implementation("org.jsoup:jsoup:1.21.2") // HTML Parser
83+
// IMPORTANT: Do not bump Jackson above 2.13.1, as newer versions will
84+
// break compatibility on older Android devices.
85+
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.16.0") // JSON Parser
8486
}
8587
}
8688

0 commit comments

Comments
 (0)