Skip to content

NaviSync is a Python script that syncs your Last.fm track play counts and loved tracks with your Navidrome server.

License

Notifications You must be signed in to change notification settings

zeroquinc/NaviSync

Repository files navigation

NaviSync

Sync your Last.fm play counts and loved tracks to Navidrome with intelligent caching and two sync modes.

Quick Start

  1. Install dependencies:

    git clone https://github.com/zeroquinc/NaviSync.git
    cd NaviSync
    pip install -r requirements.txt
  2. Configure: Copy env.example to .env and 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
  3. Run: python main.py

Sync Modes

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

Features

  • 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

Configuration Options

Artist Handling

# 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 exact

Database Mode Conflict Resolution

This only works in database mode, as we cant decrease plays via the API.

PLAYCOUNT_CONFLICT_RESOLUTION=ask  # Options: ask, navidrome, lastfm, higher, increment

Conflict Options:

  • ask - Prompt for each conflict (default)
  • navidrome - Keep Navidrome when higher
  • lastfm - Always use Last.fm
  • higher - Use whichever is higher
  • increment - Add counts together

Cache Management

View cache status: python cache_info.py --info

Reset sync status: python cache_info.py --reset

Troubleshooting

Setup issues: python check_setup.py

First run slow: Normal - fetches all historical scrobbles. Subsequent runs are fast!

License

MIT License - see LICENSE file for details.

About

NaviSync is a Python script that syncs your Last.fm track play counts and loved tracks with your Navidrome server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages