mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
Convert exclude location type string to enum.
This commit is contained in:
parent
10d48b0623
commit
ed4b470397
2 changed files with 5 additions and 7 deletions
|
@ -159,7 +159,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[FromQuery] bool? isHd,
|
[FromQuery] bool? isHd,
|
||||||
[FromQuery] bool? is4K,
|
[FromQuery] bool? is4K,
|
||||||
[FromQuery] string? locationTypes,
|
[FromQuery] string? locationTypes,
|
||||||
[FromQuery] string? excludeLocationTypes,
|
[FromQuery] LocationType[] excludeLocationTypes,
|
||||||
[FromQuery] bool? isMissing,
|
[FromQuery] bool? isMissing,
|
||||||
[FromQuery] bool? isUnaired,
|
[FromQuery] bool? isUnaired,
|
||||||
[FromQuery] double? minCommunityRating,
|
[FromQuery] double? minCommunityRating,
|
||||||
|
@ -406,13 +406,10 @@ namespace Jellyfin.Api.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// ExcludeLocationTypes
|
// 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))
|
if (!string.IsNullOrEmpty(locationTypes))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using Jellyfin.Api.Constants;
|
using Jellyfin.Api.Constants;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Querying;
|
using MediaBrowser.Model.Querying;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
@ -124,7 +125,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[FromQuery] bool? isHd,
|
[FromQuery] bool? isHd,
|
||||||
[FromQuery] bool? is4K,
|
[FromQuery] bool? is4K,
|
||||||
[FromQuery] string? locationTypes,
|
[FromQuery] string? locationTypes,
|
||||||
[FromQuery] string? excludeLocationTypes,
|
[FromQuery] LocationType[] excludeLocationTypes,
|
||||||
[FromQuery] bool? isMissing,
|
[FromQuery] bool? isMissing,
|
||||||
[FromQuery] bool? isUnaired,
|
[FromQuery] bool? isUnaired,
|
||||||
[FromQuery] double? minCommunityRating,
|
[FromQuery] double? minCommunityRating,
|
||||||
|
|
Loading…
Reference in a new issue