mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2026-05-16 04:52:39 +02:00
Merge branch 'master' of gitlab.futo.org:videostreaming/grayjay
This commit is contained in:
+2
-2
@@ -179,8 +179,8 @@ dependencies {
|
||||
implementation 'com.google.code.gson:gson:2.10.1' //Used for complex/anonymous cases like during development conversions (eg. V8RemoteObject)
|
||||
|
||||
//JS
|
||||
//implementation("com.caoccao.javet:javet-android:3.0.2")
|
||||
implementation 'com.caoccao.javet:javet-v8-android:4.1.4'
|
||||
implementation("com.caoccao.javet:javet-android:3.0.2")
|
||||
//implementation 'com.caoccao.javet:javet-v8-android:4.1.4' //Change after extensive testing the freezing edge cases are solved.
|
||||
|
||||
//Exoplayer
|
||||
implementation 'androidx.media3:media3-exoplayer:1.2.1'
|
||||
|
||||
@@ -98,16 +98,14 @@ inline fun <reified T> V8ValueArray.expectV8Variants(config: IV8PluginConfig, co
|
||||
inline fun V8Plugin.ensureIsBusy() {
|
||||
this.let {
|
||||
if (!it.isThreadAlreadyBusy()) {
|
||||
throw IllegalStateException("Tried to access V8Plugin without busy");
|
||||
/*
|
||||
//throw IllegalStateException("Tried to access V8Plugin without busy");
|
||||
val stacktrace = Thread.currentThread().stackTrace;
|
||||
Logger.w("Extensions_V8",
|
||||
"V8 USE OUTSIDE BUSY: " + stacktrace.drop(3)?.firstOrNull().toString() +
|
||||
", " + stacktrace.drop(4)?.firstOrNull().toString() +
|
||||
", " + stacktrace.drop(5)?.firstOrNull()?.toString() +
|
||||
", " + stacktrace.drop(6)?.firstOrNull()?.toString()
|
||||
)
|
||||
*/
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -118,7 +116,7 @@ inline fun V8Value.ensureIsBusy() {
|
||||
}
|
||||
|
||||
inline fun <reified T> V8Value.expectV8Variant(config: IV8PluginConfig, contextName: String): T {
|
||||
if(true)
|
||||
if(false)
|
||||
ensureIsBusy();
|
||||
return when(T::class) {
|
||||
String::class -> this.expectOrThrow<V8ValueString>(config, contextName).value as T;
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context
|
||||
import com.caoccao.javet.exceptions.JavetCompilationException
|
||||
import com.caoccao.javet.exceptions.JavetException
|
||||
import com.caoccao.javet.exceptions.JavetExecutionException
|
||||
import com.caoccao.javet.interfaces.IJavetEntityError
|
||||
import com.caoccao.javet.interop.V8Host
|
||||
import com.caoccao.javet.interop.V8Runtime
|
||||
import com.caoccao.javet.values.V8Value
|
||||
@@ -321,6 +320,37 @@ class V8Plugin {
|
||||
throw ScriptCompilationException(config, "Compilation: [${context}]: ${scriptEx.message}\n(${scriptEx.scriptingError.lineNumber})[${scriptEx.scriptingError.startColumn}-${scriptEx.scriptingError.endColumn}]: ${scriptEx.scriptingError.sourceLine}", null, codeStripped);
|
||||
}
|
||||
catch(executeEx: JavetExecutionException) {
|
||||
val obj = executeEx.scriptingError?.context
|
||||
if(obj != null && obj.containsKey("plugin_type") == true) {
|
||||
val pluginType = obj["plugin_type"].toString();
|
||||
|
||||
//Captcha
|
||||
if (pluginType == "CaptchaRequiredException") {
|
||||
throw ScriptCaptchaRequiredException(config,
|
||||
obj["url"]?.toString(),
|
||||
obj["body"]?.toString(),
|
||||
executeEx, executeEx.scriptingError?.stack, codeStripped);
|
||||
}
|
||||
|
||||
//Reload Required
|
||||
if (pluginType == "ReloadRequiredException") {
|
||||
throw ScriptReloadRequiredException(config,
|
||||
obj["msg"]?.toString(),
|
||||
obj["reloadData"]?.toString(),
|
||||
executeEx, executeEx.scriptingError?.stack, codeStripped);
|
||||
}
|
||||
|
||||
//Others
|
||||
throwExceptionFromV8(
|
||||
config,
|
||||
pluginType,
|
||||
(extractJSExceptionMessage(executeEx) ?: ""),
|
||||
executeEx,
|
||||
executeEx.scriptingError?.stack,
|
||||
codeStripped
|
||||
);
|
||||
}
|
||||
/* //Required for newer V8 versions
|
||||
if(executeEx.scriptingError?.context is IJavetEntityError) {
|
||||
val obj = executeEx.scriptingError?.context as IJavetEntityError
|
||||
if(obj.context.containsKey("plugin_type") == true) {
|
||||
@@ -354,6 +384,7 @@ class V8Plugin {
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
throw ScriptExecutionException(config, extractJSExceptionMessage(executeEx) ?: "", null, executeEx.scriptingError?.stack, codeStripped);
|
||||
}
|
||||
catch(ex: Exception) {
|
||||
|
||||
@@ -958,7 +958,7 @@ class StatePlatform {
|
||||
//Comments
|
||||
fun getComments(content: IPlatformContentDetails): IPager<IPlatformComment> {
|
||||
val client = getContentClient(content.url);
|
||||
val pager = null;//content.getComments(client);
|
||||
val pager = content.getComments(client);
|
||||
|
||||
return pager ?: getComments(content.url);
|
||||
}
|
||||
|
||||
+7
-1
@@ -95,7 +95,13 @@ class VideoListEditorViewHolder : ViewHolder {
|
||||
.into(_imageThumbnail);
|
||||
_textName.text = v.name;
|
||||
_textAuthor.text = v.author.name;
|
||||
_textVideoDuration.text = v.duration.toHumanTime(false);
|
||||
|
||||
if(v.duration > 0) {
|
||||
_textVideoDuration.text = v.duration.toHumanTime(false);
|
||||
_textVideoDuration.visibility = View.VISIBLE;
|
||||
}
|
||||
else
|
||||
_textVideoDuration.visibility = View.GONE;
|
||||
|
||||
val historyPosition = StateHistory.instance.getHistoryPosition(v.url)
|
||||
_timeBar.progress = historyPosition.toFloat() / v.duration.toFloat();
|
||||
|
||||
+8
-2
@@ -204,8 +204,14 @@ open class PreviewVideoView : LinearLayout {
|
||||
.into(_imageVideo);
|
||||
};
|
||||
|
||||
if(!isPlanned)
|
||||
_textVideoDuration.text = video.duration.toHumanTime(false);
|
||||
if(!isPlanned) {
|
||||
if(video.duration > 0) {
|
||||
_textVideoDuration.text = video.duration.toHumanTime(false);
|
||||
_textVideoDuration.visibility = View.VISIBLE;
|
||||
}
|
||||
else
|
||||
_textVideoDuration.visibility = View.GONE;
|
||||
}
|
||||
else
|
||||
_textVideoDuration.text = context.getString(R.string.planned);
|
||||
|
||||
|
||||
Submodule app/src/stable/assets/sources/kick updated: ffdf4cda38...b7173f1538
Submodule app/src/stable/assets/sources/patreon updated: d98c7f8aee...b811f8bdfb
Submodule app/src/stable/assets/sources/soundcloud updated: 5456431268...048acef152
Submodule app/src/stable/assets/sources/youtube updated: 0167dfb471...568d560520
Submodule app/src/unstable/assets/sources/kick updated: ffdf4cda38...b7173f1538
Submodule app/src/unstable/assets/sources/youtube updated: 0167dfb471...568d560520
Reference in New Issue
Block a user