The Free Software Media System - Server Backend & API
Convert exclude location type string to enum.
crobiberoed4b470397c4
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.csindex 652c4689d0..fd7187cd4f 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))diff --git a/Jellyfin.Api/Controllers/TrailersController.cs b/Jellyfin.Api/Controllers/TrailersController.csindex 5157b08ae5..bf2dfcc395 100644--- a/Jellyfin.Api/Controllers/TrailersController.cs+++ b/Jellyfin.Api/Controllers/TrailersController.cs@@ -1,6 +1,7 @@using System;using Jellyfin.Api.Constants;using MediaBrowser.Model.Dto;+using MediaBrowser.Model.Entities;using MediaBrowser.Model.Querying;using Microsoft.AspNetCore.Authorization;using Microsoft.AspNetCore.Http;@@ -124,7 +125,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,