Added contact email to user agent

MusicBrainz request a contact email address is supplied in comment section of user agent field.
This commit is contained in:
PloughPuff 2019-03-14 21:32:27 +00:00
parent f8bb7a7ff4
commit d125fbc43d
3 changed files with 15 additions and 2 deletions

View File

@ -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>

View File

@ -71,6 +71,12 @@ namespace MediaBrowser.Common
/// <value>The application user agent.</value>
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>

View File

@ -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
};