refactor index schema and metadata format and directory tree

This commit is contained in:
2026-05-30 01:05:27 +00:00
parent 550f67531a
commit 900fcea638
23 changed files with 879 additions and 458 deletions
+8
View File
@@ -40,6 +40,14 @@ uv run --extra gui python -m mediahive.winmain /path/to/media/folder
This launches the same pywebview-based desktop flow used by the Windows build.
## Migrate Existing Index Snapshots
```bash
uv run python scripts/indexmigr.py /path/to/media/root --write
```
This applies versioned snapshot migrations to `.mediahive/index.json` outside the main application. Use it before starting a newer build against an older index.
## Notes
- The selected media folder is scanned continuously by the backend.
+5 -3
View File
@@ -35,9 +35,11 @@ Each active root gets an isolated `RootContext` managed by the `Supervisor`:
### Item IDs
Every `Movie.id` and `Series.id` is namespaced with its `root_id`:
- Format: `{root_id}:{content_hash}`
- Old snapshots are auto-migrated on load: IDs lacking the prefix get it prepended.
`root_id` is stored separately on each item.
- `Movie.id` uses a slug built from the movie title and year, for example `spider-man-no-way-home-2021`.
- `Series.id` uses a slug built from the series title, for example `lost`.
- Legacy snapshot migrations are handled by `scripts/indexmigr.py`, not during app startup.
## API