Skip to content

refactor: skip music system library refresh when no new tracks are downloaded - #225

Open
wzli wants to merge 1 commit into
LumePart:devfrom
wzli:feature/skip-library-refresh-when-no-downloads
Open

refactor: skip music system library refresh when no new tracks are downloaded#225
wzli wants to merge 1 commit into
LumePart:devfrom
wzli:feature/skip-library-refresh-when-no-downloads

Conversation

@wzli

@wzli wzli commented Aug 13, 2026

Copy link
Copy Markdown

Summary

Currently, Explo calls RefreshLibrary() unconditionally inside CreatePlaylist(). For clients that don't report active refresh state (such as Subsonic/Navidrome), this triggers a full library scan and falls back on SLEEP (e.g. 1 minute wait) even when 0 new tracks were downloaded.

Solution

  1. Uncouple RefreshLibrary() from CreatePlaylist(): Remove c.API.RefreshLibrary() from inside CreatePlaylist() in src/client/client.go.
  2. Track Download Count: Return the count of newly downloaded tracks from downloader.StartDownload(&tracks).
  3. Conditional Scan in main.go: Call client.RefreshLibrary() in main.go only when newDownloads > 0.

This keeps CreatePlaylist() focused on updating playlist tracklists and avoids redundant library scans or sleep delays when all songs already exist locally.

@wzli
wzli marked this pull request as draft August 13, 2026 01:44
@wzli
wzli force-pushed the feature/skip-library-refresh-when-no-downloads branch 2 times, most recently from 8894088 to 8c2c426 Compare August 13, 2026 01:46
@wzli wzli closed this Aug 13, 2026
@wzli
wzli force-pushed the feature/skip-library-refresh-when-no-downloads branch from 8c2c426 to 4fc7587 Compare August 13, 2026 01:47
@wzli wzli reopened this Aug 13, 2026
@wzli
wzli marked this pull request as ready for review August 13, 2026 01:47
@wzli
wzli force-pushed the feature/skip-library-refresh-when-no-downloads branch 3 times, most recently from 2df0f06 to eb7d717 Compare August 13, 2026 01:54
@wzli
wzli marked this pull request as draft August 13, 2026 01:56
@wzli
wzli marked this pull request as ready for review August 13, 2026 02:46
@wzli
wzli force-pushed the feature/skip-library-refresh-when-no-downloads branch from eb7d717 to 921facb Compare August 13, 2026 02:46
@wzli wzli changed the title feat: skip music system library refresh when no new tracks are downloaded refactor: skip music system library refresh when no new tracks are downloaded Aug 13, 2026
@wzli
wzli force-pushed the feature/skip-library-refresh-when-no-downloads branch 7 times, most recently from e91fb28 to 74e286d Compare August 13, 2026 03:30
@wzli
wzli force-pushed the feature/skip-library-refresh-when-no-downloads branch from 74e286d to e17fafb Compare August 13, 2026 03:31
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.

1 participant