mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
More Work on Album Filtering per Artist
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using NzbDrone.Core.Music;
|
||||
using NzbDrone.Core.Music;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace NzbDrone.Core.MetadataSource
|
||||
{
|
||||
public interface IProvideArtistInfo
|
||||
{
|
||||
Tuple<Artist, List<Album>> GetArtistInfo(string lidarrId);
|
||||
Tuple<Artist, List<Album>> GetArtistInfo(string lidarrId, List<string> primaryAlbumTypes, List<string> secondaryAlbumTypes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public Tuple<Artist, List<Album>> GetArtistInfo(string foreignArtistId)
|
||||
public Tuple<Artist, List<Album>> GetArtistInfo(string foreignArtistId, List<string> primaryAlbumTypes, List<string> secondaryAlbumTypes)
|
||||
{
|
||||
|
||||
_logger.Debug("Getting Artist with LidarrAPI.MetadataID of {0}", foreignArtistId);
|
||||
@@ -46,10 +46,10 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
|
||||
var httpRequest = customerRequestBuilder.Create()
|
||||
.SetSegment("route", "artists/" + foreignArtistId)
|
||||
.AddQueryParam("primTypes", string.Join("|",primaryAlbumTypes))
|
||||
.AddQueryParam("secTypes", string.Join("|", secondaryAlbumTypes))
|
||||
.Build();
|
||||
|
||||
|
||||
|
||||
httpRequest.AllowAutoRedirect = true;
|
||||
httpRequest.SuppressHttpError = true;
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||
|
||||
try
|
||||
{
|
||||
return new List<Artist> { GetArtistInfo(slug).Item1 };
|
||||
return new List<Artist> { GetArtistInfo(slug, new List<string>{"Album"}, new List<string>{"Studio"}).Item1 };
|
||||
}
|
||||
catch (ArtistNotFoundException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user