Skip to content

Multi-provider & GUI Setup Flow#311

Draft
rendyhd wants to merge 34 commits intoNeptuneHub:mainfrom
rendyhd:multi-provider-setup-gui
Draft

Multi-provider & GUI Setup Flow#311
rendyhd wants to merge 34 commits intoNeptuneHub:mainfrom
rendyhd:multi-provider-setup-gui

Conversation

@rendyhd
Copy link
Contributor

@rendyhd rendyhd commented Feb 4, 2026

Hi @NeptuneHub, I've been working on a GUI setup - allowing a non technical to user to onboard without an .env file (the .env is still supported). This still needs a lot of testing
In this branch:

  • Added local file provider. You can directly point to a directory and use that as datasource.
  • Add multi-provider support without having to rerun the analysis. To achieve this there was a change in data architecture needed. The result is that you can connect multiple providers without having to re-analyze, so share playlists and use apps across the providers. The API has an addition to accept a provider identifier, but is fully backwards compatible. Is there's no provider identifier it will first try the default provider and then cycle through others.
  • GUI setup. A GUI setup, where you can onboard without needing a .env (see screenshots)
Screenshot 2026-02-04 132939 Screenshot 2026-02-04 141440 Screenshot 2026-02-04 142917 Screenshot 2026-02-04 141504 Screenshot 2026-02-04 142245 Screenshot 2026-02-04 142250

rendyhd and others added 30 commits January 31, 2026 21:38
Capture the original album artist before _select_best_artist() overwrites
it with the track-level artist. This preserves the album-level artist
(e.g. for compilation albums) in a new `album_artist` column in the
score table, propagated through all media server modules (Jellyfin,
Emby, Navidrome, Lyrion, MPD), the analysis pipeline, similarity search,
song alchemy, path manager, and API responses.

Also fix a pre-existing bug in Emby's standalone track path where
_select_best_artist() return tuple was not unpacked.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Two Docker Compose files for end-to-end testing of the album_artist
column across all providers (Jellyfin, Emby, Navidrome, Lyrion — MPD excluded):
- Providers stack with shared test_music mount
- Per-provider NVIDIA AudioMuse instances with isolated Redis/Postgres
- Bash validation script that queries each Postgres for album_artist data
- Step-by-step test guide covering provider setup, API keys, and checklist

https://claude.ai/code/session_01AU49aWqCYybatiX1yhK6UD
Build the image from the repo Dockerfile with the nvidia/cuda base
instead of pulling from the registry. The flask-jellyfin service
owns the build; all other services reuse audiomuse-ai:test-nvidia
with pull_policy: never.

https://claude.ai/code/session_01AU49aWqCYybatiX1yhK6UD
Replaces named Docker volumes with host bind mounts so provider
config and data persist in testing/providers/{jellyfin,emby,
navidrome,lyrion}/. Added testing/.gitignore to exclude the
providers/ directory and .env.test from version control.

https://claude.ai/code/session_01AU49aWqCYybatiX1yhK6UD
…emain consistent between version (and not having to re-enable settings)
Major features:
- Add local file media provider that scans directories for audio files
  using MP3 tags for metadata (ID3, Vorbis comments, etc.)
- Introduce multi-provider architecture with database schema for
  tracking providers, tracks, and cross-provider linking
- Add GUI setup wizard for configuring providers and settings
- Simplify Docker deployment to 2 unified files (CPU/NVIDIA)

Database changes:
- New tables: provider, track, provider_track, app_settings
- Add file_path and track_id columns to score table for linking
- All changes are migration-safe with ON CONFLICT handling

Key implementation details:
- File path hash (SHA-256) used as stable identifier for local files
- Providers can be tested before saving configuration
- Existing installations auto-migrate with default provider from env
- Analysis pipeline updated to store file_path for track linking

Files added:
- tasks/mediaserver_localfiles.py - Local file provider implementation
- app_setup.py - Setup wizard API endpoints
- templates/setup.html - Setup wizard UI
- deployment/docker-compose-unified.yaml - Simplified CPU deployment
- deployment/docker-compose-unified-nvidia.yaml - Simplified GPU deployment
- docs/MULTI_PROVIDER_ARCHITECTURE.md - Architecture documentation

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
Implements provider fallback logic for API calls:
- When provider_id specified: look up in that provider, fall back to score
- When provider_id NOT specified (backward compatible):
  1. Try primary provider first
  2. Try other enabled providers by priority
  3. Fall back to direct score table (legacy mode)

New helper functions:
- get_track_by_item_id(item_id, provider_id=None)
- get_tracks_by_item_ids(item_ids, provider_id=None)
- get_primary_provider_id()
- get_enabled_provider_ids()
- resolve_item_id_to_provider(item_id)
- get_item_id_for_provider(file_path_or_track_id, provider_id)
- is_multi_provider_mode()
- set_primary_provider(provider_id)

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
- Add docker-compose-worker-cpu.yaml for CPU-only remote workers
- Update docker-compose-worker-nvidia.yaml with all provider configs
- Update docker-compose-server.yaml for server-only deployment
- Add worker connection settings to .env.example (WORKER_REDIS_URL, WORKER_POSTGRES_HOST)
- Add deployment mode selection to setup wizard (unified/split)
- Add worker configuration section in setup wizard with connection info
- Add server-info API endpoint for automatic IP detection

