fix: address code review findings

This commit is contained in:
2026-07-20 00:05:22 +03:00
parent ce1c39e14b
commit e0211343e0
7 changed files with 159 additions and 53 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"log"
"naviwatcher/internal/database"
)
@@ -36,7 +37,11 @@ func SyncAlbums(ctx context.Context, client *NavidromeClient, db *database.DB) e
albums, err := client.GetArtistAlbums(artist.ID)
if err != nil {
return fmt.Errorf("sync albums: get albums for artist %s: %w", artist.ID, err)
// A transient failure for one artist must not abort the whole pull
// and take down the daemon; log it and continue with the remaining
// artists, matching the resilience of SyncAll/ScanAll.
log.Printf("sync albums: skip artist %s: %v", artist.ID, err)
continue
}
// Delete existing albums for this artist and insert fresh set within