From 22d8528d904e69a8e22ba0e6d43dcb58a54bdcf5 Mon Sep 17 00:00:00 2001 From: gnattu Date: Mon, 5 Aug 2024 10:58:22 -0400 Subject: Backport pull request #11901 from jellyfin/release-10.9.z Implement Device Cache to replace EFCoreSecondLevelCacheInterceptor Original-merge: b7bc0e1c96553675a490c0bd92a58ad9c5f0d0e1 Merged-by: joshuaboniface Backported-by: Bond_009 --- Jellyfin.Api/Controllers/DevicesController.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'Jellyfin.Api/Controllers/DevicesController.cs') diff --git a/Jellyfin.Api/Controllers/DevicesController.cs b/Jellyfin.Api/Controllers/DevicesController.cs index 6d9ec343e..2a2ab4ad1 100644 --- a/Jellyfin.Api/Controllers/DevicesController.cs +++ b/Jellyfin.Api/Controllers/DevicesController.cs @@ -47,10 +47,10 @@ public class DevicesController : BaseJellyfinApiController /// An containing the list of devices. [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] - public async Task>> GetDevices([FromQuery] Guid? userId) + public ActionResult> GetDevices([FromQuery] Guid? userId) { userId = RequestHelpers.GetUserId(User, userId); - return await _deviceManager.GetDevicesForUser(userId).ConfigureAwait(false); + return _deviceManager.GetDevicesForUser(userId); } /// @@ -63,9 +63,9 @@ public class DevicesController : BaseJellyfinApiController [HttpGet("Info")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> GetDeviceInfo([FromQuery, Required] string id) + public ActionResult GetDeviceInfo([FromQuery, Required] string id) { - var deviceInfo = await _deviceManager.GetDevice(id).ConfigureAwait(false); + var deviceInfo = _deviceManager.GetDevice(id); if (deviceInfo is null) { return NotFound(); @@ -84,9 +84,9 @@ public class DevicesController : BaseJellyfinApiController [HttpGet("Options")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] - public async Task> GetDeviceOptions([FromQuery, Required] string id) + public ActionResult GetDeviceOptions([FromQuery, Required] string id) { - var deviceInfo = await _deviceManager.GetDeviceOptions(id).ConfigureAwait(false); + var deviceInfo = _deviceManager.GetDeviceOptions(id); if (deviceInfo is null) { return NotFound(); @@ -124,13 +124,13 @@ public class DevicesController : BaseJellyfinApiController [ProducesResponseType(StatusCodes.Status404NotFound)] public async Task DeleteDevice([FromQuery, Required] string id) { - var existingDevice = await _deviceManager.GetDevice(id).ConfigureAwait(false); + var existingDevice = _deviceManager.GetDevice(id); if (existingDevice is null) { return NotFound(); } - var sessions = await _deviceManager.GetDevices(new DeviceQuery { DeviceId = id }).ConfigureAwait(false); + var sessions = _deviceManager.GetDevices(new DeviceQuery { DeviceId = id }); foreach (var session in sessions.Items) { -- cgit v1.2.3