mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-02 21:24:15 -04:00
Remove extra endpoint
This commit is contained in:
parent
203c46de33
commit
24c861c23b
@ -228,42 +228,6 @@ namespace Jellyfin.Api.Controllers
|
|||||||
return GetResult(items, user, limit, dtoOptions);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Creates an instant playlist based on a given genre.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="id">The item id.</param>
|
|
||||||
/// <param name="userId">Optional. Filter by user id, and attach user data.</param>
|
|
||||||
/// <param name="limit">Optional. The maximum number of records to return.</param>
|
|
||||||
/// <param name="fields">Optional. Specify additional fields of information to return in the output.</param>
|
|
||||||
/// <param name="enableImages">Optional. Include image information in output.</param>
|
|
||||||
/// <param name="enableUserData">Optional. Include user data.</param>
|
|
||||||
/// <param name="imageTypeLimit">Optional. The max number of images to return, per image type.</param>
|
|
||||||
/// <param name="enableImageTypes">Optional. The image types to include in the output.</param>
|
|
||||||
/// <response code="200">Instant playlist returned.</response>
|
|
||||||
/// <returns>A <see cref="QueryResult{BaseItemDto}"/> with the playlist items.</returns>
|
|
||||||
[HttpGet("MusicGenres/{id}/InstantMix")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
public ActionResult<QueryResult<BaseItemDto>> GetInstantMixFromMusicGenreById(
|
|
||||||
[FromRoute, Required] Guid id,
|
|
||||||
[FromQuery] Guid? userId,
|
|
||||||
[FromQuery] int? limit,
|
|
||||||
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ItemFields[] fields,
|
|
||||||
[FromQuery] bool? enableImages,
|
|
||||||
[FromQuery] bool? enableUserData,
|
|
||||||
[FromQuery] int? imageTypeLimit,
|
|
||||||
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes)
|
|
||||||
{
|
|
||||||
var item = _libraryManager.GetItemById(id);
|
|
||||||
var user = userId.HasValue && !userId.Equals(Guid.Empty)
|
|
||||||
? _userManager.GetUserById(userId.Value)
|
|
||||||
: null;
|
|
||||||
var dtoOptions = new DtoOptions { Fields = fields }
|
|
||||||
.AddClientFields(Request)
|
|
||||||
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
|
||||||
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
|
||||||
return GetResult(items, user, limit, dtoOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates an instant playlist based on a given item.
|
/// Creates an instant playlist based on a given item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -363,15 +327,15 @@ namespace Jellyfin.Api.Controllers
|
|||||||
[FromQuery] int? imageTypeLimit,
|
[FromQuery] int? imageTypeLimit,
|
||||||
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes)
|
[FromQuery, ModelBinder(typeof(CommaDelimitedArrayModelBinder))] ImageType[] enableImageTypes)
|
||||||
{
|
{
|
||||||
return GetInstantMixFromMusicGenreById(
|
var item = _libraryManager.GetItemById(id);
|
||||||
id,
|
var user = userId.HasValue && !userId.Equals(Guid.Empty)
|
||||||
userId,
|
? _userManager.GetUserById(userId.Value)
|
||||||
limit,
|
: null;
|
||||||
fields,
|
var dtoOptions = new DtoOptions { Fields = fields }
|
||||||
enableImages,
|
.AddClientFields(Request)
|
||||||
enableUserData,
|
.AddAdditionalDtoOptions(enableImages, enableUserData, imageTypeLimit, enableImageTypes!);
|
||||||
imageTypeLimit,
|
var items = _musicManager.GetInstantMixFromItem(item, user, dtoOptions);
|
||||||
enableImageTypes);
|
return GetResult(items, user, limit, dtoOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
private QueryResult<BaseItemDto> GetResult(List<BaseItem> items, User? user, int? limit, DtoOptions dtoOptions)
|
private QueryResult<BaseItemDto> GetResult(List<BaseItem> items, User? user, int? limit, DtoOptions dtoOptions)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user