Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
9ba0661
Test kotlinx-serialization support
Luna712 May 13, 2026
d7db2e0
-
Luna712 May 13, 2026
94a6bc9
Add
Luna712 May 13, 2026
450e767
Update
Luna712 May 14, 2026
bcad70a
Try
Luna712 May 14, 2026
167b3ba
Update
Luna712 May 14, 2026
67a4439
-
Luna712 May 14, 2026
4329599
Fix
Luna712 May 14, 2026
4f0d867
Data class
Luna712 May 14, 2026
809e9bd
Fix
Luna712 May 14, 2026
11d07f4
No data class
Luna712 May 14, 2026
19fdb83
Add
Luna712 May 14, 2026
52e5689
add
Luna712 May 14, 2026
0e552c1
Add
Luna712 May 14, 2026
2167bf2
Add
Luna712 May 14, 2026
e26c8fc
Update
Luna712 May 14, 2026
80fff23
JsonElement
Luna712 May 14, 2026
817b5d3
Use JsonElement
Luna712 May 14, 2026
bc8efcd
Fix
Luna712 May 14, 2026
2694184
Fix
Luna712 May 14, 2026
ca8032f
Fix val
Luna712 May 14, 2026
e062e6e
Try transient
Luna712 May 14, 2026
b451213
Fix defaults
Luna712 May 14, 2026
5a9517a
Fix cast
Luna712 May 14, 2026
b913d2c
Fix defaults
Luna712 May 14, 2026
120bb73
+ExtractorLink
Luna712 May 14, 2026
2a9aca2
+SubtitleData
Luna712 May 14, 2026
52e468b
+ResultEpisode
Luna712 May 14, 2026
164331f
Transient
Luna712 May 14, 2026
8a1d1f8
+AudioFile
Luna712 May 14, 2026
35c0d65
+SeasonData
Luna712 May 14, 2026
95f553f
Add UriSerializer
Luna712 May 14, 2026
bc54724
Use UriSerializer
Luna712 May 14, 2026
cb4e6d3
Use UriSerializer
Luna712 May 14, 2026
74960ea
Fix parser
Luna712 May 14, 2026
9aeac02
Try support in DataStore
Luna712 May 14, 2026
f152393
Fix
Luna712 May 14, 2026
2494687
Fix
Luna712 May 14, 2026
e8cad16
Public
Luna712 May 14, 2026
162e23f
Try AppUtils support
Luna712 May 14, 2026
03f3905
Fix?
Luna712 May 14, 2026
1c1ee88
-
Luna712 May 14, 2026
3d893a9
-
Luna712 May 14, 2026
f9cc1d5
Fix parse
Luna712 May 14, 2026
656477c
Fix
Luna712 May 14, 2026
fda2886
Fix
Luna712 May 14, 2026
b49ca7a
Fix
Luna712 May 14, 2026
9cef364
Fix
Luna712 May 14, 2026
a1faeb4
Try fix
Luna712 May 14, 2026
a0aeb13
Fix
Luna712 May 14, 2026
0f3e2e3
-
Luna712 May 14, 2026
58244ec
Fix
Luna712 May 14, 2026
64f77aa
Merge branch 'coil-ktor' into test-kotlinx
Luna712 May 15, 2026
392caec
Merge branch 'coil-ktor' into test-kotlinx
Luna712 May 15, 2026
f465a06
Merge branch 'coil-ktor' into test-kotlinx
Luna712 May 15, 2026
56bbf25
Support
Luna712 May 15, 2026
63dc8e2
Fix
Luna712 May 15, 2026
1dea389
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 4, 2026
4ed9d01
Update
Luna712 Jun 4, 2026
3625dd3
Update
Luna712 Jun 4, 2026
5e052cc
-
Luna712 Jun 4, 2026
07a0231
-
Luna712 Jun 4, 2026
d3e7e67
Fix
Luna712 Jun 4, 2026
15a3ce1
Update
Luna712 Jun 6, 2026
5ba22da
Update
Luna712 Jun 6, 2026
d9617ac
Update
Luna712 Jun 6, 2026
03056da
Test
Luna712 Jun 6, 2026
593aca5
Fix
Luna712 Jun 6, 2026
d8cb28a
Update
Luna712 Jun 6, 2026
b2425bd
Try
Luna712 Jun 6, 2026
24b064d
explicitNulls = false test
Luna712 Jun 6, 2026
7789057
Try some changes
Luna712 Jun 6, 2026
8b9a62b
Add Array
Luna712 Jun 6, 2026
6c46bce
Support mixed types
Luna712 Jun 6, 2026
9a3acda
Try fallback
Luna712 Jun 6, 2026
6413d4e
test
Luna712 Jun 6, 2026
3b58609
Test
Luna712 Jun 6, 2026
69afa64
Try fixing transient
Luna712 Jun 6, 2026
25daec3
Fix parent
Luna712 Jun 6, 2026
2276194
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 21, 2026
019b877
Fix
Luna712 Jun 21, 2026
40fa2cb
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 23, 2026
749299e
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 23, 2026
3deb498
Update anilist
Luna712 Jun 23, 2026
3d30b97
Update
Luna712 Jun 23, 2026
08a523b
-test
Luna712 Jun 23, 2026
ac9b1af
run tests
Luna712 Jun 23, 2026
3beff90
Update MainAPI
Luna712 Jun 23, 2026
b3739c3
Try all tests at once
Luna712 Jun 23, 2026
7ac2d5f
Update
Luna712 Jun 23, 2026
76fde00
Update MDL
Luna712 Jun 23, 2026
895d5f5
Update
Luna712 Jun 23, 2026
326b71b
Fix
Luna712 Jun 23, 2026
52a017d
Fix
Luna712 Jun 23, 2026
64fa059
Fix trakt
Luna712 Jun 23, 2026
6e7bb28
Fix
Luna712 Jun 23, 2026
7af8234
Order
Luna712 Jun 23, 2026
0007b20
Try change
Luna712 Jun 23, 2026
9c87eab
Update
Luna712 Jun 23, 2026
58bc3bc
Update
Luna712 Jun 23, 2026
66b4a52
+
Luna712 Jun 23, 2026
cd268e8
-
Luna712 Jun 23, 2026
762e63e
Update
Luna712 Jun 23, 2026
430069f
Add
Luna712 Jun 23, 2026
1d8d9b6
test
Luna712 Jun 23, 2026
4ff80f5
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 23, 2026
0cc033e
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 23, 2026
2ece0b8
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 23, 2026
4f738a5
Fix anilist
Luna712 Jun 24, 2026
9d4d3c4
Fix trakt
Luna712 Jun 24, 2026
7e08cda
Fix anilist
Luna712 Jun 24, 2026
bbdca39
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 24, 2026
80d29e3
Update
Luna712 Jun 25, 2026
6c2c863
Update
Luna712 Jun 25, 2026
a440d1c
Fix
Luna712 Jun 25, 2026
939c97a
Keep JsonProperty
Luna712 Jun 25, 2026
e65b4ee
replace toKotlinObject
Luna712 Jun 25, 2026
087ec75
Update Simkl
Luna712 Jun 25, 2026
ba0bd30
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 25, 2026
1cb27c2
Update BackupUtils
Luna712 Jun 25, 2026
8ab4513
Update Torrent
Luna712 Jun 25, 2026
cad8b33
Update SyncUtil
Luna712 Jun 25, 2026
4e1586f
Update ControllerActivity
Luna712 Jun 25, 2026
784ca77
Fix
Luna712 Jun 25, 2026
076433a
Remove use of toKotlinObject
Luna712 Jun 25, 2026
a5b41e2
Fix
Luna712 Jun 25, 2026
f9d4b97
Update aes
Luna712 Jun 25, 2026
901dac9
Update gogohelper
Luna712 Jun 25, 2026
f12063f
Update JWPlayerHelper
Luna712 Jun 25, 2026
a70f75c
Update wcohelper
Luna712 Jun 25, 2026
b35aebf
Fix match for ExtractorAPI
Luna712 Jun 25, 2026
142654c
Try
Luna712 Jun 25, 2026
f74afe2
+
Luna712 Jun 25, 2026
e8a1bd8
Fix
Luna712 Jun 25, 2026
fd22a32
Fix subtitle
Luna712 Jun 25, 2026
0654b82
-
Luna712 Jun 25, 2026
521e7fc
Update InAppUpdater
Luna712 Jun 25, 2026
52d65af
Update DataStoreHelper
Luna712 Jun 25, 2026
12c3827
Fix
Luna712 Jun 25, 2026
d073639
WriteOnly
Luna712 Jun 25, 2026
a5aac7c
Update
Luna712 Jun 26, 2026
be71cbd
-
Luna712 Jun 26, 2026
95c0eed
Comments
Luna712 Jun 26, 2026
1088846
Skip abstract
Luna712 Jun 26, 2026
76a3926
Fix
Luna712 Jun 26, 2026
042817e
Fix
Luna712 Jun 26, 2026
694193f
Update DownloadObjects
Luna712 Jun 26, 2026
08eab05
Skip
Luna712 Jun 26, 2026
135b137
Fix
Luna712 Jun 26, 2026
5c8cbfb
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 26, 2026
22d8b41
-
Luna712 Jun 26, 2026
a479c88
Fix
Luna712 Jun 26, 2026
17858a0
Update DataStoreHelper
Luna712 Jun 26, 2026
e10bec1
Update
Luna712 Jun 26, 2026
b2ea5bb
logging test apputils
Luna712 Jun 26, 2026
506c89e
trace logging
Luna712 Jun 26, 2026
d9af390
Test kotlinx inline
Luna712 Jun 26, 2026
90dcd5e
Fix
Luna712 Jun 26, 2026
4e3244a
Test
Luna712 Jun 26, 2026
d6f81b5
Fix
Luna712 Jun 26, 2026
6e2001c
Revert
Luna712 Jun 26, 2026
3d85bfb
Add inline version
Luna712 Jun 26, 2026
6457624
Add inline version
Luna712 Jun 26, 2026
653190f
Add inline version
Luna712 Jun 26, 2026
8d63c64
Fix
Luna712 Jun 26, 2026
5e5e8b2
Fix
Luna712 Jun 26, 2026
89d8b5a
Fix
Luna712 Jun 26, 2026
279c5b7
Fix
Luna712 Jun 26, 2026
b24d9c7
-
Luna712 Jun 26, 2026
5ad9ddd
Fix
Luna712 Jun 26, 2026
9765430
Fix
Luna712 Jun 26, 2026
2360256
Fix
Luna712 Jun 26, 2026
fdd4f20
Update
Luna712 Jun 26, 2026
34e2ae5
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jun 30, 2026
046f11b
Try fix Smikl
Luna712 Jul 1, 2026
29e8877
Add JsonIgnore
Luna712 Jul 1, 2026
fcd9503
Cleanup
Luna712 Jul 1, 2026
614a8b0
fix
Luna712 Jul 1, 2026
648faef
Update
Luna712 Jul 2, 2026
a0cf609
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jul 2, 2026
b9fd839
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jul 2, 2026
7233ace
Update
Luna712 Jul 2, 2026
a347819
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jul 2, 2026
d7e2880
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jul 3, 2026
6327319
Update
Luna712 Jul 3, 2026
8d2bd6c
Merge branch 'coil-ktor' into test-kotlinx
Luna712 Jul 3, 2026
ce40964
Update
Luna712 Jul 3, 2026
6a1f23f
Use interface
Luna712 Jul 4, 2026
a2dd9ad
Try making LibrarySearchResponse an interface
Luna712 Jul 4, 2026
4ed1e1e
Try
Luna712 Jul 4, 2026
727aa9b
Bump
Luna712 Jul 4, 2026
ec89fca
Try
Luna712 Jul 4, 2026
36d4823
Try
Luna712 Jul 4, 2026
ccbde54
Try fix
Luna712 Jul 4, 2026
82b0b38
Test
Luna712 Jul 4, 2026
8e00bde
Test
Luna712 Jul 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cache-read-only: false

