38f7c9726eada3c5de6f698d3bb67421f12a10cb
ROOT CAUSE: AudioPlayer was the only component holding the <audio> element, and it was only mounted when expanded=true. The MiniPlayer (default state after Play) had no audio element at all. So clicking Play set the store state but no audio was ever loaded or played. Fix: New AudioEngine component holds the single <audio> element and all playback logic. Mounted globally in App.tsx whenever an item is loaded — independent of MiniPlayer/AudioPlayer UI state. Store: New seekRequest (counter-based) lets external UI request seeks without direct audio element access. New playerError surfaces errors across MiniPlayer (red progress bar) and AudioPlayer (banner). AudioPlayer + MiniPlayer reduced to pure UI components that interact through the store. They can mount/unmount freely without affecting playback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Audiolib
Selbst gehosteter Audiobook- und Podcast-Server, vollständig API-kompatibel mit Audiobookshelf (ABS) v2.x. Bestehende Audiobookshelf-Apps (iOS, Android, etc.) funktionieren ohne Änderungen.
Voraussetzungen
- Docker und Docker Compose installiert
- Audiodateien (MP3/WAV) auf dem Server verfügbar
Schnellstart
1. Repository klonen / Dateien vorbereiten
cd /opt/audiolib
cp .env.example .env
2. .env anpassen
Mindestens folgende Werte setzen:
JWT_SECRET=mein_langer_geheimer_zufallsstring
ADMIN_USERNAME=admin
ADMIN_PASSWORD=sicheres_passwort
AUDIOFILES_PATH=/pfad/zu/meinen/audiodateien
3. Starten
docker-compose up -d --build
Der Server ist dann erreichbar unter: http://<server-ip>:3000
4. Erste Schritte
- Öffne
http://<server-ip>:3000im Browser - Melde dich mit den in
.envgesetzten Admin-Daten an - In der Audiobookshelf-App: Server-URL
http://<server-ip>:3000eintragen - Library scannen: Admin → Libraries → Scan
Konfiguration
Alle Einstellungen werden über die .env-Datei konfiguriert:
| Variable | Standard | Beschreibung |
|---|---|---|
SERVER_PORT |
3000 |
Externer Port |
JWT_SECRET |
— | Unbedingt ändern! Langer zufälliger String |
ADMIN_USERNAME |
admin |
Admin-Benutzername |
ADMIN_PASSWORD |
changeme |
Unbedingt ändern! |
AUDIOFILES_PATH |
./audiofiles |
Pfad zu den Audiodateien (NAS-Mount möglich) |
AUTO_MATCH_BOOKS |
true |
Automatisches Metadaten-Matching für Hörbücher |
AUTO_MATCH_PODCASTS |
true |
Automatisches Matching für Podcasts |
PODCAST_UPDATE_INTERVAL_HOURS |
24 |
Wie oft Podcast-Feeds aktualisiert werden |
Projektstruktur
audiolib/
├── backend/ Python/FastAPI Backend
│ └── app/
│ ├── models/ SQLAlchemy-Datenmodelle
│ ├── routers/ API-Endpoints
│ ├── schemas/ Pydantic-Schemas (ABS-kompatibel)
│ └── services/ Scanner, HLS, File Watcher, Matching
├── frontend/ React/Vite Web-Interface (Phase 8)
├── nginx/ Reverse-Proxy-Konfiguration
├── data/ Persistente Daten (DB, Cover, HLS-Cache)
└── docker-compose.yml
API-Kompatibilität
Implementierte ABS-Endpoints:
POST /login— AuthentifizierungGET /api/authorize— Token-Validierung + User/LibrariesGET /api/libraries— Library-ListeGET /api/libraries/:id/items— Hörbücher/Podcasts einer LibraryGET /api/items/:id— Einzelnes Item mit MetadatenGET /api/items/:id/cover— Cover-BildPOST /api/items/:id/play— HLS-Streaming startenPOST /api/playback-session/:id/sync— Fortschritt synchronisierenGET /api/me— User-Profil mit FortschrittPATCH /api/me/progress/:id— Hörfortschritt setzenPOST /api/me/bookmark/:id— Lesezeichen setzenGET /api/users— User-Verwaltung (Admin)GET /api/settings— Server-Einstellungen
Entwicklung
Backend lokal starten (ohne Docker)
cd backend
pip install -r requirements.txt
cp ../.env.example .env
uvicorn app.main:app --reload --port 8000
Frontend lokal starten
cd frontend
npm install
npm run dev
Geplante Features (nächste Phasen)
- Phase 5: Matching-Engine Hörbücher (MusicBrainz, OpenLibrary, Google Books)
- Phase 6: Matching-Engine Podcasts (iTunes, Podcastindex)
- Phase 7: Vollständiger Podcast-Support (RSS-Feeds, Episoden)
- Phase 8: Vollständiges Web-Interface mit Player
- Phase 9: Web-Player mit Kapitelnavigation, Lesezeichen, Sleep-Timer
Lizenz
MIT
Description
Languages
Python
57.1%
TypeScript
39.9%
Shell
2.1%
JavaScript
0.3%
Dockerfile
0.2%
Other
0.4%