Skip to content

Commit

Permalink
Add missing lyric fetcher settings from library options
Browse files Browse the repository at this point in the history
  • Loading branch information
crobibero committed Aug 5, 2024
1 parent 82ad4b9 commit 0bf7bab
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Jellyfin.Api/Controllers/LibraryController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,16 @@ public ActionResult<LibraryOptionsResultDto> GetLibraryOptionsInfo(
.DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.ToArray();

result.LyricFetchers = plugins
.SelectMany(i => i.Plugins.Where(p => p.Type == MetadataPluginType.LyricFetcher))
.Select(i => new LibraryOptionInfoDto
{
Name = i.Name,
DefaultEnabled = true
})
.DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
.ToArray();

var typeOptions = new List<LibraryTypeOptionsDto>();

foreach (var type in types)
Expand Down
5 changes: 5 additions & 0 deletions Jellyfin.Api/Models/LibraryDtos/LibraryOptionsResultDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public class LibraryOptionsResultDto
/// </summary>
public IReadOnlyList<LibraryOptionInfoDto> SubtitleFetchers { get; set; } = Array.Empty<LibraryOptionInfoDto>();

/// <summary>
/// Gets or sets the list of lyric fetchers.
/// </summary>
public IReadOnlyList<LibraryOptionInfoDto> LyricFetchers { get; set; } = Array.Empty<LibraryOptionInfoDto>();

/// <summary>
/// Gets or sets the type options.
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions MediaBrowser.Model/Configuration/LibraryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public LibraryOptions()
DisabledSubtitleFetchers = Array.Empty<string>();
SubtitleFetcherOrder = Array.Empty<string>();
DisabledLocalMetadataReaders = Array.Empty<string>();
DisabledLyricFetchers = Array.Empty<string>();
LyricFetcherOrder = Array.Empty<string>();

SkipSubtitlesIfAudioTrackMatches = true;
RequirePerfectSubtitleMatch = true;
Expand Down Expand Up @@ -97,6 +99,10 @@ public LibraryOptions()
[DefaultValue(false)]
public bool SaveLyricsWithMedia { get; set; }

public string[] DisabledLyricFetchers { get; set; }

public string[] LyricFetcherOrder { get; set; }

public bool AutomaticallyAddToCollection { get; set; }

public EmbeddedSubtitleOptions AllowEmbeddedSubtitles { get; set; }
Expand Down

0 comments on commit 0bf7bab

Please sign in to comment.