- name: Run Gradle
run: ./gradlew assemblePrereleaseDebug
run: ./gradlew assemblePrereleaseDebug lint check

- name: Upload Artifact
uses: actions/upload-artifact@v7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ class SerializationClassTester {
runCatching { Class.forName(it).kotlin }.getOrNull()
}.filter { kClass ->
// Not possible to use .hasAnnotation() on newer Android versions.
kClass.java.annotations.any {
it is Serializable
} && kClass.java.annotations.none { it is SkipSerializationTest }
kClass.java.annotations.any { it is Serializable }
&& kClass.java.annotations.none { it is SkipSerializationTest }
&& !kClass.isAbstract
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class CloudStreamApp : Application(), SingletonImageLoader.Factory {
}

fun <T : Any> setKeyClass(path: String, value: T) {
context?.setKey(path, value)
context?.setKey<Any>(path, value)
}

fun removeKeys(folder: String): Int? {
Expand All @@ -132,6 +132,11 @@ class CloudStreamApp : Application(), SingletonImageLoader.Factory {
context?.setKey(path, value)
}

@JvmName("setKeyReified")
inline fun <reified T : Any> setKey(path: String, value: T) {
context?.setKey(path, value)
}

fun <T> setKey(folder: String, path: String, value: T) {
context?.setKey(folder, path, value)
}
Expand Down

Large diffs are not rendered by default.

149 changes: 47 additions & 102 deletions app/src/main/java/com/lagradost/cloudstream3/ui/ControllerActivity.kt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ import androidx.annotation.OptIn
import androidx.media3.common.MimeTypes
import androidx.media3.common.util.UnstableApi
import androidx.media3.ui.SubtitleView
import com.fasterxml.jackson.annotation.JsonIgnore
import com.lagradost.cloudstream3.SubtitleFile
import com.lagradost.cloudstream3.ui.subtitles.SaveCaptionStyle
import com.lagradost.cloudstream3.ui.subtitles.SubtitlesFragment.Companion.setSubtitleViewStyle
import com.lagradost.cloudstream3.utils.SubtitleHelper.fromLanguageToTagIETF
import com.lagradost.cloudstream3.utils.UIHelper.toPx
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

enum class SubtitleStatus {
IS_ACTIVE,
Expand All @@ -32,17 +35,19 @@ enum class SubtitleOrigin {
* @param url Url for the subtitle, when EMBEDDED_IN_VIDEO this variable is used as the real backend id
* @param headers if empty it will use the base onlineDataSource headers else only the specified headers
* @param languageCode usually, tags such as "en", "es-mx", or "zh-hant-TW". But it could be something like "English 4"
* */
*/
@Serializable
data class SubtitleData(
val originalName: String,
val nameSuffix: String,
val url: String,
val origin: SubtitleOrigin,
val mimeType: String,
val headers: Map<String, String>,
val languageCode: String?,
@SerialName("originalName") val originalName: String,
@SerialName("nameSuffix") val nameSuffix: String,
@SerialName("url") val url: String,
@SerialName("origin") val origin: SubtitleOrigin,
@SerialName("mimeType") val mimeType: String,
@SerialName("headers") val headers: Map<String, String>,
@SerialName("languageCode") val languageCode: String?,
) {
/** Internal ID for exoplayer, unique for each link*/
/** Internal ID for media3, unique for each link. */
@JsonIgnore
fun getId(): String {
return if (origin == SubtitleOrigin.EMBEDDED_IN_VIDEO) url
else "$url|$name"
Expand All @@ -54,22 +59,22 @@ data class SubtitleData(
}

/** Tries hard to figure out a valid IETF tag based on language code and name. Will return null if not found. */
@JsonIgnore
fun getIETF_tag(): String? {
return fromLanguageToTagIETF(this.languageCode) ?: fromLanguageToTagIETF(this.originalName, halfMatch = true)
}

val name = "$originalName $nameSuffix"
@SerialName("name") val name = "$originalName $nameSuffix"

/**
* Gets the URL, but tries to fix it if it is malformed.
*/
@JsonIgnore
fun getFixedUrl(): String {
// Some extensions fail to include the protocol, this helps with that.
val fixedSubUrl = if (this.url.startsWith("//")) {
"https:${this.url}"
} else {
this.url
}
} else this.url
return fixedSubUrl
}
}
Expand Down Expand Up @@ -142,4 +147,4 @@ class PlayerSubtitleHelper {
setSubStyle(it)
}
}
}
}
165 changes: 62 additions & 103 deletions app/src/main/java/com/lagradost/cloudstream3/ui/player/Torrent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import com.lagradost.cloudstream3.mvvm.logError
import com.lagradost.cloudstream3.utils.ExtractorLink
import com.lagradost.cloudstream3.utils.ExtractorLinkType
import com.lagradost.cloudstream3.utils.newExtractorLink
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import torrServer.TorrServer
import java.io.File
import java.net.ConnectException
Expand All @@ -32,14 +34,14 @@ object Torrent {

/** Returns true if the server is up */
private suspend fun echo(): Boolean {
if(TORRENT_SERVER_URL.isEmpty()) {
if (TORRENT_SERVER_URL.isEmpty()) {
return false
}
return try {
app.get(
"$TORRENT_SERVER_URL/echo",
).text().isNotEmpty()
} catch (e: ConnectException) {
).text.isNotEmpty()
} catch (_: ConnectException) {
// `Failed to connect to /127.0.0.1:8090` if the server is down
false
} catch (t: Throwable) {
Expand All @@ -52,7 +54,7 @@ object Torrent {
/** Gracefully shutdown the server.
* should not be used because I am unable to start it again, and the stopTorrentServer() crashes the app */
suspend fun shutdown(): Boolean {
if(TORRENT_SERVER_URL.isEmpty()) {
if (TORRENT_SERVER_URL.isEmpty()) {
return false
}
return try {
Expand All @@ -68,7 +70,7 @@ object Torrent {
/** Lists all torrents by the server */
@Throws
private suspend fun list(): Array<TorrentStatus> {
if(TORRENT_SERVER_URL.isEmpty()) {
if (TORRENT_SERVER_URL.isEmpty()) {
throw ErrorLoadingException("Not initialized")
}
return app.post(
Expand All @@ -83,7 +85,7 @@ object Torrent {

/** Drops a single torrent, (I think) this means closing the stream. Returns returns if it is successful */
private suspend fun drop(hash: String): Boolean {
if(TORRENT_SERVER_URL.isEmpty()) {
if (TORRENT_SERVER_URL.isEmpty()) {
return false
}
return try {
Expand All @@ -104,7 +106,7 @@ object Torrent {

/** Removes a single torrent from the server registry */
private suspend fun rem(hash: String): Boolean {
if(TORRENT_SERVER_URL.isEmpty()) {
if (TORRENT_SERVER_URL.isEmpty()) {
return false
}
return try {
Expand All @@ -126,7 +128,7 @@ object Torrent {

/** Removes all torrents from the server, and returns if it is successful */
suspend fun clearAll(): Boolean {
if(TORRENT_SERVER_URL.isEmpty()) {
if (TORRENT_SERVER_URL.isEmpty()) {
return true
}
return try {
Expand Down Expand Up @@ -164,10 +166,8 @@ object Torrent {
/** Gets all the metadata of a torrent, will throw if that hash does not exists
* https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/web/api/torrents.go#L126 */
@Throws
suspend fun get(
hash: String,
): TorrentStatus {
if(TORRENT_SERVER_URL.isEmpty()) {
suspend fun get(hash: String): TorrentStatus {
if (TORRENT_SERVER_URL.isEmpty()) {
throw ErrorLoadingException("Not initialized")
}
return app.post(
Expand All @@ -184,7 +184,7 @@ object Torrent {
/** Adds a torrent to the server, this is needed for us to get the hash for further modification, as well as start streaming it*/
@Throws
private suspend fun add(url: String): TorrentStatus {
if(TORRENT_SERVER_URL.isEmpty()) {
if (TORRENT_SERVER_URL.isEmpty()) {
throw ErrorLoadingException("Not initialized")
}
return app.post(
Expand All @@ -204,7 +204,7 @@ object Torrent {
return true
}
val port = TorrServer.startTorrentServer(dir, 0)
if(port < 0) {
if (port < 0) {
return false
}
TORRENT_SERVER_URL = "http://127.0.0.1:$port"
Expand Down Expand Up @@ -278,94 +278,55 @@ object Torrent {

// https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/web/api/torrents.go#L18
// https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/main/web/api/route.go#L7
@Serializable
data class TorrentRequest(
@JsonProperty("action")
val action: String,
@JsonProperty("hash")
val hash: String = "",
@JsonProperty("link")
val link: String = "",
@JsonProperty("title")
val title: String = "",
@JsonProperty("poster")
val poster: String = "",
@JsonProperty("data")
val data: String = "",
@JsonProperty("save_to_db")
val saveToDB: Boolean = false,
@JsonProperty("action") @SerialName("action") val action: String,
@JsonProperty("hash") @SerialName("hash") val hash: String = "",
@JsonProperty("link") @SerialName("link") val link: String = "",
@JsonProperty("title") @SerialName("title") val title: String = "",
@JsonProperty("poster") @SerialName("poster") val poster: String = "",
@JsonProperty("data") @SerialName("data") val data: String = "",
@JsonProperty("save_to_db") @SerialName("save_to_db") val saveToDB: Boolean = false,
)

// https://github.com/Diegopyl1209/torrentserver-aniyomi/blob/c18f58e51b6738f053261bc863177078aa9c1c98/torr/state/state.go#L33
// omitempty = nullable
@Serializable
data class TorrentStatus(
@JsonProperty("title")
var title: String,
@JsonProperty("poster")
var poster: String,
@JsonProperty("data")
var data: String?,
@JsonProperty("timestamp")
var timestamp: Long,
@JsonProperty("name")
var name: String?,
@JsonProperty("hash")
var hash: String?,
@JsonProperty("stat")
var stat: Int,
@JsonProperty("stat_string")
var statString: String,
@JsonProperty("loaded_size")
var loadedSize: Long?,
@JsonProperty("torrent_size")
var torrentSize: Long?,
@JsonProperty("preloaded_bytes")
var preloadedBytes: Long?,
@JsonProperty("preload_size")
var preloadSize: Long?,
@JsonProperty("download_speed")
var downloadSpeed: Double?,
@JsonProperty("upload_speed")
var uploadSpeed: Double?,
@JsonProperty("total_peers")
var totalPeers: Int?,
@JsonProperty("pending_peers")
var pendingPeers: Int?,
@JsonProperty("active_peers")
var activePeers: Int?,
@JsonProperty("connected_seeders")
var connectedSeeders: Int?,
@JsonProperty("half_open_peers")
var halfOpenPeers: Int?,
@JsonProperty("bytes_written")
var bytesWritten: Long?,
@JsonProperty("bytes_written_data")
var bytesWrittenData: Long?,
@JsonProperty("bytes_read")
var bytesRead: Long?,
@JsonProperty("bytes_read_data")
var bytesReadData: Long?,
@JsonProperty("bytes_read_useful_data")
var bytesReadUsefulData: Long?,
@JsonProperty("chunks_written")
var chunksWritten: Long?,
@JsonProperty("chunks_read")
var chunksRead: Long?,
@JsonProperty("chunks_read_useful")
var chunksReadUseful: Long?,
@JsonProperty("chunks_read_wasted")
var chunksReadWasted: Long?,
@JsonProperty("pieces_dirtied_good")
var piecesDirtiedGood: Long?,
@JsonProperty("pieces_dirtied_bad")
var piecesDirtiedBad: Long?,
@JsonProperty("duration_seconds")
var durationSeconds: Double?,
@JsonProperty("bit_rate")
var bitRate: String?,
@JsonProperty("file_stats")
var fileStats: List<TorrentFileStat>?,
@JsonProperty("trackers")
var trackers: List<String>?,
@JsonProperty("title") @SerialName("title") var title: String,
@JsonProperty("poster") @SerialName("poster") var poster: String,
@JsonProperty("data") @SerialName("data") var data: String?,
@JsonProperty("timestamp") @SerialName("timestamp") var timestamp: Long,
@JsonProperty("name") @SerialName("name") var name: String?,
@JsonProperty("hash") @SerialName("hash") var hash: String?,
@JsonProperty("stat") @SerialName("stat") var stat: Int,
@JsonProperty("stat_string") @SerialName("stat_string") var statString: String,
@JsonProperty("loaded_size") @SerialName("loaded_size") var loadedSize: Long?,
@JsonProperty("torrent_size") @SerialName("torrent_size") var torrentSize: Long?,
@JsonProperty("preloaded_bytes") @SerialName("preloaded_bytes") var preloadedBytes: Long?,
@JsonProperty("preload_size") @SerialName("preload_size") var preloadSize: Long?,
@JsonProperty("download_speed") @SerialName("download_speed") var downloadSpeed: Double?,
@JsonProperty("upload_speed") @SerialName("upload_speed") var uploadSpeed: Double?,
@JsonProperty("total_peers") @SerialName("total_peers") var totalPeers: Int?,
@JsonProperty("pending_peers") @SerialName("pending_peers") var pendingPeers: Int?,
@JsonProperty("active_peers") @SerialName("active_peers") var activePeers: Int?,
@JsonProperty("connected_seeders") @SerialName("connected_seeders") var connectedSeeders: Int?,
@JsonProperty("half_open_peers") @SerialName("half_open_peers") var halfOpenPeers: Int?,
@JsonProperty("bytes_written") @SerialName("bytes_written") var bytesWritten: Long?,
@JsonProperty("bytes_written_data") @SerialName("bytes_written_data") var bytesWrittenData: Long?,
@JsonProperty("bytes_read") @SerialName("bytes_read") var bytesRead: Long?,
@JsonProperty("bytes_read_data") @SerialName("bytes_read_data") var bytesReadData: Long?,
@JsonProperty("bytes_read_useful_data") @SerialName("bytes_read_useful_data") var bytesReadUsefulData: Long?,
@JsonProperty("chunks_written") @SerialName("chunks_written") var chunksWritten: Long?,
@JsonProperty("chunks_read") @SerialName("chunks_read") var chunksRead: Long?,
@JsonProperty("chunks_read_useful") @SerialName("chunks_read_useful") var chunksReadUseful: Long?,
@JsonProperty("chunks_read_wasted") @SerialName("chunks_read_wasted") var chunksReadWasted: Long?,
@JsonProperty("pieces_dirtied_good") @SerialName("pieces_dirtied_good") var piecesDirtiedGood: Long?,
@JsonProperty("pieces_dirtied_bad") @SerialName("pieces_dirtied_bad") var piecesDirtiedBad: Long?,
@JsonProperty("duration_seconds") @SerialName("duration_seconds") var durationSeconds: Double?,
@JsonProperty("bit_rate") @SerialName("bit_rate") var bitRate: String?,
@JsonProperty("file_stats") @SerialName("file_stats") var fileStats: List<TorrentFileStat>?,
@JsonProperty("trackers") @SerialName("trackers") var trackers: List<String>?,
) {
fun streamUrl(url: String): String {
val fileName =
Expand All @@ -381,12 +342,10 @@ object Torrent {
}
}

@Serializable
data class TorrentFileStat(
@JsonProperty("id")
val id: Int?,
@JsonProperty("path")
val path: String?,
@JsonProperty("length")
val length: Long?,
@JsonProperty("id") @SerialName("id") val id: Int?,
@JsonProperty("path") @SerialName("path") val path: String?,
@JsonProperty("length") @SerialName("length") val length: Long?,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.lagradost.cloudstream3.utils.DataStoreHelper.getViewPos
import com.lagradost.cloudstream3.utils.Event
import com.lagradost.cloudstream3.utils.ImageLoader.loadImage
import com.lagradost.cloudstream3.utils.UiImage
import kotlinx.serialization.Serializable

const val START_ACTION_RESUME_LATEST = 1
const val START_ACTION_LOAD_EP = 2
Expand All @@ -34,6 +35,7 @@ enum class VideoWatchState {
Watched
}

@Serializable
data class ResultEpisode(
val headerName: String,
val name: String?,
Expand Down
Loading