Fix DeviceProfile.Id should be nullable (#12679)

This commit is contained in:
Niels van Velzen 2024-09-22 16:58:23 +02:00 committed by GitHub
parent b162e9290b
commit bcc818f397
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -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.

View file

@ -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);