images

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

package imagesrc defines interfaces for album and artist image providers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAlbumImage

func GetAlbumImage(ctx context.Context, opts AlbumImageOpts) (string, error)

func GetArtistImage

func GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error)

func Initialize

func Initialize(opts ImageSourceOpts)

all functions are no-op if no providers are enabled

func Shutdown

func Shutdown()

Types

type AlbumImageOpts

type AlbumImageOpts struct {
	Artists           []string
	Album             string
	ReleaseMbzID      *uuid.UUID
	ReleaseGroupMbzID *uuid.UUID
}

type ArtistImageOpts

type ArtistImageOpts struct {
	Aliases []string
}

type DeezerAlbum

type DeezerAlbum struct {
	Title    string `json:"title"`
	CoverXL  string `json:"cover_xl"`
	CoverSm  string `json:"cover_small"`
	CoverMd  string `json:"cover_medium"`
	CoverBig string `json:"cover_big"`
}

type DeezerAlbumResponse

type DeezerAlbumResponse struct {
	Data []DeezerAlbum `json:"data"`
}

type DeezerArtist

type DeezerArtist struct {
	Name       string `json:"name"`
	PictureXL  string `json:"picture_xl"`
	PictureSm  string `json:"picture_small"`
	PictureMd  string `json:"picture_medium"`
	PictureBig string `json:"picture_big"`
}

type DeezerArtistResponse

type DeezerArtistResponse struct {
	Data []DeezerArtist `json:"data"`
}

type DeezerClient

type DeezerClient struct {
	// contains filtered or unexported fields
}

func NewDeezerClient

func NewDeezerClient() *DeezerClient

func (*DeezerClient) GetAlbumImages

func (c *DeezerClient) GetAlbumImages(ctx context.Context, artists []string, album string) (string, error)

func (*DeezerClient) GetArtistImages

func (c *DeezerClient) GetArtistImages(ctx context.Context, aliases []string) (string, error)

func (*DeezerClient) Shutdown

func (c *DeezerClient) Shutdown()

type ErrorFinder

type ErrorFinder struct{}

func (*ErrorFinder) GetAlbumImage

func (m *ErrorFinder) GetAlbumImage(ctx context.Context, opts AlbumImageOpts) (string, error)

func (*ErrorFinder) GetArtistImage

func (m *ErrorFinder) GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error)

func (*ErrorFinder) Shutdown

func (m *ErrorFinder) Shutdown()

type ImageSource

type ImageSource struct {
	// contains filtered or unexported fields
}

type ImageSourceOpts

type ImageSourceOpts struct {
	UserAgent      string
	EnableCAA      bool
	EnableDeezer   bool
	EnableSubsonic bool
}

type MockFinder

type MockFinder struct{}

func (*MockFinder) GetAlbumImage

func (m *MockFinder) GetAlbumImage(ctx context.Context, opts AlbumImageOpts) (string, error)

func (*MockFinder) GetArtistImage

func (m *MockFinder) GetArtistImage(ctx context.Context, opts ArtistImageOpts) (string, error)

func (*MockFinder) Shutdown

func (m *MockFinder) Shutdown()

type SubsonicAlbumResponse added in v0.0.14

type SubsonicAlbumResponse struct {
	SubsonicResponse struct {
		Status        string `json:"status"`
		SearchResult3 struct {
			Album []struct {
				CoverArt string `json:"coverArt"`
			} `json:"album"`
		} `json:"searchResult3"`
	} `json:"subsonic-response"`
}

type SubsonicArtistResponse added in v0.0.14

type SubsonicArtistResponse struct {
	SubsonicResponse struct {
		Status        string `json:"status"`
		SearchResult3 struct {
			Artist []struct {
				ArtistImageUrl string `json:"artistImageUrl"`
			} `json:"artist"`
		} `json:"searchResult3"`
	} `json:"subsonic-response"`
}

type SubsonicClient added in v0.0.14

type SubsonicClient struct {
	// contains filtered or unexported fields
}

func NewSubsonicClient added in v0.0.14

func NewSubsonicClient() *SubsonicClient

func (*SubsonicClient) GetAlbumImage added in v0.0.14

func (c *SubsonicClient) GetAlbumImage(ctx context.Context, artist, album string) (string, error)

func (*SubsonicClient) GetArtistImage added in v0.0.14

func (c *SubsonicClient) GetArtistImage(ctx context.Context, artist string) (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL