optimize firebase reads

This commit is contained in:
2026-03-09 17:41:24 +01:00
parent 4141824b00
commit d81fb3743b
10 changed files with 136 additions and 49 deletions

View File

@@ -1 +1,19 @@
# wgenerator
# wgenerator
## Admin migration
If `songUsage` needs to be rebuilt from all existing shows, log in with a user that has the `admin` role and run this in the browser console:
```js
await window.wgeneratorAdmin.rebuildSongUsage()
```
The migration:
- resets `songUsage` for all users
- scans all shows and all `shows/{id}/songs` entries
- rebuilds the per-user counters based on show ownership
It returns a summary object with processed user, show and show-song counts.
This is intended as a manual one-off migration and is read-heavy by design.