mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-09 11:06:17 +00:00
Set plugin install request timeouts, fix messaging surrounding downloading icons
This commit is contained in:
parent
e080702a52
commit
5247997ea5
1 changed files with 4 additions and 3 deletions
|
@ -475,6 +475,7 @@ class StatePlugins {
|
||||||
delay(500);
|
delay(500);
|
||||||
|
|
||||||
val client = ManagedHttpClient();
|
val client = ManagedHttpClient();
|
||||||
|
client.setTimeout(10000);
|
||||||
try {
|
try {
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
onProgress.invoke("Validating script", 0.25);
|
onProgress.invoke("Validating script", 0.25);
|
||||||
|
@ -489,14 +490,14 @@ class StatePlugins {
|
||||||
}
|
}
|
||||||
|
|
||||||
val icon = config.absoluteIconUrl?.let { absIconUrl ->
|
val icon = config.absoluteIconUrl?.let { absIconUrl ->
|
||||||
withContext(Dispatchers.Main) {
|
|
||||||
onProgress.invoke("Saving plugin", 0.75);
|
|
||||||
}
|
|
||||||
val iconResp = client.get(absIconUrl);
|
val iconResp = client.get(absIconUrl);
|
||||||
if (iconResp.isOk)
|
if (iconResp.isOk)
|
||||||
return@let iconResp.body?.byteStream()?.use { it.readBytes() };
|
return@let iconResp.body?.byteStream()?.use { it.readBytes() };
|
||||||
return@let null;
|
return@let null;
|
||||||
}
|
}
|
||||||
|
withContext(Dispatchers.Main) {
|
||||||
|
onProgress.invoke("Saving plugin", 0.75);
|
||||||
|
}
|
||||||
val installEx = StatePlugins.instance.createPlugin(config, script, icon, true);
|
val installEx = StatePlugins.instance.createPlugin(config, script, icon, true);
|
||||||
if (installEx != null)
|
if (installEx != null)
|
||||||
throw installEx;
|
throw installEx;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue