2020-07-10 08:45:58 -08:00
|
|
|
package core
|
2020-04-05 16:31:05 -08:00
|
|
|
|
|
|
|
|
import (
|
2020-04-26 08:06:38 -08:00
|
|
|
"context"
|
2020-04-05 16:31:05 -08:00
|
|
|
|
|
|
|
|
"github.com/navidrome/navidrome/log"
|
|
|
|
|
"github.com/navidrome/navidrome/model"
|
2020-10-27 07:01:40 -08:00
|
|
|
"github.com/navidrome/navidrome/tests"
|
2022-07-26 12:47:16 -08:00
|
|
|
. "github.com/onsi/ginkgo/v2"
|
2020-04-05 16:31:05 -08:00
|
|
|
)
|
|
|
|
|
|
2020-07-31 05:31:19 -08:00
|
|
|
var _ = Describe("Artwork", func() {
|
2020-04-05 16:31:05 -08:00
|
|
|
var ds model.DataStore
|
2020-04-26 08:06:38 -08:00
|
|
|
ctx := log.NewContext(context.TODO())
|
2020-04-05 16:31:05 -08:00
|
|
|
|
|
|
|
|
BeforeEach(func() {
|
2021-06-08 12:30:19 -08:00
|
|
|
ds = &tests.MockDataStore{MockedTranscoding: &tests.MockTranscodingRepo{}}
|
|
|
|
|
ds.Album(ctx).(*tests.MockAlbumRepo).SetData(model.Albums{
|
2022-12-19 10:11:43 -09:00
|
|
|
{ID: "222", EmbedArtPath: "tests/fixtures/test.mp3"},
|
|
|
|
|
{ID: "333"},
|
|
|
|
|
{ID: "444", EmbedArtPath: "tests/fixtures/cover.jpg"},
|
2020-10-27 06:48:37 -08:00
|
|
|
})
|
2021-06-08 12:30:19 -08:00
|
|
|
ds.MediaFile(ctx).(*tests.MockMediaFileRepo).SetData(model.MediaFiles{
|
2020-10-27 06:48:37 -08:00
|
|
|
{ID: "123", AlbumID: "222", Path: "tests/fixtures/test.mp3", HasCoverArt: true},
|
|
|
|
|
{ID: "456", AlbumID: "222", Path: "tests/fixtures/test.ogg", HasCoverArt: false},
|
|
|
|
|
})
|
2020-04-05 16:31:05 -08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
})
|