fix: address code review findings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user