mirror of
https://github.com/Felitendo/jellyfin-plugin-lyrics.git
synced 2026-11-01 09:13:26 +01:00
91 lines
3.6 KiB
C#
91 lines
3.6 KiB
C#
using System.Diagnostics.CodeAnalysis;
|
|
using MediaBrowser.Model.Plugins;
|
|
|
|
namespace Jellyfin.Plugin.Lyrics.Configuration;
|
|
|
|
/// <summary>
|
|
/// Configuration for lyrics plugin.
|
|
/// </summary>
|
|
public class PluginConfiguration : BasePluginConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether to use strict search.
|
|
/// </summary>
|
|
public bool UseStrictSearch { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether to exclude artist name.
|
|
/// </summary>
|
|
public bool ExcludeArtistName { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether to exclude album name.
|
|
/// </summary>
|
|
public bool ExcludeAlbumName { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether to enable adaptive retry backoff.
|
|
/// </summary>
|
|
public bool EnableAdaptiveRetryBackoff { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether to enforce a per-run processing cap.
|
|
/// </summary>
|
|
public bool EnableRunCap { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the maximum number of tracks to process per run.
|
|
/// </summary>
|
|
public int MaxTracksPerRun { get; set; } = 2000;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the state entry retention in days.
|
|
/// </summary>
|
|
public int FailureStateTtlDays { get; set; } = 90;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the adaptive backoff schedule in days.
|
|
/// </summary>
|
|
[SuppressMessage("Performance", "CA1819:Properties should not return arrays", Justification = "Plugin configuration is persisted and exchanged via simple array values.")]
|
|
public int[] BackoffScheduleDays { get; set; } = [1, 3, 7, 30];
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether to filter LRCLIB matches by track duration.
|
|
/// </summary>
|
|
public bool EnableDurationFilter { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the duration tolerance in seconds for accepting an LRCLIB match.
|
|
/// Results whose duration differs from the local track by more than this value are rejected.
|
|
/// Ignored when <see cref="EnableDurationFilter"/> is false.
|
|
/// </summary>
|
|
public int DurationToleranceSeconds { get; set; } = 15;
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether the lyrics task deletes plain lyric files that keep Jellyfin from
|
|
/// showing synced lyrics. Jellyfin only uses the first lyric file it finds and checks the media folder before its
|
|
/// internal metadata folder, so a plain .txt next to the song hides a synced .lrc saved to the metadata folder.
|
|
/// </summary>
|
|
public bool RemovePlainLyricsHidingSynced { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// Gets or sets the base URL for the LRCLIB API.
|
|
/// Defaults to the public instance. Set to an absolute http(s) URL to use a self-hosted instance.
|
|
/// A trailing path is preserved (e.g. https://example.com/lrclib), so reverse-proxy subpaths work.
|
|
/// Empty, whitespace, or non-http(s) values are ignored and the default is used.
|
|
/// </summary>
|
|
public string LrclibBaseUrl { get; set; } = "https://lrclib.net";
|
|
|
|
/// <summary>
|
|
/// Gets or sets a value indicating whether the minimum gap between LRCLIB requests is removed.
|
|
/// Only honored when <see cref="LrclibBaseUrl"/> points at a self-hosted instance; requests to
|
|
/// the public lrclib.net stay rate limited regardless of this setting.
|
|
/// </summary>
|
|
public bool DisableRateLimit { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or sets the legacy state cursor value.
|
|
/// </summary>
|
|
public int StateCursor { get; set; }
|
|
}
|