aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/LibraryController.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2020-11-20 12:34:18 -0500
committerGitHub <noreply@github.com>2020-11-20 12:34:18 -0500
commit7457c4a95d64a798fc4226735f934d20c90a28e2 (patch)
treebc829f18ff731302e1c47642ba357fc25c402f68 /Jellyfin.Api/Controllers/LibraryController.cs
parent799eb4400576efa798f58bed343b888f60676b68 (diff)
parent5b62f70bc03afe0d1bce702d71635fe57562dd0c (diff)
Merge pull request #4499 from crobibero/more-param
Reduce RequestHelpers.Split usage and remove RequestHelpers.GetGuids
Diffstat (limited to 'Jellyfin.Api/Controllers/LibraryController.cs')
-rw-r--r--Jellyfin.Api/Controllers/LibraryController.cs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Jellyfin.Api/Controllers/LibraryController.cs b/Jellyfin.Api/Controllers/LibraryController.cs
index 1b115d800..3ff77e8e0 100644
--- a/Jellyfin.Api/Controllers/LibraryController.cs
+++ b/Jellyfin.Api/Controllers/LibraryController.cs
@@ -362,15 +362,14 @@ namespace Jellyfin.Api.Controllers
[Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
- public ActionResult DeleteItems([FromQuery] string? ids)
+ public ActionResult DeleteItems([FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] string[] ids)
{
- if (string.IsNullOrEmpty(ids))
+ if (ids.Length == 0)
{
return NoContent();
}
- var itemIds = RequestHelpers.Split(ids, ',', true);
- foreach (var i in itemIds)
+ foreach (var i in ids)
{
var item = _libraryManager.GetItemById(i);
var auth = _authContext.GetAuthorizationInfo(Request);
@@ -691,7 +690,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<QueryResult<BaseItemDto>> GetSimilarItems(
[FromRoute, Required] Guid itemId,
- [FromQuery] string? excludeArtistIds,
+ [FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] excludeArtistIds,
[FromQuery] Guid? userId,
[FromQuery] int? limit,
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields)
@@ -753,9 +752,9 @@ namespace Jellyfin.Api.Controllers
};
// ExcludeArtistIds
- if (!string.IsNullOrEmpty(excludeArtistIds))
+ if (excludeArtistIds.Length != 0)
{
- query.ExcludeArtistIds = RequestHelpers.GetGuids(excludeArtistIds);
+ query.ExcludeArtistIds = excludeArtistIds;
}
List<BaseItem> itemsResult = _libraryManager.GetItemList(query);