using MediaBrowser.Model.Plugins; using MetaBrainz.MusicBrainz; namespace MediaBrowser.Providers.Plugins.MusicBrainz.Configuration; /// /// MusicBrainz plugin configuration. /// public class PluginConfiguration : BasePluginConfiguration { private const string DefaultServer = "musicbrainz.org"; private const double DefaultRateLimit = 1.0; private string _server = DefaultServer; private double _rateLimit = DefaultRateLimit; /// /// Gets or sets the server url. /// public string Server { get => _server; set { _server = value.TrimEnd('/'); Query.DefaultServer = _server; } } /// /// Gets or sets the rate limit. /// public double RateLimit { get => _rateLimit; set { if (value < DefaultRateLimit && _server == DefaultServer) { _rateLimit = DefaultRateLimit; } else { _rateLimit = value; } Query.DelayBetweenRequests = _rateLimit; } } /// /// Gets or sets a value indicating whether to replace the artist name. /// public bool ReplaceArtistName { get; set; } }