| | 1 | | using MediaBrowser.Model.Plugins; |
| | 2 | |
|
| | 3 | | namespace MediaBrowser.Providers.Plugins.MusicBrainz.Configuration; |
| | 4 | |
|
| | 5 | | /// <summary> |
| | 6 | | /// MusicBrainz plugin configuration. |
| | 7 | | /// </summary> |
| | 8 | | public class PluginConfiguration : BasePluginConfiguration |
| | 9 | | { |
| | 10 | | /// <summary> |
| | 11 | | /// The default server URL. |
| | 12 | | /// </summary> |
| | 13 | | public const string DefaultServer = "https://musicbrainz.org"; |
| | 14 | |
|
| | 15 | | /// <summary> |
| | 16 | | /// The default rate limit. |
| | 17 | | /// </summary> |
| | 18 | | public const double DefaultRateLimit = 1.0; |
| | 19 | |
|
| 21 | 20 | | private string _server = DefaultServer; |
| | 21 | |
|
| 21 | 22 | | private double _rateLimit = DefaultRateLimit; |
| | 23 | |
|
| | 24 | | /// <summary> |
| | 25 | | /// Gets or sets the server URL. |
| | 26 | | /// </summary> |
| | 27 | | public string Server |
| | 28 | | { |
| 84 | 29 | | get => _server; |
| | 30 | |
|
| 0 | 31 | | set => _server = value.TrimEnd('/'); |
| | 32 | | } |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Gets or sets the rate limit. |
| | 36 | | /// </summary> |
| | 37 | | public double RateLimit |
| | 38 | | { |
| 84 | 39 | | get => _rateLimit; |
| | 40 | | set |
| | 41 | | { |
| 0 | 42 | | if (value < DefaultRateLimit && _server == DefaultServer) |
| | 43 | | { |
| 0 | 44 | | _rateLimit = DefaultRateLimit; |
| | 45 | | } |
| | 46 | | else |
| | 47 | | { |
| 0 | 48 | | _rateLimit = value; |
| | 49 | | } |
| 0 | 50 | | } |
| | 51 | | } |
| | 52 | |
|
| | 53 | | /// <summary> |
| | 54 | | /// Gets or sets a value indicating whether to replace the artist name. |
| | 55 | | /// </summary> |
| | 56 | | public bool ReplaceArtistName { get; set; } |
| | 57 | | } |