mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
added IsPremium filter to GetPackages api method
This commit is contained in:
parent
69542e3860
commit
815bb6c825
@ -42,6 +42,9 @@ namespace MediaBrowser.Api
|
|||||||
|
|
||||||
[ApiMember(Name = "TargetSystems", Description = "Optional. Filter by target system type. Allows multiple, comma delimited.", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET", AllowMultiple = true)]
|
[ApiMember(Name = "TargetSystems", Description = "Optional. Filter by target system type. Allows multiple, comma delimited.", IsRequired = false, DataType = "string", ParameterType = "path", Verb = "GET", AllowMultiple = true)]
|
||||||
public string TargetSystems { get; set; }
|
public string TargetSystems { get; set; }
|
||||||
|
|
||||||
|
[ApiMember(Name = "IsPremium", Description = "Optiona. Filter by premium status", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
|
||||||
|
public bool? IsPremium { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -175,6 +178,11 @@ namespace MediaBrowser.Api
|
|||||||
packages = packages.Where(p => apps.Contains(p.targetSystem));
|
packages = packages.Where(p => apps.Contains(p.targetSystem));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (request.IsPremium.HasValue)
|
||||||
|
{
|
||||||
|
packages = packages.Where(p => p.isPremium == request.IsPremium.Value);
|
||||||
|
}
|
||||||
|
|
||||||
return ToOptimizedResult(packages.ToList());
|
return ToOptimizedResult(packages.ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user