소스 검색

Error on SA1316

Bond_009 3 년 전
부모
커밋
77c615ba42
4개의 변경된 파일10개의 추가작업 그리고 10개의 파일을 삭제
  1. 6 6
      Emby.Dlna/Didl/DidlBuilder.cs
  2. 1 1
      Emby.Server.Implementations/Library/LibraryManager.cs
  3. 1 3
      Jellyfin.Api/Controllers/ItemsController.cs
  4. 2 0
      jellyfin.ruleset

+ 6 - 6
Emby.Dlna/Didl/DidlBuilder.cs

@@ -989,7 +989,7 @@ namespace Emby.Dlna.Didl
                 writer.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.Didl
             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(
                 CultureInfo.InvariantCulture,

+ 1 - 1
Emby.Server.Implementations/Library/LibraryManager.cs

@@ -1444,7 +1444,7 @@ namespace Emby.Server.Implementations.Library
             for (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;
                 }

+ 1 - 3
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);

+ 2 - 0
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 -->