From 93adddd7a997e84becdba098c3c0d767dadb6673 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Thu, 14 Nov 2024 10:25:49 +0000 Subject: [PATCH] reverted dbg code --- .../Controllers/LibraryStructureController.cs | 11 +++-------- .../Controllers/LibraryStructureControllerTests.cs | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Jellyfin.Api/Controllers/LibraryStructureController.cs b/Jellyfin.Api/Controllers/LibraryStructureController.cs index 7838c2f61c..55000fc91e 100644 --- a/Jellyfin.Api/Controllers/LibraryStructureController.cs +++ b/Jellyfin.Api/Controllers/LibraryStructureController.cs @@ -88,14 +88,7 @@ public class LibraryStructureController : BaseJellyfinApiController libraryOptions.PathInfos = Array.ConvertAll(paths, i => new MediaPathInfo(i)); } - try - { - await _libraryManager.AddVirtualFolder(name, collectionType, libraryOptions, refreshLibrary).ConfigureAwait(false); - } - catch (System.Exception ex) - { - return BadRequest(ex.ToString()); - } + await _libraryManager.AddVirtualFolder(name, collectionType, libraryOptions, refreshLibrary).ConfigureAwait(false); return NoContent(); } @@ -106,6 +99,7 @@ public class LibraryStructureController : BaseJellyfinApiController /// The name of the folder. /// Whether to refresh the library. /// Folder removed. + /// Folder not found. /// A . [HttpDelete] [ProducesResponseType(StatusCodes.Status204NoContent)] @@ -113,6 +107,7 @@ public class LibraryStructureController : BaseJellyfinApiController [FromQuery] string name, [FromQuery] bool refreshLibrary = false) { + // TODO: refactor! this relies on an FileNotFound exception to return NotFound when attempting to remove a library that does not exist. await _libraryManager.RemoveVirtualFolder(name, refreshLibrary).ConfigureAwait(false); return NoContent(); diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryStructureControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryStructureControllerTests.cs index 6b749f0a89..0376f57cc1 100644 --- a/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryStructureControllerTests.cs +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/LibraryStructureControllerTests.cs @@ -77,7 +77,7 @@ public sealed class LibraryStructureControllerTests : IClassFixture