aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/LibraryStructureController.cs
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2024-11-14 10:25:49 +0000
committerJPVenson <github@jpb.email>2024-11-14 10:25:49 +0000
commit93adddd7a997e84becdba098c3c0d767dadb6673 (patch)
tree2179f9d99d89965a655375c6288bd562cd3dc6ea /Jellyfin.Api/Controllers/LibraryStructureController.cs
parentaea255f91026598c297d11f032cc483b8608616d (diff)
reverted dbg code
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryStructureController.cs')
-rw-r--r--Jellyfin.Api/Controllers/LibraryStructureController.cs11
1 files changed, 3 insertions, 8 deletions
diff --git a/Jellyfin.Api/Controllers/LibraryStructureController.cs b/Jellyfin.Api/Controllers/LibraryStructureController.cs
index 7838c2f61..55000fc91 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
/// <param name="name">The name of the folder.</param>
/// <param name="refreshLibrary">Whether to refresh the library.</param>
/// <response code="204">Folder removed.</response>
+ /// <response code="404">Folder not found.</response>
/// <returns>A <see cref="NoContentResult"/>.</returns>
[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();