fix: address code review findings
This commit is contained in:
@@ -119,28 +119,6 @@ func SetReleaseIgnored(db *DB, rgid string, ignored bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeleteExternalReleasesByArtist removes all external_release rows for a given artist_id.
|
||||
func DeleteExternalReleasesByArtist(db *DB, artistID string) error {
|
||||
_, err := db.Conn().Exec(
|
||||
"DELETE FROM external_releases WHERE artist_id = ?",
|
||||
artistID,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("delete external releases by artist: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CountExternalReleases returns the total number of external_release rows.
|
||||
func CountExternalReleases(db *DB) (int, error) {
|
||||
var count int
|
||||
err := db.Conn().QueryRow("SELECT COUNT(*) FROM external_releases").Scan(&count)
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("count external releases: %w", err)
|
||||
}
|
||||
return count, nil
|
||||
}
|
||||
|
||||
// GetExternalReleasesByArtistWithCache returns cached external_release rows for a given artist_id
|
||||
// that are within the specified TTL.
|
||||
func GetExternalReleasesByArtistWithCache(db *DB, artistID string, ttl time.Duration) ([]ExternalRelease, error) {
|
||||
|
||||
Reference in New Issue
Block a user