mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
fix musicbrainx user agent
This commit is contained in:
parent
40b8300e8e
commit
e920713308
@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Entities.Audio;
|
||||
@ -20,11 +21,13 @@ namespace MediaBrowser.Providers.Music
|
||||
internal static MusicBrainzAlbumProvider Current;
|
||||
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IApplicationHost _appHost;
|
||||
|
||||
public MusicBrainzAlbumProvider(ILogManager logManager, IServerConfigurationManager configurationManager, IHttpClient httpClient)
|
||||
public MusicBrainzAlbumProvider(ILogManager logManager, IServerConfigurationManager configurationManager, IHttpClient httpClient, IApplicationHost appHost)
|
||||
: base(logManager, configurationManager)
|
||||
{
|
||||
_httpClient = httpClient;
|
||||
_appHost = appHost;
|
||||
|
||||
Current = this;
|
||||
}
|
||||
@ -189,11 +192,13 @@ namespace MediaBrowser.Providers.Music
|
||||
|
||||
var doc = new XmlDocument();
|
||||
|
||||
var userAgent = _appHost.Name + "/" + _appHost.ApplicationVersion;
|
||||
|
||||
using (var xml = await _httpClient.Get(new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
CancellationToken = cancellationToken,
|
||||
UserAgent = Environment.MachineName
|
||||
UserAgent = userAgent
|
||||
|
||||
}).ConfigureAwait(false))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user