feat(subsonic)!: drop support for guessed artist covers in filesystem
it doesn't make sense with multi-artist support anymore gonic will use lastfm or an album cover instead Release-As: 0.16.0
This commit is contained in:
@@ -319,11 +319,6 @@ func (c *Controller) ServeGetArtistInfoTwo(r *http.Request) *spec.Response {
|
||||
|
||||
sub := spec.NewResponse()
|
||||
sub.ArtistInfoTwo = &spec.ArtistInfo{}
|
||||
if artist.Cover != "" {
|
||||
sub.ArtistInfoTwo.SmallImageURL = c.genArtistCoverURL(r, &artist, 64)
|
||||
sub.ArtistInfoTwo.MediumImageURL = c.genArtistCoverURL(r, &artist, 126)
|
||||
sub.ArtistInfoTwo.LargeImageURL = c.genArtistCoverURL(r, &artist, 256)
|
||||
}
|
||||
|
||||
apiKey, _ := c.DB.GetSetting("lastfm_api_key")
|
||||
if apiKey == "" {
|
||||
@@ -338,23 +333,15 @@ func (c *Controller) ServeGetArtistInfoTwo(r *http.Request) *spec.Response {
|
||||
sub.ArtistInfoTwo.MusicBrainzID = info.MBID
|
||||
sub.ArtistInfoTwo.LastFMURL = info.URL
|
||||
|
||||
if artist.Cover == "" {
|
||||
for _, image := range info.Image {
|
||||
switch image.Size {
|
||||
case "small":
|
||||
sub.ArtistInfoTwo.SmallImageURL = image.Text
|
||||
case "medium":
|
||||
sub.ArtistInfoTwo.MediumImageURL = image.Text
|
||||
case "large":
|
||||
sub.ArtistInfoTwo.LargeImageURL = image.Text
|
||||
}
|
||||
}
|
||||
if url, _ := c.LastFMClient.StealArtistImage(info.URL); url != "" {
|
||||
sub.ArtistInfoTwo.SmallImageURL = url
|
||||
sub.ArtistInfoTwo.MediumImageURL = url
|
||||
sub.ArtistInfoTwo.LargeImageURL = url
|
||||
sub.ArtistInfoTwo.ArtistImageURL = url
|
||||
}
|
||||
sub.ArtistInfoTwo.SmallImageURL = c.genArtistCoverURL(r, &artist, 64)
|
||||
sub.ArtistInfoTwo.MediumImageURL = c.genArtistCoverURL(r, &artist, 126)
|
||||
sub.ArtistInfoTwo.LargeImageURL = c.genArtistCoverURL(r, &artist, 256)
|
||||
|
||||
if url, _ := c.LastFMClient.StealArtistImage(info.URL); url != "" {
|
||||
sub.ArtistInfoTwo.SmallImageURL = url
|
||||
sub.ArtistInfoTwo.MediumImageURL = url
|
||||
sub.ArtistInfoTwo.LargeImageURL = url
|
||||
sub.ArtistInfoTwo.ArtistImageURL = url
|
||||
}
|
||||
|
||||
count := params.GetOrInt("count", 20)
|
||||
|
||||
@@ -149,10 +149,10 @@ func coverGetPathAlbum(dbc *db.DB, id int) (string, error) {
|
||||
func coverGetPathArtist(dbc *db.DB, id int) (string, error) {
|
||||
folder := &db.Album{}
|
||||
err := dbc.DB.
|
||||
Select("parent.id, parent.root_dir, parent.left_path, parent.right_path, parent.cover").
|
||||
Joins("JOIN album_artists ON album_artists.album_id").
|
||||
Select("albums.id, albums.root_dir, albums.left_path, albums.right_path, albums.cover").
|
||||
Joins("JOIN album_artists ON album_artists.album_id=albums.id").
|
||||
Where("album_artists.artist_id=?", id).
|
||||
Joins("JOIN albums parent ON parent.id=albums.parent_id").
|
||||
Group("albums.id").
|
||||
Find(folder).
|
||||
Error
|
||||
if err != nil {
|
||||
|
||||
@@ -102,9 +102,7 @@ func NewArtistByTags(a *db.Artist) *Artist {
|
||||
Name: a.Name,
|
||||
AlbumCount: a.AlbumCount,
|
||||
AverageRating: formatRating(a.AverageRating),
|
||||
}
|
||||
if a.Cover != "" {
|
||||
r.CoverID = a.SID()
|
||||
CoverID: a.SID(),
|
||||
}
|
||||
if a.ArtistStar != nil {
|
||||
r.Starred = &a.ArtistStar.StarDate
|
||||
|
||||
@@ -6,6 +6,19 @@
|
||||
"serverVersion": "",
|
||||
"albumList": {
|
||||
"album": [
|
||||
{
|
||||
"id": "al-8",
|
||||
"coverArt": "al-8",
|
||||
"artist": "artist-1",
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "album-1",
|
||||
"album": "",
|
||||
"parent": "al-6",
|
||||
"isDir": true,
|
||||
"name": "",
|
||||
"songCount": 3,
|
||||
"duration": 300
|
||||
},
|
||||
{
|
||||
"id": "al-7",
|
||||
"coverArt": "al-7",
|
||||
@@ -19,6 +32,19 @@
|
||||
"songCount": 3,
|
||||
"duration": 300
|
||||
},
|
||||
{
|
||||
"id": "al-9",
|
||||
"coverArt": "al-9",
|
||||
"artist": "artist-1",
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "album-2",
|
||||
"album": "",
|
||||
"parent": "al-6",
|
||||
"isDir": true,
|
||||
"name": "",
|
||||
"songCount": 3,
|
||||
"duration": 300
|
||||
},
|
||||
{
|
||||
"id": "al-4",
|
||||
"coverArt": "al-4",
|
||||
@@ -58,19 +84,6 @@
|
||||
"songCount": 3,
|
||||
"duration": 300
|
||||
},
|
||||
{
|
||||
"id": "al-13",
|
||||
"coverArt": "al-13",
|
||||
"artist": "artist-2",
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "album-2",
|
||||
"album": "",
|
||||
"parent": "al-10",
|
||||
"isDir": true,
|
||||
"name": "",
|
||||
"songCount": 3,
|
||||
"duration": 300
|
||||
},
|
||||
{
|
||||
"id": "al-5",
|
||||
"coverArt": "al-5",
|
||||
@@ -85,26 +98,13 @@
|
||||
"duration": 300
|
||||
},
|
||||
{
|
||||
"id": "al-9",
|
||||
"coverArt": "al-9",
|
||||
"artist": "artist-1",
|
||||
"id": "al-13",
|
||||
"coverArt": "al-13",
|
||||
"artist": "artist-2",
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "album-2",
|
||||
"album": "",
|
||||
"parent": "al-6",
|
||||
"isDir": true,
|
||||
"name": "",
|
||||
"songCount": 3,
|
||||
"duration": 300
|
||||
},
|
||||
{
|
||||
"id": "al-8",
|
||||
"coverArt": "al-8",
|
||||
"artist": "artist-1",
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "album-1",
|
||||
"album": "",
|
||||
"parent": "al-6",
|
||||
"parent": "al-10",
|
||||
"isDir": true,
|
||||
"name": "",
|
||||
"songCount": 3,
|
||||
|
||||
@@ -6,51 +6,6 @@
|
||||
"serverVersion": "",
|
||||
"albumList2": {
|
||||
"album": [
|
||||
{
|
||||
"id": "al-4",
|
||||
"coverArt": "al-4",
|
||||
"artistId": "ar-1",
|
||||
"artist": "artist-0",
|
||||
"artistIds": ["ar-1"],
|
||||
"artists": ["artist-0"],
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "",
|
||||
"album": "",
|
||||
"name": "album-1",
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-13",
|
||||
"coverArt": "al-13",
|
||||
"artistId": "ar-3",
|
||||
"artist": "artist-2",
|
||||
"artistIds": ["ar-3"],
|
||||
"artists": ["artist-2"],
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "",
|
||||
"album": "",
|
||||
"name": "album-2",
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-3",
|
||||
"coverArt": "al-3",
|
||||
"artistId": "ar-1",
|
||||
"artist": "artist-0",
|
||||
"artistIds": ["ar-1"],
|
||||
"artists": ["artist-0"],
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "",
|
||||
"album": "",
|
||||
"name": "album-0",
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-11",
|
||||
"coverArt": "al-11",
|
||||
@@ -66,21 +21,6 @@
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-9",
|
||||
"coverArt": "al-9",
|
||||
"artistId": "ar-2",
|
||||
"artist": "artist-1",
|
||||
"artistIds": ["ar-2"],
|
||||
"artists": ["artist-1"],
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "",
|
||||
"album": "",
|
||||
"name": "album-2",
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-8",
|
||||
"coverArt": "al-8",
|
||||
@@ -96,6 +36,36 @@
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-3",
|
||||
"coverArt": "al-3",
|
||||
"artistId": "ar-1",
|
||||
"artist": "artist-0",
|
||||
"artistIds": ["ar-1"],
|
||||
"artists": ["artist-0"],
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "",
|
||||
"album": "",
|
||||
"name": "album-0",
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-13",
|
||||
"coverArt": "al-13",
|
||||
"artistId": "ar-3",
|
||||
"artist": "artist-2",
|
||||
"artistIds": ["ar-3"],
|
||||
"artists": ["artist-2"],
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "",
|
||||
"album": "",
|
||||
"name": "album-2",
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-12",
|
||||
"coverArt": "al-12",
|
||||
@@ -111,6 +81,21 @@
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-9",
|
||||
"coverArt": "al-9",
|
||||
"artistId": "ar-2",
|
||||
"artist": "artist-1",
|
||||
"artistIds": ["ar-2"],
|
||||
"artists": ["artist-1"],
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "",
|
||||
"album": "",
|
||||
"name": "album-2",
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-5",
|
||||
"coverArt": "al-5",
|
||||
@@ -140,6 +125,21 @@
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
},
|
||||
{
|
||||
"id": "al-4",
|
||||
"coverArt": "al-4",
|
||||
"artistId": "ar-1",
|
||||
"artist": "artist-0",
|
||||
"artistIds": ["ar-1"],
|
||||
"artists": ["artist-0"],
|
||||
"created": "2019-11-30T00:00:00Z",
|
||||
"title": "",
|
||||
"album": "",
|
||||
"name": "album-1",
|
||||
"songCount": 3,
|
||||
"duration": 300,
|
||||
"year": 2021
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"artist": {
|
||||
"id": "ar-1",
|
||||
"name": "artist-0",
|
||||
"coverArt": "ar-1",
|
||||
"albumCount": 3,
|
||||
"album": [
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"artist": {
|
||||
"id": "ar-3",
|
||||
"name": "artist-2",
|
||||
"coverArt": "ar-3",
|
||||
"albumCount": 3,
|
||||
"album": [
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
"artist": {
|
||||
"id": "ar-2",
|
||||
"name": "artist-1",
|
||||
"coverArt": "ar-2",
|
||||
"albumCount": 3,
|
||||
"album": [
|
||||
{
|
||||
|
||||
@@ -10,9 +10,24 @@
|
||||
{
|
||||
"name": "a",
|
||||
"artist": [
|
||||
{ "id": "ar-1", "name": "artist-0", "albumCount": 6 },
|
||||
{ "id": "ar-2", "name": "artist-1", "albumCount": 6 },
|
||||
{ "id": "ar-3", "name": "artist-2", "albumCount": 6 }
|
||||
{
|
||||
"id": "ar-1",
|
||||
"name": "artist-0",
|
||||
"coverArt": "ar-1",
|
||||
"albumCount": 6
|
||||
},
|
||||
{
|
||||
"id": "ar-2",
|
||||
"name": "artist-1",
|
||||
"coverArt": "ar-2",
|
||||
"albumCount": 6
|
||||
},
|
||||
{
|
||||
"id": "ar-3",
|
||||
"name": "artist-2",
|
||||
"coverArt": "ar-3",
|
||||
"albumCount": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -10,9 +10,24 @@
|
||||
{
|
||||
"name": "a",
|
||||
"artist": [
|
||||
{ "id": "ar-1", "name": "artist-0", "albumCount": 3 },
|
||||
{ "id": "ar-2", "name": "artist-1", "albumCount": 3 },
|
||||
{ "id": "ar-3", "name": "artist-2", "albumCount": 3 }
|
||||
{
|
||||
"id": "ar-1",
|
||||
"name": "artist-0",
|
||||
"coverArt": "ar-1",
|
||||
"albumCount": 3
|
||||
},
|
||||
{
|
||||
"id": "ar-2",
|
||||
"name": "artist-1",
|
||||
"coverArt": "ar-2",
|
||||
"albumCount": 3
|
||||
},
|
||||
{
|
||||
"id": "ar-3",
|
||||
"name": "artist-2",
|
||||
"coverArt": "ar-3",
|
||||
"albumCount": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -10,9 +10,24 @@
|
||||
{
|
||||
"name": "a",
|
||||
"artist": [
|
||||
{ "id": "ar-1", "name": "artist-0", "albumCount": 3 },
|
||||
{ "id": "ar-2", "name": "artist-1", "albumCount": 3 },
|
||||
{ "id": "ar-3", "name": "artist-2", "albumCount": 3 }
|
||||
{
|
||||
"id": "ar-1",
|
||||
"name": "artist-0",
|
||||
"coverArt": "ar-1",
|
||||
"albumCount": 3
|
||||
},
|
||||
{
|
||||
"id": "ar-2",
|
||||
"name": "artist-1",
|
||||
"coverArt": "ar-2",
|
||||
"albumCount": 3
|
||||
},
|
||||
{
|
||||
"id": "ar-3",
|
||||
"name": "artist-2",
|
||||
"coverArt": "ar-3",
|
||||
"albumCount": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -6,9 +6,24 @@
|
||||
"serverVersion": "",
|
||||
"searchResult3": {
|
||||
"artist": [
|
||||
{ "id": "ar-1", "name": "artist-0", "albumCount": 3 },
|
||||
{ "id": "ar-2", "name": "artist-1", "albumCount": 3 },
|
||||
{ "id": "ar-3", "name": "artist-2", "albumCount": 3 }
|
||||
{
|
||||
"id": "ar-1",
|
||||
"name": "artist-0",
|
||||
"coverArt": "ar-1",
|
||||
"albumCount": 3
|
||||
},
|
||||
{
|
||||
"id": "ar-2",
|
||||
"name": "artist-1",
|
||||
"coverArt": "ar-2",
|
||||
"albumCount": 3
|
||||
},
|
||||
{
|
||||
"id": "ar-3",
|
||||
"name": "artist-2",
|
||||
"coverArt": "ar-3",
|
||||
"albumCount": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user