aboutsummaryrefslogtreecommitdiff
path: root/app/backends/__init__.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-27 17:03:57 -0400
committerhistoria <historiavg@proton.me>2026-08-27 17:03:57 -0400
commitcef2352a5e81b272d067c2c02eb9588e54edfcfd (patch)
tree83af416a82d9e854f44b6f3207eb8ea648b0896d /app/backends/__init__.py
parent6527240aa69a08f06e36e796818721abeec9f592 (diff)
downloadtts-audiobook-generator-cef2352a5e81b272d067c2c02eb9588e54edfcfd.tar.gz
feat: automatic updates added to configure backend menu
Diffstat (limited to 'app/backends/__init__.py')
-rw-r--r--app/backends/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/backends/__init__.py b/app/backends/__init__.py
index e59c464..8c9f045 100644
--- a/app/backends/__init__.py
+++ b/app/backends/__init__.py
@@ -160,6 +160,10 @@ class BackendInfo:
removes the backend (stops its servers, pip-uninstalls, deletes its
files); the hub runs it inside the task view, calling it with optional
``emit``/``cancel`` keywords (cancel honored between phases only).
+ UPDATE refreshes the installed backend to the latest upstream version
+ (pip -U / git fetch+reset, rebuilding where a binary must match the
+ sources); same calling convention as UNINSTALL. Without UPDATE a
+ backend is skipped by the hub's "Update backends" action.
CONFIGURE_SCREEN, when given, is what the hub's "Configure <label>"
menu entry runs instead of SETUP_SCREEN once the backend exists — a
@@ -173,6 +177,7 @@ class BackendInfo:
detect: Callable[[], BackendStatus]
setup_screen: Callable[[object], int]
uninstall: Callable[..., int] = lambda *args, **kwargs: 0
+ update: Optional[Callable[..., int]] = None
configure_screen: Optional[Callable[[object], int]] = None
@@ -192,6 +197,7 @@ def _build_registry() -> None:
detect=audiocpp.detect,
setup_screen=audiocpp.setup_screen,
uninstall=audiocpp.uninstall,
+ update=audiocpp.update,
))
REGISTRY.append(BackendInfo(
key="qwen",
@@ -199,6 +205,7 @@ def _build_registry() -> None:
detect=qwen.detect,
setup_screen=qwen.setup_screen,
uninstall=qwen.uninstall,
+ update=qwen.update,
configure_screen=qwen.models_screen,
))
REGISTRY.append(BackendInfo(
@@ -207,6 +214,7 @@ def _build_registry() -> None:
detect=faster.detect,
setup_screen=faster.setup_screen,
uninstall=faster.uninstall,
+ update=faster.update,
))
for info in REGISTRY:
_BY_KEY[info.key] = info