diff options
| author | crobibero <cody@robibe.ro> | 2020-10-09 17:46:39 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-10-09 17:46:39 -0600 |
| commit | ed4b470397c41ba1c86b2f4161874ef741e275c5 (patch) | |
| tree | b0dbf9afa15d1685a205e4f9f97ba1dbc788467d /Jellyfin.Api/Controllers | |
| parent | 10d48b062315581adc4706530bc388d53ff232a4 (diff) | |
Convert exclude location type string to enum.
Diffstat (limited to 'Jellyfin.Api/Controllers')
| -rw-r--r-- | Jellyfin.Api/Controllers/ItemsController.cs | 9 | ||||
| -rw-r--r-- | Jellyfin.Api/Controllers/TrailersController.cs | 3 |
2 files changed, 5 insertions, 7 deletions
diff --git a/Jellyfin.Api/Controllers/ItemsController.cs b/Jellyfin.Api/Controllers/ItemsController.cs index 652c4689d..fd7187cd4 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.cs index 5157b08ae..bf2dfcc39 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, |