This allows running ML analysis workers on separate machines from the
main Flask server, useful for utilizing dedicated GPU servers or
distributing workload across multiple workers.

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
- Add Docker Compose file recommendation to setup summary
- Show correct unified file based on hardware selection
- Clarify CPU vs NVIDIA image usage in .env.example comments

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
- Create settings.html with collapsible sections for:
  - Media Providers (list, add, edit, delete, set primary)
  - Deployment (unified/split mode, hardware type, worker info)
  - Analysis (CLAP, GPU clustering)
  - AI Integration (playlist naming provider)
- Add /settings route in app_setup.py
- Update sidebar navigation with Settings link
- Keep Setup Wizard as separate option for initial configuration

The Settings page provides quick access to modify individual settings
without going through the full setup wizard flow.

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
- Add provider selector dropdown to all playlist forms
- Create shared provider-selector.js component for consistent UI
- Add /api/providers/enabled endpoint for fetching available providers
- Update create_playlist_from_ids to support provider_ids parameter
- Add create_playlist_multi_provider for creating on multiple providers
- Add get_all_playlists_multi_provider with deduplication
- Update all templates: similarity, path, clap_search, mulan_search,
  sonic_fingerprint, alchemy, artist_similarity, map, chat
- Support 'all' option to create playlist on all enabled providers

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
Resolves conflicts in:
- app_helper.py: Combined album_artist/year/rating fields with file_path support
- tasks/analysis.py: Merged new metadata fields with multi-provider file_path handling

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
- Add track table population functions:
  - get_or_create_track() - Creates/retrieves track record by file_path
  - link_provider_track() - Links provider item_id to track
  - update_score_track_id() - Links score analysis to track
  - get_track_by_file_path() - Lookup track by file path
  - find_existing_analysis_by_file_path() - Check for existing analysis
  - get_all_provider_item_ids_for_track() - Get all provider links for a track

- Update save_track_analysis_and_embedding() to:
  - Accept optional provider_id parameter
  - Automatically create track record when file_path is provided
  - Link score to track via track_id
  - Create provider_track link if provider_id specified

- Update analyze_album_task() to pass provider_id for track linking

- Add enabled_only parameter to get_providers() function

This completes the multi-provider track linking architecture allowing
tracks to be identified across providers by their file path.

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
The path normalization now handles more provider formats:
- Jellyfin: /media/music/... paths
- Navidrome: /music/... or relative paths
- Lyrion: file:///music/... URLs (with URL decoding)
- Various mount points: /mnt/*, /data/*, /share/*, /volume1/*

Prefixes are stripped case-insensitively to get the relative path
from the music library root, enabling track matching across providers
that mount the same music folder at different paths.

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
Each provider can now have a 'music_path_prefix' in its config
that will be stripped during path normalization. This handles cases
where providers have different folder structures:

- Jellyfin: /media/music/MyLibrary/Artist/Album/song.mp3
- Navidrome: /music/Artist/Album/song.mp3

By setting music_path_prefix="MyLibrary" on Jellyfin, both normalize
to "Artist/Album/song.mp3" enabling cross-provider track matching.

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
claude and others added 4 commits February 4, 2026 09:12
Users can now configure a 'Music Path Prefix' for each provider
to handle different folder structures:

- Jellyfin: paths like "MyLibrary/Artist/Album/song.mp3"
- Navidrome: paths like "Artist/Album/song.mp3"

By setting music_path_prefix="MyLibrary" on Jellyfin, both normalize
to "Artist/Album/song.mp3" enabling cross-provider track matching.

The field appears in the setup wizard for all provider types.

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
- Add get_sample_tracks_from_provider() to fetch tracks with ad-hoc config
- Add detect_music_path_prefix() to compare paths between providers
- Update provider test endpoint to auto-detect prefix after connection test
- Add normalized_path column to track table for path comparison
- Update setup UI to display detection results and auto-fill prefix field

When adding a second provider, the system now:
1. Fetches sample tracks from the new provider
2. Compares paths with existing normalized tracks
3. Detects the prefix difference (e.g., "Library/" folder)
4. Auto-fills the music_path_prefix field in the setup form

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
- Update find_existing_analysis_by_file_path() to accept provider_id
- Add copy_analysis_to_new_item() to copy analysis between item_ids
- Update analyze_album_task() to check for existing cross-provider analysis
  before downloading and processing audio files

In multi-provider setups, when provider B tries to analyze a track that
provider A already analyzed, the system now:
1. Checks for existing analysis via normalized file path hash
2. Copies score, embedding, CLAP, and MuLan data to the new item_id
3. Creates proper track linking for the new provider

This prevents redundant GPU-intensive analysis of the same audio file
when multiple providers point to the same music library.

https://claude.ai/code/session_011AebTWAucDafK4m6uoSSNg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants