Operator feedback (2026-05-09): the 500-album cap meant cover art rolled
in over many nightly runs even when local sources (sidecar/embedded)
could finish in minutes. Remove the global cap; rely on the existing
per-provider HTTP throttle (coverart httpClient MinInterval) so local
art is disk-speed and remote providers stay TOS-friendly.
- enricher.go / artist_enricher.go: EnrichBatch, EnrichArtistBatch,
EnrichRetryMissing now treat limit<0 as unbounded (0 still = stage
disabled). The cap was a SQL LIMIT; unbounded uses max int32.
- main.go: RunScanConfig EnrichCap/ArtistEnrichCap = -1 (unbounded).
- Drop LibraryConfig.CoverArtBackfillCap + the
MINSTREL_LIBRARY_COVERART_BACKFILL_CAP env var.
- Drop the now-dead coverBackfillCap param threaded through
server.New + api.Mount + the handlers struct.
- Admin bulk refetch (/api/admin/covers/refetch-missing) now drains
unbounded; response {queued:int} → {started:bool} (the count is
unknowable synchronously for a fire-and-forget drain). Web copy +
client type + Go/web tests updated to match.
No doc refs existed (config.example.yaml / docker-compose / README
never documented the env var).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
|
|
vi.mock('./client', () => ({
|
|
api: {
|
|
get: vi.fn(),
|
|
post: vi.fn(),
|
|
put: vi.fn(),
|
|
del: vi.fn()
|
|
}
|
|
}));
|
|
|
|
import { refetchAlbumCover, refetchMissingCovers } from './admin';
|
|
import { api } from './client';
|
|
|
|
describe('admin covers API', () => {
|
|
beforeEach(() => vi.clearAllMocks());
|
|
|
|
it('refetchAlbumCover POSTs to the correct path', async () => {
|
|
(api.post as unknown as ReturnType<typeof vi.fn>).mockResolvedValueOnce({
|
|
album_id: 'a1', cover_art_path: '/x.jpg', cover_art_source: 'mbcaa'
|
|
});
|
|
const got = await refetchAlbumCover('a1');
|
|
expect(api.post).toHaveBeenCalledWith('/api/admin/albums/a1/cover/refetch', {});
|
|
expect(got.cover_art_source).toBe('mbcaa');
|
|
});
|
|
|
|
it('refetchMissingCovers POSTs to the bulk endpoint', async () => {
|
|
(api.post as unknown as ReturnType<typeof vi.fn>).mockResolvedValueOnce({ started: true });
|
|
const got = await refetchMissingCovers();
|
|
expect(api.post).toHaveBeenCalledWith('/api/admin/covers/refetch-missing', {});
|
|
expect(got.started).toBe(true);
|
|
});
|
|
});
|