The Free Software Media System - Server Backend & API
Error on SA1316
Bond_00977c615ba424b
diff --git a/Emby.Dlna/Didl/DidlBuilder.cs b/Emby.Dlna/Didl/DidlBuilder.csindex b00e1c98af..6803b3b875 100644--- a/Emby.Dlna/Didl/DidlBuilder.cs+++ b/Emby.Dlna/Didl/DidlBuilder.cs@@ -989,7 +989,7 @@ namespace Emby.Dlna.Didlwriter.WriteAttributeString("dlna", "profileID", NsDlna, _profile.AlbumArtPn);}- writer.WriteString(albumArtUrlInfo.url);+ writer.WriteString(albumArtUrlInfo.Url);writer.WriteFullEndElement();// TODO: Remove these default values@@ -998,7 +998,7 @@ namespace Emby.Dlna.Didl_profile.MaxIconWidth ?? 48,_profile.MaxIconHeight ?? 48,"jpg");- writer.WriteElementString("upnp", "icon", NsUpnp, iconUrlInfo.url);+ writer.WriteElementString("upnp", "icon", NsUpnp, iconUrlInfo.Url);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// rather than using a larger one when available- var width = albumartUrlInfo.width ?? maxWidth;- var height = albumartUrlInfo.height ?? maxHeight;+ var width = albumartUrlInfo.Width ?? maxWidth;+ var height = albumartUrlInfo.Height ?? maxHeight;var contentFeatures = ContentFeatureBuilder.BuildImageHeader(_profile, format, width, height, imageInfo.IsDirectStream, org_Pn);@@ -1062,7 +1062,7 @@ namespace Emby.Dlna.Didl"resolution",string.Format(CultureInfo.InvariantCulture, "{0}x{1}", width, height));- writer.WriteString(albumartUrlInfo.url);+ writer.WriteString(albumartUrlInfo.Url);writer.WriteFullEndElement();}@@ -1200,7 +1200,7 @@ namespace Emby.Dlna.Didlreturn 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(CultureInfo.InvariantCulture,diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex db2836a704..464a621cf8 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -1444,7 +1444,7 @@ namespace Emby.Server.Implementations.Libraryfor (int i = 0; i < len; i++){parents[i] = GetItemById(ancestorIds[i]);- if (!(parents[i] is ICollectionFolder || parents[i] is UserView))+ if (parents[i] is not (ICollectionFolder or UserView)){return;}diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.csindex 1b938f4d58..f8192955e5 100644--- a/Jellyfin.Api/Controllers/ItemsController.cs+++ b/Jellyfin.Api/Controllers/ItemsController.cs@@ -228,9 +228,7 @@ namespace Jellyfin.Api.Controllers[FromQuery] bool enableTotalRecordCount = true,[FromQuery] bool? enableImages = true){- var user = !userId.Equals(Guid.Empty)- ? _userManager.GetUserById(userId)- : null;+ var user = userId == Guid.Empty ? null : _userManager.GetUserById(userId);var dtoOptions = new DtoOptions { Fields = fields }.AddClientFields(Request).AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes);diff --git a/jellyfin.ruleset b/jellyfin.rulesetindex e9293588c7..52bedabeec 100644--- a/jellyfin.ruleset+++ b/jellyfin.ruleset@@ -11,6 +11,8 @@<Rule Id="SA1142" Action="Error" /><!-- error on SA1210: Using directives should be ordered alphabetically by the namespaces --><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 --><Rule Id="SA1518" Action="Error" /><!-- error on SA1629: Documentation text should end with a period -->