jellyfin/MediaBrowser.Providers/Plugins/MusicBrainz/Configuration/PluginConfiguration.cs

53 lines
1.2 KiB
C#
Raw Normal View History

using MediaBrowser.Model.Plugins;
using MetaBrainz.MusicBrainz;
namespace MediaBrowser.Providers.Plugins.MusicBrainz.Configuration;
2020-02-22 07:04:52 +01:00
/// <summary>
/// MusicBrainz plugin configuration.
/// </summary>
public class PluginConfiguration : BasePluginConfiguration
2020-02-22 07:04:52 +01:00
{
2023-02-18 21:22:45 +01:00
private const string DefaultServer = "https://musicbrainz.org";
private const double DefaultRateLimit = 1.0;
2020-02-22 07:04:52 +01:00
private string _server = DefaultServer;
private double _rateLimit = DefaultRateLimit;
/// <summary>
/// Gets or sets the server url.
/// </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('/');
}
2020-02-27 17:43:57 +01:00
/// <summary>
/// Gets or sets the rate limit.
/// </summary>
public double RateLimit
{
get => _rateLimit;
set
2020-02-27 17:43:57 +01:00
{
if (value < DefaultRateLimit && _server == DefaultServer)
2020-02-27 17:43:57 +01:00
{
_rateLimit = DefaultRateLimit;
}
else
{
_rateLimit = value;
2020-02-27 17:43:57 +01:00
}
}
2020-02-22 07:04:52 +01: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
}