< Summary - Jellyfin

Information
Class: MediaBrowser.Providers.Plugins.ListenBrainz.Configuration.PluginConfiguration
Assembly: MediaBrowser.Providers
File(s): /srv/git/jellyfin/MediaBrowser.Providers/Plugins/ListenBrainz/Configuration/PluginConfiguration.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 65
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 5/16/2026 - 12:15:55 AM Line coverage: 0% (0/10) Branch coverage: 0% (0/6) Total lines: 65 5/16/2026 - 12:15:55 AM Line coverage: 0% (0/10) Branch coverage: 0% (0/6) Total lines: 65

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%210%
get_LabsServer()100%210%
set_LabsServer(...)0%620%
get_RateLimit()100%210%
set_RateLimit(...)0%2040%
get_AlgorithmString()100%210%

File(s)

/srv/git/jellyfin/MediaBrowser.Providers/Plugins/ListenBrainz/Configuration/PluginConfiguration.cs

#LineLine coverage
 1using MediaBrowser.Model.Plugins;
 2
 3namespace MediaBrowser.Providers.Plugins.ListenBrainz.Configuration;
 4
 5/// <summary>
 6/// ListenBrainz plugin configuration.
 7/// </summary>
 8public class PluginConfiguration : BasePluginConfiguration
 9{
 10    /// <summary>
 11    /// The default Labs API server URL.
 12    /// </summary>
 13    public const string DefaultLabsServer = "https://labs.api.listenbrainz.org";
 14
 15    /// <summary>
 16    /// The default rate limit in seconds.
 17    /// </summary>
 18    public const double DefaultRateLimit = 1.0;
 19
 020    private string _labsServer = DefaultLabsServer;
 021    private double _rateLimit = DefaultRateLimit;
 22
 23    /// <summary>
 24    /// Gets or sets the Labs API server URL.
 25    /// </summary>
 26    public string LabsServer
 27    {
 028        get => _labsServer;
 029        set => _labsServer = string.IsNullOrWhiteSpace(value) ? DefaultLabsServer : value.TrimEnd('/');
 30    }
 31
 32    /// <summary>
 33    /// Gets or sets the similarity algorithm.
 34    /// </summary>
 35    public SimilarityAlgorithm Algorithm { get; set; } = SimilarityAlgorithm.SessionBased1825Days;
 36
 37    /// <summary>
 38    /// Gets or sets the rate limit in seconds.
 39    /// </summary>
 40    public double RateLimit
 41    {
 042        get => _rateLimit;
 43        set
 44        {
 045            if (value < DefaultRateLimit && _labsServer == DefaultLabsServer)
 46            {
 047                _rateLimit = DefaultRateLimit;
 48            }
 49            else
 50            {
 051                _rateLimit = value;
 52            }
 053        }
 54    }
 55
 56    /// <summary>
 57    /// Gets or sets the cache duration in days for similar item results. A value of 0 disables caching.
 58    /// </summary>
 59    public int SimilarItemsCacheDays { get; set; } = 14;
 60
 61    /// <summary>
 62    /// Gets the algorithm string for the API call.
 63    /// </summary>
 064    public string AlgorithmString => Algorithm.ToApiString();
 65}