2020-06-19 20:24:13 +02:00
|
|
|
using MediaBrowser.Model.Plugins;
|
2022-04-07 12:15:25 +02:00
|
|
|
|
|
|
|
namespace MediaBrowser.Providers.Plugins.MusicBrainz.Configuration;
|
2020-02-22 07:04:52 +01:00
|
|
|
|
2022-04-07 12:15:25 +02:00
|
|
|
/// <summary>
|
|
|
|
/// MusicBrainz plugin configuration.
|
|
|
|
/// </summary>
|
|
|
|
public class PluginConfiguration : BasePluginConfiguration
|
2020-02-22 07:04:52 +01:00
|
|
|
{
|
2023-02-20 16:04:30 +01:00
|
|
|
/// <summary>
|
|
|
|
/// The default server URL.
|
|
|
|
/// </summary>
|
|
|
|
public const string DefaultServer = "https://musicbrainz.org";
|
2022-04-07 12:15:25 +02:00
|
|
|
|
2023-02-20 16:04:30 +01:00
|
|
|
/// <summary>
|
|
|
|
/// The default rate limit.
|
|
|
|
/// </summary>
|
|
|
|
public const double DefaultRateLimit = 1.0;
|
2020-02-22 07:04:52 +01:00
|
|
|
|
2022-04-07 12:15:25 +02:00
|
|
|
private string _server = DefaultServer;
|
|
|
|
|
|
|
|
private double _rateLimit = DefaultRateLimit;
|
|
|
|
|
|
|
|
/// <summary>
|
2023-02-20 16:04:30 +01:00
|
|
|
/// Gets or sets the server URL.
|
2022-04-07 12:15:25 +02:00
|
|
|
/// </summary>
|
|
|
|
public string Server
|
|
|
|
{
|
|
|
|
get => _server;
|
2020-02-27 17:43:57 +01:00
|
|
|
|
2022-04-27 13:44:49 +02:00
|
|
|
set => _server = value.TrimEnd('/');
|
2022-04-07 12:15:25 +02:00
|
|
|
}
|
2020-02-27 17:43:57 +01:00
|
|
|
|
2022-04-07 12:15:25 +02:00
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the rate limit.
|
|
|
|
/// </summary>
|
|
|
|
public double RateLimit
|
|
|
|
{
|
|
|
|
get => _rateLimit;
|
|
|
|
set
|
2020-02-27 17:43:57 +01:00
|
|
|
{
|
2022-04-07 12:15:25 +02:00
|
|
|
if (value < DefaultRateLimit && _server == DefaultServer)
|
2020-02-27 17:43:57 +01:00
|
|
|
{
|
2022-04-07 12:15:25 +02:00
|
|
|
_rateLimit = DefaultRateLimit;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_rateLimit = value;
|
2020-02-27 17:43:57 +01:00
|
|
|
}
|
2022-04-07 12:15:25 +02:00
|
|
|
}
|
2020-02-22 07:04:52 +01:00
|
|
|
}
|
2022-04-07 12:15:25 +02:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets a value indicating whether to replace the artist name.
|
|
|
|
/// </summary>
|
|
|
|
public bool ReplaceArtistName { get; set; }
|
2020-02-22 07:04:52 +01:00
|
|
|
}
|