Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
76d6aa4d3e |
@@ -73,15 +73,8 @@ class APIServer:
|
|||||||
original_state_cb = self.controller.on_state_changed
|
original_state_cb = self.controller.on_state_changed
|
||||||
|
|
||||||
def on_state_changed(state: str, message: str):
|
def on_state_changed(state: str, message: str):
|
||||||
# Isolate the upstream callback so a failure there (e.g. a
|
|
||||||
# broken stdout pipe in main_headless) cannot propagate into
|
|
||||||
# _set_state and tear down engine init / reload_engine /
|
|
||||||
# apply_settings request handling.
|
|
||||||
if original_state_cb:
|
if original_state_cb:
|
||||||
try:
|
|
||||||
original_state_cb(state, message)
|
original_state_cb(state, message)
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
self._broadcast_control({"type": "state_changed", "state": state, "message": message})
|
self._broadcast_control({"type": "state_changed", "state": state, "message": message})
|
||||||
|
|
||||||
self.controller.on_state_changed = on_state_changed
|
self.controller.on_state_changed = on_state_changed
|
||||||
@@ -280,7 +273,6 @@ class APIServer:
|
|||||||
data = resp.json()
|
data = resp.json()
|
||||||
ctrl.config.set('remote.auth_token', data.get('token', ''))
|
ctrl.config.set('remote.auth_token', data.get('token', ''))
|
||||||
ctrl.config.set('remote.server_url', req.server_url)
|
ctrl.config.set('remote.server_url', req.server_url)
|
||||||
ctrl.config.set('remote.email', req.email)
|
|
||||||
return {"status": "ok", "token": data.get('token', '')}
|
return {"status": "ok", "token": data.get('token', '')}
|
||||||
else:
|
else:
|
||||||
raise HTTPException(status_code=resp.status_code, detail=resp.text)
|
raise HTTPException(status_code=resp.status_code, detail=resp.text)
|
||||||
|
|||||||
@@ -75,16 +75,10 @@ def main():
|
|||||||
# Create controller and initialize
|
# Create controller and initialize
|
||||||
controller = AppController(config=config)
|
controller = AppController(config=config)
|
||||||
|
|
||||||
# Wire a state callback that prints state events for the parent
|
# Wire a state callback that prints the ready event
|
||||||
# process to read. Stdout writes can fail with EINVAL on Windows
|
|
||||||
# when the parent stops reading the sidecar pipe; swallow those
|
|
||||||
# so the engine state machine isn't taken down by a logging path.
|
|
||||||
def on_state_changed(state, message):
|
def on_state_changed(state, message):
|
||||||
event = {"event": "state", "state": state, "message": message}
|
event = {"event": "state", "state": state, "message": message}
|
||||||
try:
|
|
||||||
print(json.dumps(event), flush=True)
|
print(json.dumps(event), flush=True)
|
||||||
except (OSError, ValueError):
|
|
||||||
pass
|
|
||||||
|
|
||||||
controller.on_state_changed = on_state_changed
|
controller.on_state_changed = on_state_changed
|
||||||
|
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ remote:
|
|||||||
mode: byok # local | managed | byok
|
mode: byok # local | managed | byok
|
||||||
server_url: "https://transcribe.shadowdao.com" # Proxy server URL for managed mode
|
server_url: "https://transcribe.shadowdao.com" # Proxy server URL for managed mode
|
||||||
auth_token: "" # JWT stored after login (managed mode)
|
auth_token: "" # JWT stored after login (managed mode)
|
||||||
email: "" # Email of the logged-in managed-mode account (for UI display)
|
|
||||||
byok_api_key: "" # Deepgram API key for BYOK mode
|
byok_api_key: "" # Deepgram API key for BYOK mode
|
||||||
deepgram_model: nova-2 # Deepgram model to use
|
deepgram_model: nova-2 # Deepgram model to use
|
||||||
language: en-US # Language code
|
language: en-US # Language code
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "local-transcription",
|
"name": "local-transcription",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "2.0.20",
|
"version": "2.0.19",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "local-transcription"
|
name = "local-transcription"
|
||||||
version = "1.0.14"
|
version = "1.0.12"
|
||||||
description = "A standalone desktop application for real-time speech-to-text transcription using Whisper models"
|
description = "A standalone desktop application for real-time speech-to-text transcription using Whisper models"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.9"
|
requires-python = ">=3.9"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "local-transcription"
|
name = "local-transcription"
|
||||||
version = "2.0.20"
|
version = "2.0.19"
|
||||||
description = "Real-time speech-to-text transcription for streamers"
|
description = "Real-time speech-to-text transcription for streamers"
|
||||||
authors = ["Local Transcription Contributors"]
|
authors = ["Local Transcription Contributors"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"productName": "Local Transcription",
|
"productName": "Local Transcription",
|
||||||
"version": "2.0.20",
|
"version": "2.0.19",
|
||||||
"identifier": "net.anhonesthost.local-transcription",
|
"identifier": "net.anhonesthost.local-transcription",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../dist",
|
"frontendDist": "../dist",
|
||||||
|
|||||||
@@ -44,7 +44,6 @@
|
|||||||
let byokApiKey = $state("");
|
let byokApiKey = $state("");
|
||||||
let managedEmail = $state("");
|
let managedEmail = $state("");
|
||||||
let managedPassword = $state("");
|
let managedPassword = $state("");
|
||||||
let managedLoggedIn = $state(false);
|
|
||||||
let autoCheckUpdates = $state(true);
|
let autoCheckUpdates = $state(true);
|
||||||
|
|
||||||
let isCloudMode = $derived(remoteMode === "managed" || remoteMode === "byok");
|
let isCloudMode = $derived(remoteMode === "managed" || remoteMode === "byok");
|
||||||
@@ -132,8 +131,6 @@
|
|||||||
remoteMode = cfg.remote.mode;
|
remoteMode = cfg.remote.mode;
|
||||||
remoteServerUrl = cfg.remote.server_url;
|
remoteServerUrl = cfg.remote.server_url;
|
||||||
byokApiKey = cfg.remote.byok_api_key ?? "";
|
byokApiKey = cfg.remote.byok_api_key ?? "";
|
||||||
managedEmail = cfg.remote.email ?? "";
|
|
||||||
managedLoggedIn = !!(cfg.remote.auth_token && cfg.remote.email);
|
|
||||||
autoCheckUpdates = cfg.updates.auto_check;
|
autoCheckUpdates = cfg.updates.auto_check;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -260,37 +257,15 @@
|
|||||||
|
|
||||||
const MANAGED_SERVER_URL = "https://transcribe.shadowdao.com";
|
const MANAGED_SERVER_URL = "https://transcribe.shadowdao.com";
|
||||||
|
|
||||||
let loginMessage = $state("");
|
|
||||||
|
|
||||||
async function handleManagedLogin() {
|
async function handleManagedLogin() {
|
||||||
loginMessage = "";
|
|
||||||
try {
|
try {
|
||||||
await backendStore.apiPost("/api/login", {
|
await backendStore.apiPost("/api/login", {
|
||||||
email: managedEmail,
|
email: managedEmail,
|
||||||
password: managedPassword,
|
password: managedPassword,
|
||||||
server_url: remoteServerUrl || MANAGED_SERVER_URL,
|
server_url: remoteServerUrl || MANAGED_SERVER_URL,
|
||||||
});
|
});
|
||||||
loginMessage = "Logged in successfully!";
|
|
||||||
managedPassword = "";
|
|
||||||
managedLoggedIn = true;
|
|
||||||
await configStore.fetchConfig();
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error("Login failed:", err);
|
console.error("Login failed:", err);
|
||||||
loginMessage = "Login failed. Check your email and password.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleManagedLogout() {
|
|
||||||
try {
|
|
||||||
await configStore.updateConfig({
|
|
||||||
remote: { auth_token: "", email: "" },
|
|
||||||
});
|
|
||||||
managedLoggedIn = false;
|
|
||||||
managedPassword = "";
|
|
||||||
loginMessage = "";
|
|
||||||
} catch (err) {
|
|
||||||
console.error("Logout failed:", err);
|
|
||||||
loginMessage = `Error: ${err}`;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -509,15 +484,6 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{#if remoteMode === "managed"}
|
{#if remoteMode === "managed"}
|
||||||
<div class="managed-auth">
|
<div class="managed-auth">
|
||||||
{#if managedLoggedIn}
|
|
||||||
<p style="font-size: 13px; margin: 0 0 8px;">
|
|
||||||
<span style="color: var(--accent-green, #4CAF50);">✓ Logged in</span>
|
|
||||||
as <strong>{managedEmail}</strong>
|
|
||||||
</p>
|
|
||||||
<div class="auth-buttons">
|
|
||||||
<button onclick={handleManagedLogout}>Log out</button>
|
|
||||||
</div>
|
|
||||||
{:else}
|
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="managed-email">Email</label>
|
<label for="managed-email">Email</label>
|
||||||
<input
|
<input
|
||||||
@@ -541,12 +507,6 @@
|
|||||||
<p style="font-size: 11px; color: var(--text-muted); margin-top: 8px;">
|
<p style="font-size: 11px; color: var(--text-muted); margin-top: 8px;">
|
||||||
Don't have an account? <a href="https://transcribe.shadowdao.com/register.html" target="_blank" rel="noopener" style="color: var(--accent-blue);">Sign up here</a>
|
Don't have an account? <a href="https://transcribe.shadowdao.com/register.html" target="_blank" rel="noopener" style="color: var(--accent-blue);">Sign up here</a>
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
|
||||||
{#if loginMessage}
|
|
||||||
<p style="font-size: 12px; margin-top: 6px; color: {loginMessage.startsWith('Logged') ? 'var(--accent-green, #4CAF50)' : 'var(--accent-red, #f44336)'};">
|
|
||||||
{loginMessage}
|
|
||||||
</p>
|
|
||||||
{/if}
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ export interface AppConfig {
|
|||||||
mode: string;
|
mode: string;
|
||||||
server_url: string;
|
server_url: string;
|
||||||
auth_token: string;
|
auth_token: string;
|
||||||
email: string;
|
|
||||||
byok_api_key: string;
|
byok_api_key: string;
|
||||||
deepgram_model: string;
|
deepgram_model: string;
|
||||||
language: string;
|
language: string;
|
||||||
@@ -132,7 +131,6 @@ function getDefaultConfig(): AppConfig {
|
|||||||
mode: "byok",
|
mode: "byok",
|
||||||
server_url: "",
|
server_url: "",
|
||||||
auth_token: "",
|
auth_token: "",
|
||||||
email: "",
|
|
||||||
byok_api_key: "",
|
byok_api_key: "",
|
||||||
deepgram_model: "nova-2",
|
deepgram_model: "nova-2",
|
||||||
language: "en-US",
|
language: "en-US",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"""Version information for Local Transcription."""
|
"""Version information for Local Transcription."""
|
||||||
|
|
||||||
__version__ = "2.0.20"
|
__version__ = "2.0.19"
|
||||||
__version_info__ = (2, 0, 20)
|
__version_info__ = (2, 0, 19)
|
||||||
|
|
||||||
# Version history:
|
# Version history:
|
||||||
# 1.4.0 - Auto-update feature:
|
# 1.4.0 - Auto-update feature:
|
||||||
|
|||||||
Reference in New Issue
Block a user