Await Task from _libraryManager

This commit is contained in:
David 2020-06-16 16:08:31 +02:00
parent edc5611ec7
commit a952d15670

View File

@ -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();
}