feat: complete notification cycle for automatic UI refresh

This commit is contained in:
Thomas
2026-05-09 21:38:22 +02:00
parent 45c0ff9992
commit a4fc0f23a6
4 changed files with 290 additions and 107 deletions
@@ -113,12 +113,27 @@ public class DefaultDownloadManager implements IDownloadManager {
} finally {
if (finishedCalled.compareAndSet(false, true)) {
notifyComfyUI(); // NEU: Ping abfeuern
onFinished.run();
}
}
}).start();
}
// NEU: Benachrichtigt ComfyUI
private void notifyComfyUI() {
try {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://127.0.0.1:8188/kippster/model-downloaded"))
.POST(HttpRequest.BodyPublishers.noBody())
.build();
// Fire and forget
httpClient.sendAsync(request, HttpResponse.BodyHandlers.discarding());
} catch (Exception e) {
// Wenn ComfyUI nicht läuft, ignorieren wir das leise
}
}
private boolean isSelected(int index) {
return currentSelection == null || (index < currentSelection.length && currentSelection[index]);
}