fix: address code review findings
- Fix duplicate Telegram notifications: SyncArtistDiscography no longer wipes notifications_sent for the whole artist on every cache-miss re-sync; only markers for releases that disappear are pruned (FK-safe via INSERT OR REPLACE + rgid NOT IN (...)). - Cache empty MusicBrainz discographies via a new artist_settings.last_synced column (migration 009) so zero-release artists honor the TTL instead of being re-fetched every cycle. - Wire the Web UI server and Telegram notifier scheduler into main.run/NewApp. - Guard startPeriodicSync against overlapping syncs with a done-channel slot. - Add server.public_url config; NewServerWithConfig derives reachable links and no longer advertises the 0.0.0.0 bind address. - Web handlers: use scanner.ScanArtist per artist, drop always-false releaseIgnored lookup and dead endsWith, thread configured threshold. - Limit :memory: DB pool to one connection so migrations and queries share the same in-memory store.
This commit is contained in:
@@ -205,11 +205,11 @@ func TestMigrationTracking(t *testing.T) {
|
||||
t.Fatalf("query migrations count: %v", err)
|
||||
}
|
||||
|
||||
// We have 8 recorded migrations: artist_settings, external_releases,
|
||||
// We have 9 recorded migrations: artist_settings, external_releases,
|
||||
// local_albums, notifications_sent, cached_at column, secondary_types
|
||||
// column, the external_releases.artist_id index, and the artist_settings
|
||||
// mbid column.
|
||||
if count != 8 {
|
||||
t.Errorf("expected 8 applied migrations, got %d", count)
|
||||
// column, the external_releases.artist_id index, the artist_settings mbid
|
||||
// column, and the artist_settings last_synced column.
|
||||
if count != 9 {
|
||||
t.Errorf("expected 9 applied migrations, got %d", count)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user