diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2020-10-11 18:32:22 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-11 18:32:22 +0900 |
| commit | 4fafa5796d046412674e1da48231046fd60ebaf4 (patch) | |
| tree | 74c76d3813058029385e9e336bec63f14717ffae /Jellyfin.Api/Controllers/ItemsController.cs | |
| parent | 6e585ccfb267c3f6ce7ac47f2564c011cd465b37 (diff) | |
| parent | ed4b470397c41ba1c86b2f4161874ef741e275c5 (diff) | |
Merge pull request #4304 from crobibero/query-location-type
Convert exclude location type string to enum.
Diffstat (limited to 'Jellyfin.Api/Controllers/ItemsController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/ItemsController.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs index 1f73bd858..b50b1e836 100644 --- a/Jellyfin.Api/Controllers/ItemsController.cs +++ b/Jellyfin.Api/Controllers/ItemsController.cs @@ -159,7 +159,7 @@ namespace Jellyfin.Api.Controllers [FromQuery] bool? isHd, [FromQuery] bool? is4K, [FromQuery] string? locationTypes, - [FromQuery] string? excludeLocationTypes, + [FromQuery] LocationType[] excludeLocationTypes, [FromQuery] bool? isMissing, [FromQuery] bool? isUnaired, [FromQuery] double? minCommunityRating, @@ -406,12 +406,9 @@ namespace Jellyfin.Api.Controllers } // ExcludeLocationTypes - if (!string.IsNullOrEmpty(excludeLocationTypes)) + if (excludeLocationTypes.Any(t => t == LocationType.Virtual)) { - if (excludeLocationTypes.Split(',').Select(d => (LocationType)Enum.Parse(typeof(LocationType), d, true)).ToArray().Contains(LocationType.Virtual)) - { - query.IsVirtualItem = false; - } + query.IsVirtualItem = false; } if (!string.IsNullOrEmpty(locationTypes)) |
