Fix CA1819 warnings in QueryFiltersLegacy

Replace array-typed properties with IReadOnlyList<T> to satisfy
CA1819 (Properties should not return arrays). Uses collection
expressions for initialization.

IReadOnlyList<T> 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<T>.
This commit is contained in:
Michael Jones committed 2026-07-06 12:05:43 -05:00
1 parent d3ee1e84b1
commit f4718d2e79
1 file changed
+9 -9
@@ -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<string>();
Tags = Array.Empty<string>();
OfficialRatings = Array.Empty<string>();
Years = Array.Empty<int>();
Genres = [];
Tags = [];
OfficialRatings = [];
Years = [];
}
public string[] Genres { get; set; }
public IReadOnlyList<string> Genres { get; set; }
public string[] Tags { get; set; }
public IReadOnlyList<string> Tags { get; set; }
public string[] OfficialRatings { get; set; }
public IReadOnlyList<string> OfficialRatings { get; set; }
public int[] Years { get; set; }
public IReadOnlyList<int> Years { get; set; }
}
}