Files
metadata-agregator/internal/provider/provider.go
T
Alexander 9f1318e79e feat: fetch all artist albums with caching, filter by type in handler
- Provider fetches all release groups via paginated browse, no type filter
- Service caches all albums in DB, ensures referenced artists exist first
- Server handler filters by album_types (default: album|ep|single), excludes secondary types
- Add secondary_types to domain, DB schema, and MB types
- Add ErrBadRequest handling for MusicBrainz 400 errors
- Replace migrations with single schema.sql
- Add GetAllByArtistID and SaveAll to album repository
2026-05-07 20:03:04 +02:00

27 lines
934 B
Go

package provider
import (
"context"
"github.com/metadata-agregator/internal/domain"
)
type Provider interface {
Name() string
GetArtist(ctx context.Context, id string) (*domain.Artist, error)
SearchArtists(ctx context.Context, query string, limit, offset int) (*domain.SearchResult[domain.Artist], error)
GetAlbum(ctx context.Context, id string) (*domain.Album, error)
SearchAlbums(ctx context.Context, query string, artist string, limit, offset int) (*domain.SearchResult[domain.Album], error)
GetArtistAlbums(ctx context.Context, artistID string) ([]domain.Album, error)
GetTrack(ctx context.Context, id string) (*domain.Track, error)
GetAlbumTracks(ctx context.Context, albumID string) ([]domain.Track, error)
GetTrackByISRC(ctx context.Context, isrc string) (*domain.Track, error)
GetLabel(ctx context.Context, id string) (*domain.Label, error)
GetWork(ctx context.Context, id string) (*domain.Work, error)
}