feat: pre-build playlist cache and make matching interval configurable

- Pre-build playlist items cache during track matching for instant serving
- Add PreBuildPlaylistItemsCacheAsync() to SpotifyTrackMatchingService
- Combines local Jellyfin tracks + external matched tracks in correct Spotify order
- Saves to both Redis and file cache for persistence across restarts
- Change matching interval from hardcoded 30 minutes to configurable (default: 24 hours)
- Add SPOTIFY_IMPORT_MATCHING_INTERVAL_HOURS environment variable
- Set to 0 to only run once on startup (manual trigger still works)
- Add endpoint usage files to .gitignore
- Update documentation in README and .env.example

Rationale: Spotify playlists like Discover Weekly update once per week,
so running every 24 hours is more than sufficient. Pre-building the cache
eliminates slow 'on the fly' playlist building.

All 225 tests pass.
This commit is contained in:
2026-02-04 17:03:50 -05:00
parent 24c6219189
commit 3e5c57766b
6 changed files with 225 additions and 3 deletions

4
.gitignore vendored
View File

@@ -88,6 +88,10 @@ apis/*.md
apis/*.json
!apis/jellyfin-openapi-stable.json
# Endpoint usage tracking
apis/endpoint-usage.json
/app/cache/endpoint-usage/
# Original source code for reference
originals/