Merge pull request #1077 from Bond-009/musicbrainz

Make MusicBrainz base url configurable
This commit is contained in:
Joshua M. Boniface 2019-03-09 23:19:32 -05:00 committed by GitHub
commit fb96763f65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -6,7 +6,8 @@ namespace Emby.Server.Implementations
{
public static readonly Dictionary<string, string> Configuration = new Dictionary<string, string>
{
{"HttpListenerHost:DefaultRedirectPath", "web/index.html"}
{"HttpListenerHost:DefaultRedirectPath", "web/index.html"},
{"MusicBrainz:BaseUrl", "https://www.musicbrainz.org"}
};
}
}

View File

@ -11,6 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
<PackageReference Include="OptimizedPriorityQueue" Version="4.2.0" />
<PackageReference Include="PlaylistsNET" Version="1.0.2" />

View File

@ -16,6 +16,7 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Xml;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Providers.Music
@ -30,15 +31,22 @@ namespace MediaBrowser.Providers.Music
private readonly IJsonSerializer _json;
private readonly IXmlReaderSettingsFactory _xmlSettings;
public static string MusicBrainzBaseUrl = "https://www.musicbrainz.org";
public readonly string MusicBrainzBaseUrl;
public MusicBrainzAlbumProvider(IHttpClient httpClient, IApplicationHost appHost, ILogger logger, IJsonSerializer json, IXmlReaderSettingsFactory xmlSettings)
public MusicBrainzAlbumProvider(
IHttpClient httpClient,
IApplicationHost appHost,
ILogger logger,
IJsonSerializer json,
IXmlReaderSettingsFactory xmlSettings,
IConfiguration configuration)
{
_httpClient = httpClient;
_appHost = appHost;
_logger = logger;
_json = json;
_xmlSettings = xmlSettings;
MusicBrainzBaseUrl = configuration["MusicBrainz:BaseUrl"];
Current = this;
}