mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 04:57:37 +03:00
Find artist.*
image in Artist folder
This commit is contained in:
parent
69e0a266f4
commit
c90468b895
6 changed files with 111 additions and 8 deletions
|
@ -39,6 +39,7 @@ type Album struct {
|
|||
MbzAlbumType string `structs:"mbz_album_type" json:"mbzAlbumType,omitempty"`
|
||||
MbzAlbumComment string `structs:"mbz_album_comment" json:"mbzAlbumComment,omitempty"`
|
||||
ImageFiles string `structs:"image_files" json:"imageFiles,omitempty"`
|
||||
Paths string `structs:"paths" json:"paths,omitempty"`
|
||||
CreatedAt time.Time `structs:"created_at" json:"createdAt"`
|
||||
UpdatedAt time.Time `structs:"updated_at" json:"updatedAt"`
|
||||
}
|
||||
|
|
|
@ -146,6 +146,7 @@ func (mfs MediaFiles) ToAlbum() Album {
|
|||
a.EmbedArtPath = m.Path
|
||||
}
|
||||
}
|
||||
a.Paths = strings.Join(mfs.Dirs(), string(filepath.ListSeparator))
|
||||
comments = slices.Compact(comments)
|
||||
if len(comments) == 1 {
|
||||
a.Comment = comments[0]
|
||||
|
|
|
@ -21,14 +21,14 @@ var _ = Describe("MediaFiles", func() {
|
|||
SortAlbumName: "SortAlbumName", SortArtistName: "SortArtistName", SortAlbumArtistName: "SortAlbumArtistName",
|
||||
OrderAlbumName: "OrderAlbumName", OrderAlbumArtistName: "OrderAlbumArtistName",
|
||||
MbzAlbumArtistID: "MbzAlbumArtistID", MbzAlbumType: "MbzAlbumType", MbzAlbumComment: "MbzAlbumComment",
|
||||
Compilation: false, CatalogNum: "",
|
||||
Compilation: false, CatalogNum: "", Path: "/music1/file1.mp3",
|
||||
},
|
||||
{
|
||||
ID: "2", Album: "Album", ArtistID: "ArtistID", Artist: "Artist", AlbumArtistID: "AlbumArtistID", AlbumArtist: "AlbumArtist", AlbumID: "AlbumID",
|
||||
SortAlbumName: "SortAlbumName", SortArtistName: "SortArtistName", SortAlbumArtistName: "SortAlbumArtistName",
|
||||
OrderAlbumName: "OrderAlbumName", OrderArtistName: "OrderArtistName", OrderAlbumArtistName: "OrderAlbumArtistName",
|
||||
MbzAlbumArtistID: "MbzAlbumArtistID", MbzAlbumType: "MbzAlbumType", MbzAlbumComment: "MbzAlbumComment",
|
||||
Compilation: true, CatalogNum: "CatalogNum", HasCoverArt: true, Path: "/music/file.mp3",
|
||||
Compilation: true, CatalogNum: "CatalogNum", HasCoverArt: true, Path: "/music2/file2.mp3",
|
||||
},
|
||||
}
|
||||
})
|
||||
|
@ -51,7 +51,8 @@ var _ = Describe("MediaFiles", func() {
|
|||
Expect(album.MbzAlbumComment).To(Equal("MbzAlbumComment"))
|
||||
Expect(album.CatalogNum).To(Equal("CatalogNum"))
|
||||
Expect(album.Compilation).To(BeTrue())
|
||||
Expect(album.EmbedArtPath).To(Equal("/music/file.mp3"))
|
||||
Expect(album.EmbedArtPath).To(Equal("/music2/file2.mp3"))
|
||||
Expect(album.Paths).To(Equal("/music1:/music2"))
|
||||
})
|
||||
})
|
||||
Context("Aggregated attributes", func() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue