From f4718d2e790ea77995d5a5c5543a306f3aa10309 Mon Sep 17 00:00:00 2001 From: Michael Jones Date: Mon, 6 Jul 2026 12:05:43 -0500 Subject: Fix CA1819 warnings in QueryFiltersLegacy Replace array-typed properties with IReadOnlyList to satisfy CA1819 (Properties should not return arrays). Uses collection expressions for initialization. IReadOnlyList serializes identically to a JSON array, so the OpenAPI schema and wire format are unchanged. The only construction site assigns the result of .ToArray(), which still satisfies IReadOnlyList. --- MediaBrowser.Model/Querying/QueryFiltersLegacy.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MediaBrowser.Model/Querying/QueryFiltersLegacy.cs b/MediaBrowser.Model/Querying/QueryFiltersLegacy.cs index fcb450ed30..8aa234a1c3 100644 --- a/MediaBrowser.Model/Querying/QueryFiltersLegacy.cs +++ b/MediaBrowser.Model/Querying/QueryFiltersLegacy.cs @@ -1,7 +1,7 @@ #nullable disable #pragma warning disable CS1591 -using System; +using System.Collections.Generic; namespace MediaBrowser.Model.Querying { @@ -9,18 +9,18 @@ namespace MediaBrowser.Model.Querying { public QueryFiltersLegacy() { - Genres = Array.Empty(); - Tags = Array.Empty(); - OfficialRatings = Array.Empty(); - Years = Array.Empty(); + Genres = []; + Tags = []; + OfficialRatings = []; + Years = []; } - public string[] Genres { get; set; } + public IReadOnlyList Genres { get; set; } - public string[] Tags { get; set; } + public IReadOnlyList Tags { get; set; } - public string[] OfficialRatings { get; set; } + public IReadOnlyList OfficialRatings { get; set; } - public int[] Years { get; set; } + public IReadOnlyList Years { get; set; } } } -- cgit v1.2.3