diff options
| author | 1hitsong <3330318+1hitsong@users.noreply.github.com> | 2022-09-15 20:49:25 -0400 |
|---|---|---|
| committer | 1hitsong <3330318+1hitsong@users.noreply.github.com> | 2022-09-15 20:49:25 -0400 |
| commit | f4fd908f8d7ffcdea6acaf75928f6c2960ed6338 (patch) | |
| tree | 25d932b8f5734491380b5305ae2f7810e3c5a165 /Jellyfin.Api/Controllers/UserLibraryController.cs | |
| parent | d9be3874ba3842d5888c5cbbe583614ed990849e (diff) | |
Create ILyricManager
Diffstat (limited to 'Jellyfin.Api/Controllers/UserLibraryController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/UserLibraryController.cs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs index 3da78c116..1421ab444 100644 --- a/Jellyfin.Api/Controllers/UserLibraryController.cs +++ b/Jellyfin.Api/Controllers/UserLibraryController.cs @@ -38,7 +38,7 @@ namespace Jellyfin.Api.Controllers private readonly IDtoService _dtoService; private readonly IUserViewManager _userViewManager; private readonly IFileSystem _fileSystem; - private readonly IEnumerable<ILyricsProvider> _lyricProviders; + private readonly ILyricManager _lyricManager; /// <summary> /// Initializes a new instance of the <see cref="UserLibraryController"/> class. @@ -49,7 +49,7 @@ namespace Jellyfin.Api.Controllers /// <param name="dtoService">Instance of the <see cref="IDtoService"/> interface.</param> /// <param name="userViewManager">Instance of the <see cref="IUserViewManager"/> interface.</param> /// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param> - /// <param name="lyricProviders">Collection of all registered <see cref="ILyricsProvider"/> interfaces.</param> + /// <param name="lyricManager">Instance of the <see cref="ILyricManager"/> interface.</param> public UserLibraryController( IUserManager userManager, IUserDataManager userDataRepository, @@ -57,7 +57,7 @@ namespace Jellyfin.Api.Controllers IDtoService dtoService, IUserViewManager userViewManager, IFileSystem fileSystem, - IEnumerable<ILyricsProvider> lyricProviders) + ILyricManager lyricManager) { _userManager = userManager; _userDataRepository = userDataRepository; @@ -65,7 +65,7 @@ namespace Jellyfin.Api.Controllers _dtoService = dtoService; _userViewManager = userViewManager; _fileSystem = fileSystem; - _lyricProviders = lyricProviders; + _lyricManager = lyricManager; } /// <summary> @@ -415,14 +415,10 @@ namespace Jellyfin.Api.Controllers return NotFound(); } - var result = MediaBrowser.Controller.Lyrics.LyricInfo.GetLyricData(_lyricProviders, item); + var result = _lyricManager.GetLyric(item); if (result is not null) { - provider.Process(item); - if (provider.HasData) - { - return Ok(provider.Data); - } + return Ok(result); } return NotFound(); |
