fix: address code review findings
This commit is contained in:
@@ -120,13 +120,16 @@ func IsTypeIncluded(releaseType string) bool {
|
||||
// MBID) must NOT be stored here, because artist_settings is keyed by the
|
||||
// Navidrome ID and the foreign key / join would otherwise never match.
|
||||
func (rg *ReleaseGroup) ToExternalRelease(artistID string) *database.ExternalRelease {
|
||||
// Only the primary type is persisted; secondary types are used transiently
|
||||
// for filtering above and are not stored in the external_releases schema.
|
||||
// The primary type and the secondary types are both persisted so that the
|
||||
// cache-hit path in SyncArtistDiscography can re-apply the same
|
||||
// IgnoreSingles / IgnoreCompilations rules (which consider secondary types)
|
||||
// as the cache-miss path, keeping results stable across cache refreshes.
|
||||
return &database.ExternalRelease{
|
||||
RGID: rg.ID,
|
||||
ArtistID: artistID,
|
||||
Title: rg.Title,
|
||||
Type: rg.Type,
|
||||
ReleaseDate: rg.ReleaseDate,
|
||||
RGID: rg.ID,
|
||||
ArtistID: artistID,
|
||||
Title: rg.Title,
|
||||
Type: rg.Type,
|
||||
ReleaseDate: rg.ReleaseDate,
|
||||
SecondaryTypes: rg.SecondaryTypes,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user