Sync your Last.fm play counts and loved tracks to Navidrome with intelligent caching and two sync modes.
-
Install dependencies:
git clone https://github.com/zeroquinc/NaviSync.git cd NaviSync pip install -r requirements.txt -
Configure: Copy
env.exampleto.envand fill in your details:# Navidrome connection NAVIDROME_URL=http://localhost:4533 NAVIDROME_USER=your_username NAVIDROME_PASSWORD=your_password # Last.fm credentials LASTFM_API_KEY=your_api_key LASTFM_USER=your_username
-
Run:
python main.py
API Mode (Recommended)
- Safe - Navidrome stays running
- Uses official Subsonic API
- Good for most users
Database Mode
- Faster for large libraries
- Requires stopping Navidrome
- Direct database access
- Keep your play counts in sync - Never lose track of your listening history by updating Navidrome play counts
- Sync your loved tracks - Last.fm hearts become Navidrome stars
- Fast after first run - Only processes new plays, not your entire history
- Choose your approach - Safe API mode or fast database mode
# Extract first artist from collaborations (e.g. "Artist A feat. Artist B" → "Artist A")
SCROBBLED_FIRSTARTISTONLY=True
FIRST_ARTIST_WHITELIST=["Simon & Garfunkel", "AC/DC"] # Keep these exactThis only works in database mode, as we cant decrease plays via the API.
PLAYCOUNT_CONFLICT_RESOLUTION=ask # Options: ask, navidrome, lastfm, higher, incrementConflict Options:
ask- Prompt for each conflict (default)navidrome- Keep Navidrome when higherlastfm- Always use Last.fmhigher- Use whichever is higherincrement- Add counts together
View cache status: python cache_info.py --info
Reset sync status: python cache_info.py --reset
Setup issues: python check_setup.py
First run slow: Normal - fetches all historical scrobbles. Subsequent runs are fast!
MIT License - see LICENSE file for details.