This commit is contained in:
2026-01-12 19:03:50 +00:00
parent 0da76927ce
commit d4b8dcd455
48 changed files with 1352 additions and 723 deletions
+34 -37
View File
@@ -1,65 +1,62 @@
# Playback Testing
# Playback-Tests
## Purpose
Test NFC playback, recursive media order, resume, and playback controls.
## Zweck
Tests fuer NFC-Playback, Rekursion, Resume und Buttons.
## Prerequisites
- Box running: `python3 box/main.py run`
- Media in `box/data/media/`
## Voraussetzungen
- Box laeuft: `python3 box/main.py run`
- Medien unter `box/data/media/`
## Step-by-step
### NFC simulation
Start playback:
## Schritt-fuer-Schritt
### NFC-Simulation
Start:
```
curl -X POST http://127.0.0.1:8000/command \
-H "Content-Type: application/json" \
-d '{"command":"nfc_on","payload":{"uid":"UID_1"}}'
```
Stop playback:
Stop:
```
curl -X POST http://127.0.0.1:8000/command \
-H "Content-Type: application/json" \
-d '{"command":"nfc_off","payload":{"uid":"UID_1"}}'
```
### Resume tests
### Resume
1) `nfc_on UID_1`
2) Wait or use `tick` in CLI
2) Warten (Auto-Tick)
3) `nfc_off UID_1`
4) `nfc_on UID_1` again
Expected: position resumes from saved state.
4) `nfc_on UID_1`
Erwartung: Resume nutzt gespeicherte Position.
### Tag switching
### Tag-Wechsel
1) `nfc_on UID_1`
2) `nfc_on UID_2`
3) `nfc_on UID_1`
Expected: UID_1 resumes from previous position.
Erwartung: UID_1 resumed.
### Recursive order
- Order is depth-first, folders first, lexicographic.
- Change folder names or nesting to see ordering changes.
### Rekursive Reihenfolge
- Ordner werden DFS traversiert (Unterordner zuerst, dann Dateien).
- Sortierung lexikografisch.
### End of media behavior
- When the last file ends:
- Playback stops
- Position saved at end
- State becomes IDLE
### Ende-des-Mediums
- Letzte Datei endet -> Playback stoppt, Position wird am Ende gespeichert.
### Buttons
- `next`: file_index + 1
- `prev`: if position > 3s then position=0, else file_index - 1
- `play_pause`: toggle PLAYING/PAUSED
- `volume_up` / `volume_down`: change volume within 0..max
- `prev`: wenn position > 3s -> position=0, sonst file_index - 1
- `play_pause`: toggelt PLAYING/PAUSED
- `volume_up` / `volume_down`: innerhalb 0..max
## Checklist
- ✅ Resume works for same UID
- ✅ Tag switching preserves per-UID resume
- ✅ Recursive order matches folder structure
- ✅ End-of-media stops playback and saves
## Checkliste
- ✅ Resume pro UID
- ✅ Tag-Wechsel speichert und resumed
- ✅ Rekursion entspricht Ordnerstruktur
- ✅ Ende-des-Mediums stoppt und speichert
## Troubleshooting
- No playback starts:
- Check tags in `box/data/box.json`.
- Ensure files exist under `box/data/media`.
- Duration is 0:
- Filenames not matched; mock uses hash-based durations for unknown names.
- Kein Playback:
- Tags in `box/data/box.json` pruefen.
- Dateien in `box/data/media` pruefen.
- Duration = 0:
- Unbekannte Dateinamen -> Hash-Dauer, nicht 0.