mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-27 22:56:45 -04:00
Fixed: Lidarr Lists use correct metadata server (#800)
This commit is contained in:
@@ -4,6 +4,7 @@ using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.ThingiProvider;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
{
|
||||
@@ -13,10 +14,12 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
|
||||
public override int PageSize => 10;
|
||||
|
||||
public LidarrLists(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||
private readonly IMetadataRequestBuilder _requestBuilder;
|
||||
|
||||
public LidarrLists(IHttpClient httpClient, IImportListStatusService importListStatusService, IConfigService configService, IParsingService parsingService, IMetadataRequestBuilder requestBuilder, Logger logger)
|
||||
: base(httpClient, importListStatusService, configService, parsingService, logger)
|
||||
{
|
||||
|
||||
_requestBuilder = requestBuilder;
|
||||
}
|
||||
|
||||
public override IEnumerable<ProviderDefinition> DefaultDefinitions
|
||||
@@ -29,7 +32,6 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
yield return GetDefinition("Apple Music New Albums", GetSettings("apple-music/album/new"));
|
||||
yield return GetDefinition("Billboard Top Albums", GetSettings("billboard/album/top"));
|
||||
yield return GetDefinition("Billboard Top Artists", GetSettings("billboard/artist/top"));
|
||||
yield return GetDefinition("Last.fm Top Albums", GetSettings("lastfm/album/top"));
|
||||
yield return GetDefinition("Last.fm Top Artists", GetSettings("lastfm/artist/top"));
|
||||
}
|
||||
}
|
||||
@@ -54,7 +56,7 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
|
||||
public override IImportListRequestGenerator GetRequestGenerator()
|
||||
{
|
||||
return new LidarrListsRequestGenerator { Settings = Settings, PageSize = PageSize };
|
||||
return new LidarrListsRequestGenerator(_requestBuilder) { Settings = Settings };
|
||||
}
|
||||
|
||||
public override IParseImportListResponse GetParser()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.MetadataSource;
|
||||
|
||||
namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
{
|
||||
@@ -7,13 +7,11 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
{
|
||||
public LidarrListsSettings Settings { get; set; }
|
||||
|
||||
public int MaxPages { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
private readonly IMetadataRequestBuilder _requestBulder;
|
||||
|
||||
public LidarrListsRequestGenerator()
|
||||
public LidarrListsRequestGenerator(IMetadataRequestBuilder requestBuilder)
|
||||
{
|
||||
MaxPages = 1;
|
||||
PageSize = 10;
|
||||
_requestBulder = requestBuilder;
|
||||
}
|
||||
|
||||
public virtual ImportListPageableRequestChain GetListItems()
|
||||
@@ -27,8 +25,12 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
|
||||
private IEnumerable<ImportListRequest> GetPagedRequests()
|
||||
{
|
||||
yield return new ImportListRequest(string.Format("{0}{1}", Settings.BaseUrl, Settings.ListId), HttpAccept.Json);
|
||||
}
|
||||
var request = _requestBulder.GetRequestBuilder()
|
||||
.Create()
|
||||
.SetSegment("route", "chart/" + Settings.ListId)
|
||||
.Build();
|
||||
|
||||
yield return new ImportListRequest(request);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
{
|
||||
public LidarrListsSettingsValidator()
|
||||
{
|
||||
RuleFor(c => c.BaseUrl).ValidRootUrl();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +17,7 @@ namespace NzbDrone.Core.ImportLists.LidarrLists
|
||||
|
||||
public LidarrListsSettings()
|
||||
{
|
||||
BaseUrl = "https://api.lidarr.audio/api/v0.3/chart/";
|
||||
BaseUrl = "";
|
||||
}
|
||||
|
||||
public string BaseUrl { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user