Files
alembic/pipeline/lib/manual
andrew e5d9c7f043 0.6: Spotify OAuth connect flow, AzuraCast base URL, fingerprint/buy-url fixes
- Add "Connect Spotify" OAuth flow (/connect/spotify) so newly created Spotify
  apps can read playlists: Spotify now requires a user token for playlist
  reads, which client-credentials alone can no longer provide. The stored
  refresh token is rendered as spotify-refresh into each playlist's sldl
  .conf -- sldl's own docs confirm supplying it skips its interactive login
  flow, which is what was causing multi-hour hangs on a stuck sync.
  Grandfathered apps keep working unchanged if no account is connected.
- Fix the connect flow's redirect_uri: request.url_for() reflected the raw
  connection scheme (http) rather than what the reverse proxy actually
  served over, which Spotify's exact-match redirect_uri check rejected.
  Force https rather than trust the unproxied scheme.
- Add an AzuraCast base URL credential field alongside the API key, with a
  keyfile fallback so the scheduled enrich-buy-url.py job can actually reach
  AzuraCast (previously it had no way to receive a base URL at all when run
  from the scheduler, so the reprocess call was silently always skipped).
- Fix build-fingerprint-index.py exiting non-zero on any single fingerprint
  failure instead of only when nothing was written.
- Guard enrich-buy-url.py's AzuraCast reprocess against an empty
  --azuracast-base (raised ValueError since PD2 removed the hardcoded base).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-14 11:16:55 -06:00
..

Manual / archived scripts

These scripts are kept for occasional hands-on use but are not wired into the app, the scheduler, or the web UI. Nothing here runs automatically. They live outside pipeline/lib/ so the active, scheduled scripts there stay easy to see at a glance.

Run one by hand inside the container when you actually need it, e.g.:

docker exec -it alembic bash /app/pipeline/lib/manual/convert-m4a.sh
docker exec -it alembic python /app/pipeline/lib/manual/import-dj-collection.py --help

What's here and why it's manual-only:

  • convert-m4a.sh — one-off bulk M4A to FLAC/MP3 conversion. Not part of the normal download flow.
  • fix-empty-album.sh — repairs tracks with an empty album tag. A cleanup tool for a specific past problem, not a recurring job.
  • backfill-spotify-tags.sh — re-pulls Spotify tags for already-imported tracks. A migration/backfill aid.
  • backfill-buy-url.py — one-time backfill of buy-link tags across the library (the scheduled enrich-buy-url.py handles new tracks going forward).
  • recover-azuracast-playlists.py — rebuilds AzuraCast playlist assignments after a GROUPING-tag loss. Recovery tool, only relevant if you run AzuraCast.
  • import-dj-collection.py — bulk-imports a personal DJ set collection with fingerprint dedup against the existing library. A large one-off importer.

These have not all been hardened with set -euo pipefail; treat them as run-and-watch tools rather than unattended automation.