Browse Source

Await Task from _libraryManager

David 5 years ago
parent
commit
a952d15670
1 changed files with 5 additions and 4 deletions
  1. 5 4
      Jellyfin.Api/Controllers/LibraryStructureController.cs

+ 5 - 4
Jellyfin.Api/Controllers/LibraryStructureController.cs

@@ -1,3 +1,4 @@
+#nullable enable
 #pragma warning disable CA1801
 
 using System;
@@ -73,7 +74,7 @@ namespace Jellyfin.Api.Controllers
         /// <returns>A <see cref="NoContentResult"/>.</returns>
         [HttpPost]
         [ProducesResponseType(StatusCodes.Status204NoContent)]
-        public ActionResult AddVirtualFolder(
+        public async Task<ActionResult> AddVirtualFolder(
             [FromQuery] string name,
             [FromQuery] string collectionType,
             [FromQuery] bool refreshLibrary,
@@ -87,7 +88,7 @@ namespace Jellyfin.Api.Controllers
                 libraryOptions.PathInfos = paths.Select(i => new MediaPathInfo { Path = i }).ToArray();
             }
 
-            _libraryManager.AddVirtualFolder(name, collectionType, libraryOptions, refreshLibrary);
+            await _libraryManager.AddVirtualFolder(name, collectionType, libraryOptions, refreshLibrary).ConfigureAwait(false);
 
             return NoContent();
         }
@@ -101,11 +102,11 @@ namespace Jellyfin.Api.Controllers
         /// <returns>A <see cref="NoContentResult"/>.</returns>
         [HttpDelete]
         [ProducesResponseType(StatusCodes.Status204NoContent)]
-        public ActionResult RemoveVirtualFolder(
+        public async Task<ActionResult> RemoveVirtualFolder(
             [FromQuery] string name,
             [FromQuery] bool refreshLibrary)
         {
-            _libraryManager.RemoveVirtualFolder(name, refreshLibrary);
+            await _libraryManager.RemoveVirtualFolder(name, refreshLibrary).ConfigureAwait(false);
             return NoContent();
         }