From 0bc41c015f4ec907de75fe215589b7e30a819b54 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Mon, 26 Feb 2024 05:09:40 -0700 Subject: Store lyrics in the database as media streams (#9951) --- Jellyfin.Api/Controllers/UserLibraryController.cs | 45 +---------------------- 1 file changed, 1 insertion(+), 44 deletions(-) (limited to 'Jellyfin.Api/Controllers/UserLibraryController.cs') diff --git a/Jellyfin.Api/Controllers/UserLibraryController.cs b/Jellyfin.Api/Controllers/UserLibraryController.cs index 264e0a3db..e3bfd4ea9 100644 --- a/Jellyfin.Api/Controllers/UserLibraryController.cs +++ b/Jellyfin.Api/Controllers/UserLibraryController.cs @@ -18,6 +18,7 @@ using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using MediaBrowser.Model.IO; +using MediaBrowser.Model.Lyrics; using MediaBrowser.Model.Querying; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -539,48 +540,4 @@ public class UserLibraryController : BaseJellyfinApiController return _userDataRepository.GetUserDataDto(item, user); } - - /// - /// Gets an item's lyrics. - /// - /// User id. - /// Item id. - /// Lyrics returned. - /// Something went wrong. No Lyrics will be returned. - /// An containing the item's lyrics. - [HttpGet("Users/{userId}/Items/{itemId}/Lyrics")] - [ProducesResponseType(StatusCodes.Status200OK)] - public async Task> GetLyrics([FromRoute, Required] Guid userId, [FromRoute, Required] Guid itemId) - { - var user = _userManager.GetUserById(userId); - - if (user is null) - { - return NotFound(); - } - - var item = itemId.IsEmpty() - ? _libraryManager.GetUserRootFolder() - : _libraryManager.GetItemById(itemId); - - if (item is null) - { - return NotFound(); - } - - if (item is not UserRootFolder - // Check the item is visible for the user - && !item.IsVisible(user)) - { - return Unauthorized($"{user.Username} is not permitted to access item {item.Name}."); - } - - var result = await _lyricManager.GetLyrics(item).ConfigureAwait(false); - if (result is not null) - { - return Ok(result); - } - - return NotFound(); - } } -- cgit v1.2.3