Error on SA1316

pull/7121/head
Bond_009 2 years ago
parent c6a1dcf420
commit 77c615ba42

@ -989,7 +989,7 @@ namespace Emby.Dlna.Didl
writer.WriteAttributeString("dlna", "profileID", NsDlna, _profile.AlbumArtPn); writer.WriteAttributeString("dlna", "profileID", NsDlna, _profile.AlbumArtPn);
} }
writer.WriteString(albumArtUrlInfo.url); writer.WriteString(albumArtUrlInfo.Url);
writer.WriteFullEndElement(); writer.WriteFullEndElement();
// TODO: Remove these default values // TODO: Remove these default values
@ -998,7 +998,7 @@ namespace Emby.Dlna.Didl
_profile.MaxIconWidth ?? 48, _profile.MaxIconWidth ?? 48,
_profile.MaxIconHeight ?? 48, _profile.MaxIconHeight ?? 48,
"jpg"); "jpg");
writer.WriteElementString("upnp", "icon", NsUpnp, iconUrlInfo.url); writer.WriteElementString("upnp", "icon", NsUpnp, iconUrlInfo.Url);
if (!_profile.EnableAlbumArtInDidl) if (!_profile.EnableAlbumArtInDidl)
{ {
@ -1045,8 +1045,8 @@ namespace Emby.Dlna.Didl
// Images must have a reported size or many clients (Bubble upnp), will only use the first thumbnail // Images must have a reported size or many clients (Bubble upnp), will only use the first thumbnail
// rather than using a larger one when available // rather than using a larger one when available
var width = albumartUrlInfo.width ?? maxWidth; var width = albumartUrlInfo.Width ?? maxWidth;
var height = albumartUrlInfo.height ?? maxHeight; var height = albumartUrlInfo.Height ?? maxHeight;
var contentFeatures = ContentFeatureBuilder.BuildImageHeader(_profile, format, width, height, imageInfo.IsDirectStream, org_Pn); var contentFeatures = ContentFeatureBuilder.BuildImageHeader(_profile, format, width, height, imageInfo.IsDirectStream, org_Pn);
@ -1062,7 +1062,7 @@ namespace Emby.Dlna.Didl
"resolution", "resolution",
string.Format(CultureInfo.InvariantCulture, "{0}x{1}", width, height)); string.Format(CultureInfo.InvariantCulture, "{0}x{1}", width, height));
writer.WriteString(albumartUrlInfo.url); writer.WriteString(albumartUrlInfo.Url);
writer.WriteFullEndElement(); writer.WriteFullEndElement();
} }
@ -1200,7 +1200,7 @@ namespace Emby.Dlna.Didl
return id; return id;
} }
private (string url, int? width, int? height) GetImageUrl(ImageDownloadInfo info, int maxWidth, int maxHeight, string format) private (string Url, int? Width, int? Height) GetImageUrl(ImageDownloadInfo info, int maxWidth, int maxHeight, string format)
{ {
var url = string.Format( var url = string.Format(
CultureInfo.InvariantCulture, CultureInfo.InvariantCulture,

@ -1444,7 +1444,7 @@ namespace Emby.Server.Implementations.Library
for (int i = 0; i < len; i++) for (int i = 0; i < len; i++)
{ {
parents[i] = GetItemById(ancestorIds[i]); parents[i] = GetItemById(ancestorIds[i]);
if (!(parents[i] is ICollectionFolder || parents[i] is UserView)) if (parents[i] is not (ICollectionFolder or UserView))
{ {
return; return;
} }

@ -228,9 +228,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] bool enableTotalRecordCount = true, [FromQuery] bool enableTotalRecordCount = true,
[FromQuery] bool? enableImages = true) [FromQuery] bool? enableImages = true)
{ {
var user = !userId.Equals(Guid.Empty) var user = userId == Guid.Empty ? null : _userManager.GetUserById(userId);
? _userManager.GetUserById(userId)
: null;
var dtoOptions = new DtoOptions { Fields = fields } var dtoOptions = new DtoOptions { Fields = fields }
.AddClientFields(Request) .AddClientFields(Request)
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes); .AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);

@ -11,6 +11,8 @@
<Rule Id="SA1142" Action="Error" /> <Rule Id="SA1142" Action="Error" />
<!-- error on SA1210: Using directives should be ordered alphabetically by the namespaces --> <!-- error on SA1210: Using directives should be ordered alphabetically by the namespaces -->
<Rule Id="SA1210" Action="Error" /> <Rule Id="SA1210" Action="Error" />
<!-- error on SA1316: Tuple element names should use correct casing -->
<Rule Id="SA1316" Action="Error" />
<!-- error on SA1518: File is required to end with a single newline character --> <!-- error on SA1518: File is required to end with a single newline character -->
<Rule Id="SA1518" Action="Error" /> <Rule Id="SA1518" Action="Error" />
<!-- error on SA1629: Documentation text should end with a period --> <!-- error on SA1629: Documentation text should end with a period -->

Loading…
Cancel
Save