The Free Software Media System - Server Backend & API
Convert pragma to supresswarning
crobiberod820c0fff50a
diff --git a/Jellyfin.Api/Controllers/ActivityLogController.cs b/Jellyfin.Api/Controllers/ActivityLogController.csindex 4ae7cf5069..ec50fb022e 100644--- a/Jellyfin.Api/Controllers/ActivityLogController.cs+++ b/Jellyfin.Api/Controllers/ActivityLogController.cs@@ -1,6 +1,5 @@-#pragma warning disable CA1801-using System;+using System.Diagnostics.CodeAnalysis;using System.Linq;using Jellyfin.Api.Constants;using Jellyfin.Data.Entities;@@ -41,6 +40,7 @@ namespace Jellyfin.Api.Controllers/// <returns>A <see cref="QueryResult{ActivityLogEntry}"/> containing the log entries.</returns>[HttpGet("Entries")][ProducesResponseType(StatusCodes.Status200OK)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "hasUserId", Justification = "Imported from ServiceStack")]public ActionResult<QueryResult<ActivityLogEntry>> GetLogEntries([FromQuery] int? startIndex,[FromQuery] int? limit,diff --git a/Jellyfin.Api/Controllers/FilterController.cs b/Jellyfin.Api/Controllers/FilterController.csindex 6a6e6a64a3..dc5b0d9061 100644--- a/Jellyfin.Api/Controllers/FilterController.cs+++ b/Jellyfin.Api/Controllers/FilterController.cs@@ -1,6 +1,5 @@-#pragma warning disable CA1801--using System;+using System;+using System.Diagnostics.CodeAnalysis;using System.Linq;using MediaBrowser.Controller.Dto;using MediaBrowser.Controller.Entities;@@ -137,6 +136,7 @@ namespace Jellyfin.Api.Controllers/// <returns>Query filters.</returns>[HttpGet("/Items/Filters2")][ProducesResponseType(StatusCodes.Status200OK)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "mediaTypes", Justification = "Imported from ServiceStack")]public ActionResult<QueryFilters> GetQueryFilters([FromQuery] Guid? userId,[FromQuery] string? parentId,diff --git a/Jellyfin.Api/Controllers/ItemRefreshController.cs b/Jellyfin.Api/Controllers/ItemRefreshController.csindex a1df22e411..6a16a89c5a 100644--- a/Jellyfin.Api/Controllers/ItemRefreshController.cs+++ b/Jellyfin.Api/Controllers/ItemRefreshController.cs@@ -1,6 +1,5 @@-#pragma warning disable CA1801-using System.ComponentModel;+using System.Diagnostics.CodeAnalysis;using MediaBrowser.Controller.Library;using MediaBrowser.Controller.Providers;using MediaBrowser.Model.IO;@@ -54,6 +53,7 @@ namespace Jellyfin.Api.Controllers[Description("Refreshes metadata for an item.")][ProducesResponseType(StatusCodes.Status200OK)][ProducesResponseType(StatusCodes.Status404NotFound)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "recursive", Justification = "Imported from ServiceStack")]public ActionResult Post([FromRoute] string id,[FromQuery] MetadataRefreshMode metadataRefreshMode = MetadataRefreshMode.None,diff --git a/Jellyfin.Api/Controllers/LibraryStructureController.cs b/Jellyfin.Api/Controllers/LibraryStructureController.csindex ca2905b114..62c5474099 100644--- a/Jellyfin.Api/Controllers/LibraryStructureController.cs+++ b/Jellyfin.Api/Controllers/LibraryStructureController.cs@@ -1,7 +1,6 @@-#pragma warning disable CA1801-using System;using System.Collections.Generic;+using System.Diagnostics.CodeAnalysis;using System.Globalization;using System.IO;using System.Linq;@@ -56,6 +55,7 @@ namespace Jellyfin.Api.Controllers/// <returns>An <see cref="IEnumerable{VirtualFolderInfo}"/> with the virtual folders.</returns>[HttpGet][ProducesResponseType(StatusCodes.Status200OK)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]public ActionResult<IEnumerable<VirtualFolderInfo>> GetVirtualFolders([FromQuery] string userId){return _libraryManager.GetVirtualFolders(true);diff --git a/Jellyfin.Api/Controllers/NotificationsController.cs b/Jellyfin.Api/Controllers/NotificationsController.csindex a1f9b9e8f7..01dd23c77f 100644--- a/Jellyfin.Api/Controllers/NotificationsController.cs+++ b/Jellyfin.Api/Controllers/NotificationsController.cs@@ -1,7 +1,6 @@-#pragma warning disable CA1801-using System;using System.Collections.Generic;+using System.Diagnostics.CodeAnalysis;using System.Linq;using System.Threading;using Jellyfin.Api.Models.NotificationDtos;@@ -45,6 +44,10 @@ namespace Jellyfin.Api.Controllers/// <returns>An <see cref="OkResult"/> containing a list of notifications.</returns>[HttpGet("{UserID}")][ProducesResponseType(StatusCodes.Status200OK)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "isRead", Justification = "Imported from ServiceStack")]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "startIndex", Justification = "Imported from ServiceStack")]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "limit", Justification = "Imported from ServiceStack")]public ActionResult<NotificationResultDto> GetNotifications([FromRoute] string userId,[FromQuery] bool? isRead,@@ -62,6 +65,7 @@ namespace Jellyfin.Api.Controllers/// <returns>An <cref see="OkResult"/> containing a summary of the users notifications.</returns>[HttpGet("{UserID}/Summary")][ProducesResponseType(StatusCodes.Status200OK)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]public ActionResult<NotificationsSummaryDto> GetNotificationsSummary([FromRoute] string userId){@@ -136,6 +140,8 @@ namespace Jellyfin.Api.Controllers/// <returns>A <cref see="NoContentResult"/>.</returns>[HttpPost("{UserID}/Read")][ProducesResponseType(StatusCodes.Status204NoContent)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "ids", Justification = "Imported from ServiceStack")]public ActionResult SetRead([FromRoute] string userId,[FromQuery] string ids)@@ -152,6 +158,8 @@ namespace Jellyfin.Api.Controllers/// <returns>A <cref see="NoContentResult"/>.</returns>[HttpPost("{UserID}/Unread")][ProducesResponseType(StatusCodes.Status204NoContent)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "userId", Justification = "Imported from ServiceStack")]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "ids", Justification = "Imported from ServiceStack")]public ActionResult SetUnread([FromRoute] string userId,[FromQuery] string ids)diff --git a/Jellyfin.Api/Controllers/PluginsController.cs b/Jellyfin.Api/Controllers/PluginsController.csindex fdb2f4c35b..6075544cf7 100644--- a/Jellyfin.Api/Controllers/PluginsController.cs+++ b/Jellyfin.Api/Controllers/PluginsController.cs@@ -1,7 +1,6 @@-#pragma warning disable CA1801--using System;+using System;using System.Collections.Generic;+using System.Diagnostics.CodeAnalysis;using System.Linq;using System.Text.Json;using System.Threading.Tasks;@@ -46,6 +45,7 @@ namespace Jellyfin.Api.Controllers/// <response code="200">Installed plugins returned.</response>/// <returns>List of currently installed plugins.</returns>[HttpGet]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "isAppStoreEnabled", Justification = "Imported from ServiceStack")]public ActionResult<IEnumerable<PluginInfo>> GetPlugins([FromRoute] bool? isAppStoreEnabled){return Ok(_appHost.Plugins.OrderBy(p => p.Name).Select(p => p.GetPluginInfo()));diff --git a/Jellyfin.Api/Controllers/SubtitleController.cs b/Jellyfin.Api/Controllers/SubtitleController.csindex 69b83379d9..74ec5f9b52 100644--- a/Jellyfin.Api/Controllers/SubtitleController.cs+++ b/Jellyfin.Api/Controllers/SubtitleController.cs@@ -1,8 +1,7 @@-#pragma warning disable CA1801-using System;using System.Collections.Generic;using System.ComponentModel.DataAnnotations;+using System.Diagnostics.CodeAnalysis;using System.Globalization;using System.IO;using System.Linq;@@ -251,9 +250,9 @@ namespace Jellyfin.Api.Controllers[HttpGet("/Videos/{id}/{mediaSourceId}/Subtitles/{index}/subtitles.m3u8")][Authorize(Policy = Policies.DefaultAuthorization)][ProducesResponseType(StatusCodes.Status200OK)]+ [SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "index", Justification = "Imported from ServiceStack")]public async Task<ActionResult> GetSubtitlePlaylist([FromRoute] Guid id,- // TODO: 'int index' is never used: CA1801 is disabled[FromRoute] int index,[FromRoute] string mediaSourceId,[FromQuery, Required] int segmentLength)