浏览代码

Fix PlaybackInfo endpoint

crobibero 4 年之前
父节点
当前提交
df5d43132c
共有 2 个文件被更改,包括 19 次插入3 次删除
  1. 4 3
      Jellyfin.Api/Controllers/MediaInfoController.cs
  2. 15 0
      Jellyfin.Api/Models/VideoDtos/DeviceProfileDto.cs

+ 4 - 3
Jellyfin.Api/Controllers/MediaInfoController.cs

@@ -7,6 +7,7 @@ using System.Text.Json;
 using System.Threading;
 using System.Threading.Tasks;
 using Jellyfin.Api.Constants;
+using Jellyfin.Api.Models.VideoDtos;
 using Jellyfin.Data.Entities;
 using Jellyfin.Data.Enums;
 using MediaBrowser.Common.Net;
@@ -126,7 +127,7 @@ namespace Jellyfin.Api.Controllers
             [FromQuery] int? maxAudioChannels,
             [FromQuery] string? mediaSourceId,
             [FromQuery] string? liveStreamId,
-            [FromQuery] DeviceProfile? deviceProfile,
+            [FromBody] DeviceProfileDto? deviceProfile,
             [FromQuery] bool autoOpenLiveStream = false,
             [FromQuery] bool enableDirectPlay = true,
             [FromQuery] bool enableDirectStream = true,
@@ -136,7 +137,7 @@ namespace Jellyfin.Api.Controllers
         {
             var authInfo = _authContext.GetAuthorizationInfo(Request);
 
-            var profile = deviceProfile;
+            var profile = deviceProfile?.DeviceProfile;
 
             _logger.LogInformation("GetPostedPlaybackInfo profile: {@Profile}", profile);
 
@@ -190,7 +191,7 @@ namespace Jellyfin.Api.Controllers
                     var openStreamResult = await OpenMediaSource(new LiveStreamRequest
                     {
                         AudioStreamIndex = audioStreamIndex,
-                        DeviceProfile = deviceProfile,
+                        DeviceProfile = deviceProfile?.DeviceProfile,
                         EnableDirectPlay = enableDirectPlay,
                         EnableDirectStream = enableDirectStream,
                         ItemId = itemId,

+ 15 - 0
Jellyfin.Api/Models/VideoDtos/DeviceProfileDto.cs

@@ -0,0 +1,15 @@
+using MediaBrowser.Model.Dlna;
+
+namespace Jellyfin.Api.Models.VideoDtos
+{
+    /// <summary>
+    /// Device profile dto.
+    /// </summary>
+    public class DeviceProfileDto
+    {
+        /// <summary>
+        /// Gets or sets device profile.
+        /// </summary>
+        public DeviceProfile? DeviceProfile { get; set; }
+    }
+}