mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-09-07 18:19:03 +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);
|
||||
|
||||
val client = ManagedHttpClient();
|
||||
client.setTimeout(10000);
|
||||
try {
|
||||
withContext(Dispatchers.Main) {
|
||||
onProgress.invoke("Validating script", 0.25);
|
||||
|
@ -489,14 +490,14 @@ class StatePlugins {
|
|||
}
|
||||
|
||||
val icon = config.absoluteIconUrl?.let { absIconUrl ->
|
||||
withContext(Dispatchers.Main) {
|
||||
onProgress.invoke("Saving plugin", 0.75);
|
||||
}
|
||||
val iconResp = client.get(absIconUrl);
|
||||
if (iconResp.isOk)
|
||||
return@let iconResp.body?.byteStream()?.use { it.readBytes() };
|
||||
return@let null;
|
||||
}
|
||||
withContext(Dispatchers.Main) {
|
||||
onProgress.invoke("Saving plugin", 0.75);
|
||||
}
|
||||
val installEx = StatePlugins.instance.createPlugin(config, script, icon, true);
|
||||
if (installEx != null)
|
||||
throw installEx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue