mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-08-09 00:17:59 +00:00
Merge 435116bdae into 755f6ff9b8
This commit is contained in:
commit
1fec1f5559
4 changed files with 15 additions and 3 deletions
|
|
@ -79,6 +79,7 @@ data class PluginRuntimeResult(
|
|||
val infoHash: String? = null,
|
||||
val headers: Map<String, String>? = null,
|
||||
val subtitles: List<PluginSubtitleResult>? = null,
|
||||
val clientResolve: com.nuvio.app.features.streams.StreamClientResolve? = null,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ internal fun PluginRuntimeResult.toStreamItem(
|
|||
addonName = addonName,
|
||||
addonId = addonId,
|
||||
streamType = normalizeStreamType(type),
|
||||
clientResolve = clientResolve,
|
||||
behaviorHints = if (requestHeaders.isEmpty()) {
|
||||
StreamBehaviorHints()
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ data class StreamItem(
|
|||
get() = clientResolve?.isDirectDebridCandidate == true
|
||||
|
||||
val isInstalledAddonStream: Boolean
|
||||
get() = addonId.startsWith("addon:")
|
||||
get() = addonId.startsWith("addon:") || addonId.startsWith("plugin:")
|
||||
|
||||
val isTorrentStream: Boolean
|
||||
get() = !isDirectDebridStream && (
|
||||
|
|
|
|||
|
|
@ -229,10 +229,19 @@ internal object PluginRuntime {
|
|||
)
|
||||
}?.takeIf { it.isNotEmpty() }
|
||||
|
||||
val clientResolve = (item["clientResolve"] as? JsonObject)?.let { resolveObj ->
|
||||
com.nuvio.app.features.streams.StreamClientResolve(
|
||||
type = resolveObj["type"]?.jsonPrimitive?.contentOrNull,
|
||||
infoHash = resolveObj["infoHash"]?.jsonPrimitive?.contentOrNull,
|
||||
service = resolveObj["service"]?.jsonPrimitive?.contentOrNull,
|
||||
isCached = resolveObj["isCached"]?.jsonPrimitive?.contentOrNull?.toBoolean() ?: resolveObj["isCached"]?.jsonPrimitive?.booleanOrNull
|
||||
)
|
||||
}
|
||||
|
||||
PluginRuntimeResult(
|
||||
title = item.stringOrNull("title") ?: item.stringOrNull("name") ?: runBlocking { getString(Res.string.generic_unknown) },
|
||||
name = item.stringOrNull("name"),
|
||||
url = url,
|
||||
url = url ?: "", // Default to empty if missing but clientResolve is present
|
||||
quality = item.stringOrNull("quality"),
|
||||
size = item.stringOrNull("size"),
|
||||
language = item.stringOrNull("language"),
|
||||
|
|
@ -243,8 +252,9 @@ internal object PluginRuntime {
|
|||
infoHash = item.stringOrNull("infoHash"),
|
||||
headers = headers,
|
||||
subtitles = subtitles,
|
||||
clientResolve = clientResolve,
|
||||
)
|
||||
}.filter { it.url.isNotBlank() }
|
||||
}.filter { it.url.isNotBlank() || it.clientResolve != null }
|
||||
}.getOrElse { emptyList() }
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue