diff options
| author | PloughPuff <ploughpuff@protonmail.com> | 2019-03-14 21:32:27 +0000 |
|---|---|---|
| committer | PloughPuff <ploughpuff@protonmail.com> | 2019-03-14 21:34:09 +0000 |
| commit | d125fbc43d453be7de08375dede1748d4c19a8cf (patch) | |
| tree | 5a1bb9835dff333c3029eca84ee99ec6346ac9f6 | |
| parent | f8bb7a7ff4d87d19a43f97fed557aa92a657a50f (diff) | |
Added contact email to user agent
MusicBrainz request a contact email address is supplied in comment section of user agent field.
| -rw-r--r-- | Emby.Server.Implementations/ApplicationHost.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Common/IApplicationHost.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 94eaffa47..eaea8844d 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -428,6 +428,12 @@ namespace Emby.Server.Implementations /// <value>The application user agent.</value> public string ApplicationUserAgent => Name.Replace(' ','-') + "/" + ApplicationVersion; + /// <summary> + /// Gets the email address for use within a comment section of a user agent field. + /// Presently used to provide contact information to MusicBrainz service. + /// </summary> + public string ApplicationUserAgentAddress { get; } = "team@jellyfin.org"; + private string _productName; /// <summary> diff --git a/MediaBrowser.Common/IApplicationHost.cs b/MediaBrowser.Common/IApplicationHost.cs index 966448d63..2925a3efd 100644 --- a/MediaBrowser.Common/IApplicationHost.cs +++ b/MediaBrowser.Common/IApplicationHost.cs @@ -72,6 +72,12 @@ namespace MediaBrowser.Common string ApplicationUserAgent { get; } /// <summary> + /// Gets the email address for use within a comment section of a user agent field. + /// Presently used to provide contact information to MusicBrainz service. + /// </summary> + string ApplicationUserAgentAddress { get; } + + /// <summary> /// Gets the exports. /// </summary> /// <typeparam name="T"></typeparam> diff --git a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs index a1366e0fd..b716f40f0 100644 --- a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs +++ b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Globalization; using System.IO; using System.Linq; using System.Net; @@ -735,7 +734,9 @@ namespace MediaBrowser.Providers.Music { Url = MusicBrainzBaseUrl.TrimEnd('/') + url, CancellationToken = cancellationToken, - UserAgent = _appHost.ApplicationUserAgent, + // MusicBrainz request a contact email address is supplied, as comment, in user agent field: + // https://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting#User-Agent + UserAgent = string.Format("{0} ( {1} )", _appHost.ApplicationUserAgent, _appHost.ApplicationUserAgentAddress), BufferContent = false }; |
