refactor: scope audiobook network

This commit is contained in:
mARTin-B78 2026-09-04 12:41:35 +02:00
parent 7ee5f65e00
commit da3957347c
5 changed files with 19 additions and 12 deletions

View File

@ -8,6 +8,8 @@ Follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) · versioned wi
## [Unreleased] ## [Unreleased]
### Changed ### Changed
- **Audiobook network namespace migration.** Timeout, streaming, and attribution transport helpers now use a private
scope with explicit compatibility exports and the existing Audiobook namespace.
- **Rehearser library namespace migration.** SQLite persistence and the IndexedDB migration adapter now use a private - **Rehearser library namespace migration.** SQLite persistence and the IndexedDB migration adapter now use a private
scope with explicit database compatibility exports and the existing library namespace. scope with explicit database compatibility exports and the existing library namespace.
- **Reader namespace migration.** PDF/TXT document state, playback, search, synthesis, and library APIs now use a - **Reader namespace migration.** PDF/TXT document state, playback, search, synthesis, and library APIs now use a

View File

@ -1 +1 @@
1.24.66 1.24.67

View File

@ -56,6 +56,7 @@ Done incrementally as global-scope ordered files (no ES-module change needed)
- ✅ Audiobook core uses a private scope with explicit reader-side state and handoff compatibility exports. - ✅ Audiobook core uses a private scope with explicit reader-side state and handoff compatibility exports.
- ✅ Reader uses a private scope with explicit document, playback, and search compatibility exports. - ✅ Reader uses a private scope with explicit document, playback, and search compatibility exports.
- ✅ Rehearser library persistence uses a private scope with explicit SQLite/IndexedDB compatibility exports. - ✅ Rehearser library persistence uses a private scope with explicit SQLite/IndexedDB compatibility exports.
- ✅ Audiobook network transport uses a private scope with explicit timeout/stream compatibility exports.
- ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles. - ✅ `static/css/resource-diagnostics.css` — isolated Performance/resource diagnostic panel styles.
- ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles. - ✅ `static/css/background-jobs.css` — isolated background-job history and retry-panel styles.
- ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles. - ✅ `static/css/voice-design.css` — isolated Voice Design form, samples, and preview-match styles.

View File

@ -10,7 +10,7 @@
<meta name="format-detection" content="telephone=no"> <meta name="format-detection" content="telephone=no">
<meta name="color-scheme" content="light dark"> <meta name="color-scheme" content="light dark">
<meta name="theme-color" content="#2563EB"> <meta name="theme-color" content="#2563EB">
<meta name="app-version" content="1.24.66"> <meta name="app-version" content="1.24.67">
<link rel="manifest" href="/manifest.webmanifest"> <link rel="manifest" href="/manifest.webmanifest">
<link rel="icon" href="/static/icon.svg" type="image/svg+xml"> <link rel="icon" href="/static/icon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/static/icon.svg"> <link rel="apple-touch-icon" href="/static/icon.svg">
@ -27,12 +27,12 @@
<!-- ── Core styles (local — no CDN dependency for first paint) ────────── --> <!-- ── Core styles (local — no CDN dependency for first paint) ────────── -->
<link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css"> <link rel="stylesheet" href="/static/vendor/mdi/materialdesignicons.min.css">
<link rel="stylesheet" href="/static/style.css?v=1.24.66"> <link rel="stylesheet" href="/static/style.css?v=1.24.67">
<link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.66"> <link rel="stylesheet" href="/static/css/resource-diagnostics.css?v=1.24.67">
<link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.66"> <link rel="stylesheet" href="/static/css/background-jobs.css?v=1.24.67">
<link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.66"> <link rel="stylesheet" href="/static/css/voice-design.css?v=1.24.67">
<link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.66"> <link rel="stylesheet" href="/static/css/rehearser.css?v=1.24.67">
<link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.66"> <link rel="stylesheet" href="/static/css/audiobook.css?v=1.24.67">
<!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── --> <!-- ── Flag icons — non-blocking (loaded async, icons appear after JS) ── -->
@ -397,7 +397,7 @@ window.toggleNavTree = function(treeId, chevronId) {
</script> </script>
<!-- loader.js: fetches sections → loads JS modules → removes skeleton --> <!-- loader.js: fetches sections → loads JS modules → removes skeleton -->
<script src="/static/loader.js?v=1.24.66"></script> <script src="/static/loader.js?v=1.24.67"></script>
</body> </body>
</html> </html>

View File

@ -2,6 +2,8 @@
// Loaded after audiobook.js; the functions are called from user actions and // Loaded after audiobook.js; the functions are called from user actions and
// therefore do not need to execute while the main audiobook module initializes. // therefore do not need to execute while the main audiobook module initializes.
(function (root) {
async function audiobookFetchWithTimeout(url, options = {}, timeoutMs = AUDIOBOOK_ATTRIBUTION_TIMEOUT_MS) { async function audiobookFetchWithTimeout(url, options = {}, timeoutMs = AUDIOBOOK_ATTRIBUTION_TIMEOUT_MS) {
const parentSignal = options.signal; const parentSignal = options.signal;
const ac = new AbortController(); const ac = new AbortController();
@ -86,10 +88,12 @@ async function audiobookAttributeStream(body, view, outerSignal, idleTimeoutMs =
} }
} }
window.TTVC = window.TTVC || {}; Object.assign(root, { audiobookFetchWithTimeout, audiobookTimeoutSeconds, audiobookAttributeStream });
window.TTVC.audiobook = window.TTVC.audiobook || {}; root.TTVC = root.TTVC || {};
Object.assign(window.TTVC.audiobook, { root.TTVC.audiobook = root.TTVC.audiobook || {};
Object.assign(root.TTVC.audiobook, {
fetchWithTimeout: audiobookFetchWithTimeout, fetchWithTimeout: audiobookFetchWithTimeout,
attributeStream: audiobookAttributeStream, attributeStream: audiobookAttributeStream,
timeoutSeconds: audiobookTimeoutSeconds, timeoutSeconds: audiobookTimeoutSeconds,
}); });
})(window);