瀏覽代碼

Provide delivery URLs for attachments in PlaybackInfo.

Andrew Mahone 5 年之前
父節點
當前提交
01b1c847e9
共有 2 個文件被更改,包括 14 次插入0 次删除
  1. 8 0
      MediaBrowser.Api/Playback/MediaInfoService.cs
  2. 6 0
      MediaBrowser.Model/Entities/MediaAttachment.cs

+ 8 - 0
MediaBrowser.Api/Playback/MediaInfoService.cs

@@ -524,6 +524,14 @@ namespace MediaBrowser.Api.Playback
                     SetDeviceSpecificSubtitleInfo(streamInfo, mediaSource, auth.Token);
                 }
             }
+
+            foreach (var attachment in mediaSource.MediaAttachments)
+            {
+                attachment.DeliveryUrl = string.Format("/Videos/{0}/{1}/Attachments/{2}/Attachment",
+                    item.Id,
+                    mediaSource.Id,
+                    attachment.Index);
+            }
         }
 
         private long? GetMaxBitrate(long? clientMaxBitrate, User user)

+ 6 - 0
MediaBrowser.Model/Entities/MediaAttachment.cs

@@ -40,5 +40,11 @@ namespace MediaBrowser.Model.Entities
         /// </summary>
         /// <value>The MIME type.</value>
         public string MIMEType { get; set; }
+
+        /// <summary>
+        /// Gets or sets the delivery URL.
+        /// </summary>
+        /// <value>The delivery URL.</value>
+        public string DeliveryUrl { get; set; }
     }
 }