mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 06:17:14 -04:00
Merge pull request #4672 from cvium/fix_mergeversions_which_was_unrelated_to_my_bughunt
Fix MergeVersions endpoint
This commit is contained in:
commit
26919eed26
@ -196,7 +196,7 @@ namespace Jellyfin.Api.Controllers
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Merges videos into a single record.
|
/// Merges videos into a single record.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="itemIds">Item id list. This allows multiple, comma delimited.</param>
|
/// <param name="ids">Item id list. This allows multiple, comma delimited.</param>
|
||||||
/// <response code="204">Videos merged.</response>
|
/// <response code="204">Videos merged.</response>
|
||||||
/// <response code="400">Supply at least 2 video ids.</response>
|
/// <response code="400">Supply at least 2 video ids.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/> indicating success, or a <see cref="BadRequestResult"/> if less than two ids were supplied.</returns>
|
/// <returns>A <see cref="NoContentResult"/> indicating success, or a <see cref="BadRequestResult"/> if less than two ids were supplied.</returns>
|
||||||
@ -204,9 +204,9 @@ namespace Jellyfin.Api.Controllers
|
|||||||
[Authorize(Policy = Policies.RequiresElevation)]
|
[Authorize(Policy = Policies.RequiresElevation)]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
public async Task<ActionResult> MergeVersions([FromQuery, Required, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] itemIds)
|
public async Task<ActionResult> MergeVersions([FromQuery, Required, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] Guid[] ids)
|
||||||
{
|
{
|
||||||
var items = itemIds
|
var items = ids
|
||||||
.Select(i => _libraryManager.GetItemById(i))
|
.Select(i => _libraryManager.GetItemById(i))
|
||||||
.OfType<Video>()
|
.OfType<Video>()
|
||||||
.OrderBy(i => i.Id)
|
.OrderBy(i => i.Id)
|
||||||
|
Loading…
Reference in New Issue
Block a user