mirror of
https://github.com/SoPat712/allstarr.git
synced 2026-02-09 23:55:10 -05:00
fix: enable deduplication for cache mode
- Cache mode now registers downloaded songs in mappings - Prevents duplicate downloads in cache mode - Fixes wasted API calls and duplicate cache files - Both cache and download modes benefit from deduplication
This commit is contained in:
@@ -298,11 +298,8 @@ public abstract class BaseDownloadService : IDownloadService
|
|||||||
|
|
||||||
song.LocalPath = localPath;
|
song.LocalPath = localPath;
|
||||||
|
|
||||||
// Register BEFORE releasing lock to prevent race conditions
|
// Register BEFORE releasing lock to prevent race conditions (both cache and download modes)
|
||||||
if (!isCache)
|
await LocalLibraryService.RegisterDownloadedSongAsync(song, localPath);
|
||||||
{
|
|
||||||
await LocalLibraryService.RegisterDownloadedSongAsync(song, localPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if this track belongs to a playlist and update M3U
|
// Check if this track belongs to a playlist and update M3U
|
||||||
if (PlaylistSyncService != null)
|
if (PlaylistSyncService != null)
|
||||||
@@ -322,7 +319,7 @@ public abstract class BaseDownloadService : IDownloadService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger library scan and album download AFTER releasing lock
|
// Trigger library scan and album download AFTER releasing lock (download mode only)
|
||||||
if (!isCache)
|
if (!isCache)
|
||||||
{
|
{
|
||||||
// Trigger a Subsonic library rescan (with debounce)
|
// Trigger a Subsonic library rescan (with debounce)
|
||||||
|
|||||||
Reference in New Issue
Block a user