Browse Source

Merge pull request #6808 from cvium/dlnope_never_again

Cody Robibero 3 years ago
parent
commit
4c88bf3fe3

File diff suppressed because it is too large
+ 235 - 570
Emby.Dlna/ContentDirectory/ControlHandler.cs


+ 11 - 8
Emby.Dlna/ContentDirectory/ServerItem.cs

@@ -1,5 +1,3 @@
-#pragma warning disable CS1591
-
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Entities;
 
 
 namespace Emby.Dlna.ContentDirectory
 namespace Emby.Dlna.ContentDirectory
@@ -13,24 +11,29 @@ namespace Emby.Dlna.ContentDirectory
         /// Initializes a new instance of the <see cref="ServerItem"/> class.
         /// Initializes a new instance of the <see cref="ServerItem"/> class.
         /// </summary>
         /// </summary>
         /// <param name="item">The <see cref="BaseItem"/>.</param>
         /// <param name="item">The <see cref="BaseItem"/>.</param>
-        public ServerItem(BaseItem item)
+        /// <param name="stubType">The stub type.</param>
+        public ServerItem(BaseItem item, StubType? stubType)
         {
         {
             Item = item;
             Item = item;
 
 
-            if (item is IItemByName && item is not Folder)
+            if (stubType.HasValue)
+            {
+                StubType = stubType;
+            }
+            else if (item is IItemByName and not Folder)
             {
             {
                 StubType = Dlna.ContentDirectory.StubType.Folder;
                 StubType = Dlna.ContentDirectory.StubType.Folder;
             }
             }
         }
         }
 
 
         /// <summary>
         /// <summary>
-        /// Gets or sets the underlying base item.
+        /// Gets the underlying base item.
         /// </summary>
         /// </summary>
-        public BaseItem Item { get; set; }
+        public BaseItem Item { get; }
 
 
         /// <summary>
         /// <summary>
-        /// Gets or sets the DLNA item type.
+        /// Gets the DLNA item type.
         /// </summary>
         /// </summary>
-        public StubType? StubType { get; set; }
+        public StubType? StubType { get; }
     }
     }
 }
 }

+ 11 - 2
MediaBrowser.Model/Dlna/SortCriteria.cs

@@ -1,15 +1,24 @@
 #pragma warning disable CS1591
 #pragma warning disable CS1591
 
 
+using System;
 using Jellyfin.Data.Enums;
 using Jellyfin.Data.Enums;
 
 
 namespace MediaBrowser.Model.Dlna
 namespace MediaBrowser.Model.Dlna
 {
 {
     public class SortCriteria
     public class SortCriteria
     {
     {
-        public SortCriteria(string value)
+        public SortCriteria(string sortOrder)
         {
         {
+            if (!string.IsNullOrEmpty(sortOrder) && Enum.TryParse<SortOrder>(sortOrder, true, out var sortOrderValue))
+            {
+                SortOrder = sortOrderValue;
+            }
+            else
+            {
+                SortOrder = SortOrder.Ascending;
+            }
         }
         }
 
 
-        public SortOrder SortOrder => SortOrder.Ascending;
+        public SortOrder SortOrder { get; }
     }
     }
 }
 }

Some files were not shown because too many files changed in this diff