mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
New: Refactor metadata update
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NzbDrone.Core.MetadataSource.SkyHook.Resource
|
||||
{
|
||||
public class ArtistResource
|
||||
{
|
||||
public ArtistResource() {
|
||||
public ArtistResource()
|
||||
{
|
||||
Albums = new List<AlbumResource>();
|
||||
Genres = new List<string>();
|
||||
}
|
||||
|
||||
public List<string> Genres { get; set; }
|
||||
|
||||
@@ -82,10 +82,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
artist.SortName = Parser.Parser.NormalizeTitle(artist.Metadata.Value.Name);
|
||||
|
||||
artist.Albums = FilterAlbums(httpResponse.Resource.Albums, metadataProfileId)
|
||||
.Select(x => new Album {
|
||||
ForeignAlbumId = x.Id
|
||||
})
|
||||
.ToList();
|
||||
.Select(x => MapAlbum(x, null)).ToList();
|
||||
|
||||
return artist;
|
||||
}
|
||||
@@ -136,6 +133,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
var artists = httpResponse.Resource.Artists.Select(MapArtistMetadata).ToList();
|
||||
var artistDict = artists.ToDictionary(x => x.ForeignArtistId, x => x);
|
||||
var album = MapAlbum(httpResponse.Resource, artistDict);
|
||||
album.ArtistMetadata = artistDict[httpResponse.Resource.ArtistId];
|
||||
|
||||
return new Tuple<string, Album, List<ArtistMetadata>>(httpResponse.Resource.ArtistId, album, artists);
|
||||
}
|
||||
@@ -181,8 +179,6 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
.SetSegment("route", "search")
|
||||
.AddQueryParam("type", "artist")
|
||||
.AddQueryParam("query", title.ToLower().Trim())
|
||||
//.AddQueryParam("images","false") // Should pass these on import search to avoid looking to fanart and wiki
|
||||
//.AddQueryParam("overview","false")
|
||||
.Build();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user