Quellcode durchsuchen

Fix DeviceProfile.Id should be nullable (#12679)

Niels van Velzen vor 8 Monaten
Ursprung
Commit
bcc818f397

+ 1 - 1
MediaBrowser.Model/Dlna/DeviceProfile.cs

@@ -22,7 +22,7 @@ public class DeviceProfile
     /// <summary>
     /// Gets or sets the unique internal identifier.
     /// </summary>
-    public Guid Id { get; set; }
+    public Guid? Id { get; set; }
 
     /// <summary>
     /// Gets or sets the maximum allowed bitrate for all streamed content.

+ 2 - 2
MediaBrowser.Model/Dlna/StreamBuilder.cs

@@ -65,7 +65,7 @@ namespace MediaBrowser.Model.Dlna
                 if (streamInfo is not null)
                 {
                     streamInfo.DeviceId = options.DeviceId;
-                    streamInfo.DeviceProfileId = options.Profile.Id.ToString("N", CultureInfo.InvariantCulture);
+                    streamInfo.DeviceProfileId = options.Profile.Id?.ToString("N", CultureInfo.InvariantCulture);
                     streams.Add(streamInfo);
                 }
             }
@@ -240,7 +240,7 @@ namespace MediaBrowser.Model.Dlna
             foreach (var stream in streams)
             {
                 stream.DeviceId = options.DeviceId;
-                stream.DeviceProfileId = options.Profile.Id.ToString("N", CultureInfo.InvariantCulture);
+                stream.DeviceProfileId = options.Profile.Id?.ToString("N", CultureInfo.InvariantCulture);
             }
 
             return GetOptimalStream(streams, options.GetMaxBitrate(false) ?? 0);