feat: add download tracking endpoints (sections 4.1, 4.2, 4.3, 4.4)

This commit is contained in:
Alexander
2026-04-29 13:44:01 +02:00
parent c307c68d88
commit 3ecc6aee62
6 changed files with 999 additions and 0 deletions
+13
View File
@@ -361,6 +361,19 @@ func (e *TestEnv) CleanupBlocklist(ctx context.Context) error {
return err
}
// CleanupDownloadQueue removes all download_queue entries (for test cleanup).
func (e *TestEnv) CleanupDownloadQueue(ctx context.Context) error {
_, err := e.DB.Exec(ctx, "DELETE FROM download_queue")
return err
}
// CountDownloadQueue returns the number of entries in download_queue.
func (e *TestEnv) CountDownloadQueue(ctx context.Context) (int64, error) {
var count int64
err := e.DB.QueryRow(ctx, "SELECT COUNT(*) FROM download_queue").Scan(&count)
return count, err
}
// GetAlbumsByArtistForeignID retrieves albums for an artist by foreign artist ID.
func (e *TestEnv) GetAlbumsByArtistForeignID(ctx context.Context, foreignArtistID string) ([]map[string]any, error) {
rows, err := e.DB.Query(ctx, `