浏览代码

fixes #575 - Enforce playable media types

Luke Pulverenti 11 年之前
父节点
当前提交
d957c0da04
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      MediaBrowser.Server.Implementations/Session/SessionManager.cs

+ 8 - 1
MediaBrowser.Server.Implementations/Session/SessionManager.cs

@@ -616,7 +616,14 @@ namespace MediaBrowser.Server.Implementations.Session
             {
                 if (items.Any(i => !session.QueueableMediaTypes.Contains(i.MediaType, StringComparer.OrdinalIgnoreCase)))
                 {
-                    throw new ArgumentException(string.Format("Session {0} is unable to queue the requested media type.", session.Id));
+                    throw new ArgumentException(string.Format("{0} is unable to queue the requested media type.", session.DeviceName ?? session.Id.ToString()));
+                }
+            }
+            else
+            {
+                if (items.Any(i => !session.PlayableMediaTypes.Contains(i.MediaType, StringComparer.OrdinalIgnoreCase)))
+                {
+                    throw new ArgumentException(string.Format("{0} is unable to play the requested media type.", session.DeviceName ?? session.Id.ToString()));
                 }
             }