|
|
|
@ -90,9 +90,9 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "imageType", Justification = "Imported from ServiceStack")]
|
|
|
|
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "index", Justification = "Imported from ServiceStack")]
|
|
|
|
|
public async Task<ActionResult> PostUserImage(
|
|
|
|
|
[FromRoute] Guid userId,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] int? index = null)
|
|
|
|
|
[FromRoute][Required] Guid userId,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] int? index = null)
|
|
|
|
|
{
|
|
|
|
|
if (!RequestHelpers.AssertCanUpdateUser(_authContext, HttpContext.Request, userId, true))
|
|
|
|
|
{
|
|
|
|
@ -137,9 +137,9 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status403Forbidden)]
|
|
|
|
|
public ActionResult DeleteUserImage(
|
|
|
|
|
[FromRoute] Guid userId,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] int? index = null)
|
|
|
|
|
[FromRoute][Required] Guid userId,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] int? index = null)
|
|
|
|
|
{
|
|
|
|
|
if (!RequestHelpers.AssertCanUpdateUser(_authContext, HttpContext.Request, userId, true))
|
|
|
|
|
{
|
|
|
|
@ -175,9 +175,9 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> DeleteItemImage(
|
|
|
|
|
[FromRoute] Guid itemId,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] Guid itemId,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetItemById(itemId);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -205,9 +205,9 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "index", Justification = "Imported from ServiceStack")]
|
|
|
|
|
public async Task<ActionResult> SetItemImage(
|
|
|
|
|
[FromRoute] Guid itemId,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] Guid itemId,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetItemById(itemId);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -238,9 +238,9 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> UpdateItemImageIndex(
|
|
|
|
|
[FromRoute] Guid itemId,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] int imageIndex,
|
|
|
|
|
[FromRoute][Required] Guid itemId,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] int imageIndex,
|
|
|
|
|
[FromQuery] int newIndex)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetItemById(itemId);
|
|
|
|
@ -264,7 +264,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[Authorize(Policy = Policies.DefaultAuthorization)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult<IEnumerable<ImageInfo>>> GetItemImageInfos([FromRoute] Guid itemId)
|
|
|
|
|
public async Task<ActionResult<IEnumerable<ImageInfo>>> GetItemImageInfos([FromRoute][Required] Guid itemId)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetItemById(itemId);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -352,10 +352,10 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> GetItemImage(
|
|
|
|
|
[FromRoute] Guid itemId,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] int? maxWidth,
|
|
|
|
|
[FromRoute] int? maxHeight,
|
|
|
|
|
[FromRoute][Required] Guid itemId,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] int? maxWidth,
|
|
|
|
|
[FromRoute][Required] int? maxHeight,
|
|
|
|
|
[FromQuery] int? width,
|
|
|
|
|
[FromQuery] int? height,
|
|
|
|
|
[FromQuery] int? quality,
|
|
|
|
@ -368,7 +368,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[FromQuery] int? blur,
|
|
|
|
|
[FromQuery] string? backgroundColor,
|
|
|
|
|
[FromQuery] string? foregroundLayer,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetItemById(itemId);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -430,23 +430,23 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> GetItemImage2(
|
|
|
|
|
[FromRoute] Guid itemId,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] int? maxWidth,
|
|
|
|
|
[FromRoute] int? maxHeight,
|
|
|
|
|
[FromRoute][Required] Guid itemId,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] int? maxWidth,
|
|
|
|
|
[FromRoute][Required] int? maxHeight,
|
|
|
|
|
[FromQuery] int? width,
|
|
|
|
|
[FromQuery] int? height,
|
|
|
|
|
[FromQuery] int? quality,
|
|
|
|
|
[FromRoute] string tag,
|
|
|
|
|
[FromRoute][Required] string tag,
|
|
|
|
|
[FromQuery] bool? cropWhitespace,
|
|
|
|
|
[FromRoute] string format,
|
|
|
|
|
[FromRoute][Required] string format,
|
|
|
|
|
[FromQuery] bool? addPlayedIndicator,
|
|
|
|
|
[FromRoute] double? percentPlayed,
|
|
|
|
|
[FromRoute] int? unplayedCount,
|
|
|
|
|
[FromRoute][Required] double? percentPlayed,
|
|
|
|
|
[FromRoute][Required] int? unplayedCount,
|
|
|
|
|
[FromQuery] int? blur,
|
|
|
|
|
[FromQuery] string? backgroundColor,
|
|
|
|
|
[FromQuery] string? foregroundLayer,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetItemById(itemId);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -508,14 +508,14 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> GetArtistImage(
|
|
|
|
|
[FromRoute] string name,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] string tag,
|
|
|
|
|
[FromRoute] string format,
|
|
|
|
|
[FromRoute] int? maxWidth,
|
|
|
|
|
[FromRoute] int? maxHeight,
|
|
|
|
|
[FromRoute] double? percentPlayed,
|
|
|
|
|
[FromRoute] int? unplayedCount,
|
|
|
|
|
[FromRoute][Required] string name,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] string tag,
|
|
|
|
|
[FromRoute][Required] string format,
|
|
|
|
|
[FromRoute][Required] int? maxWidth,
|
|
|
|
|
[FromRoute][Required] int? maxHeight,
|
|
|
|
|
[FromRoute][Required] double? percentPlayed,
|
|
|
|
|
[FromRoute][Required] int? unplayedCount,
|
|
|
|
|
[FromQuery] int? width,
|
|
|
|
|
[FromQuery] int? height,
|
|
|
|
|
[FromQuery] int? quality,
|
|
|
|
@ -524,7 +524,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[FromQuery] int? blur,
|
|
|
|
|
[FromQuery] string? backgroundColor,
|
|
|
|
|
[FromQuery] string? foregroundLayer,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetArtist(name);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -586,14 +586,14 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> GetGenreImage(
|
|
|
|
|
[FromRoute] string name,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] string tag,
|
|
|
|
|
[FromRoute] string format,
|
|
|
|
|
[FromRoute] int? maxWidth,
|
|
|
|
|
[FromRoute] int? maxHeight,
|
|
|
|
|
[FromRoute] double? percentPlayed,
|
|
|
|
|
[FromRoute] int? unplayedCount,
|
|
|
|
|
[FromRoute][Required] string name,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] string tag,
|
|
|
|
|
[FromRoute][Required] string format,
|
|
|
|
|
[FromRoute][Required] int? maxWidth,
|
|
|
|
|
[FromRoute][Required] int? maxHeight,
|
|
|
|
|
[FromRoute][Required] double? percentPlayed,
|
|
|
|
|
[FromRoute][Required] int? unplayedCount,
|
|
|
|
|
[FromQuery] int? width,
|
|
|
|
|
[FromQuery] int? height,
|
|
|
|
|
[FromQuery] int? quality,
|
|
|
|
@ -602,7 +602,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[FromQuery] int? blur,
|
|
|
|
|
[FromQuery] string? backgroundColor,
|
|
|
|
|
[FromQuery] string? foregroundLayer,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetGenre(name);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -664,14 +664,14 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> GetMusicGenreImage(
|
|
|
|
|
[FromRoute] string name,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] string tag,
|
|
|
|
|
[FromRoute] string format,
|
|
|
|
|
[FromRoute] int? maxWidth,
|
|
|
|
|
[FromRoute] int? maxHeight,
|
|
|
|
|
[FromRoute] double? percentPlayed,
|
|
|
|
|
[FromRoute] int? unplayedCount,
|
|
|
|
|
[FromRoute][Required] string name,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] string tag,
|
|
|
|
|
[FromRoute][Required] string format,
|
|
|
|
|
[FromRoute][Required] int? maxWidth,
|
|
|
|
|
[FromRoute][Required] int? maxHeight,
|
|
|
|
|
[FromRoute][Required] double? percentPlayed,
|
|
|
|
|
[FromRoute][Required] int? unplayedCount,
|
|
|
|
|
[FromQuery] int? width,
|
|
|
|
|
[FromQuery] int? height,
|
|
|
|
|
[FromQuery] int? quality,
|
|
|
|
@ -680,7 +680,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[FromQuery] int? blur,
|
|
|
|
|
[FromQuery] string? backgroundColor,
|
|
|
|
|
[FromQuery] string? foregroundLayer,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetMusicGenre(name);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -742,14 +742,14 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> GetPersonImage(
|
|
|
|
|
[FromRoute] string name,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] string tag,
|
|
|
|
|
[FromRoute] string format,
|
|
|
|
|
[FromRoute] int? maxWidth,
|
|
|
|
|
[FromRoute] int? maxHeight,
|
|
|
|
|
[FromRoute] double? percentPlayed,
|
|
|
|
|
[FromRoute] int? unplayedCount,
|
|
|
|
|
[FromRoute][Required] string name,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] string tag,
|
|
|
|
|
[FromRoute][Required] string format,
|
|
|
|
|
[FromRoute][Required] int? maxWidth,
|
|
|
|
|
[FromRoute][Required] int? maxHeight,
|
|
|
|
|
[FromRoute][Required] double? percentPlayed,
|
|
|
|
|
[FromRoute][Required] int? unplayedCount,
|
|
|
|
|
[FromQuery] int? width,
|
|
|
|
|
[FromQuery] int? height,
|
|
|
|
|
[FromQuery] int? quality,
|
|
|
|
@ -758,7 +758,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[FromQuery] int? blur,
|
|
|
|
|
[FromQuery] string? backgroundColor,
|
|
|
|
|
[FromQuery] string? foregroundLayer,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetPerson(name);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -820,14 +820,14 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> GetStudioImage(
|
|
|
|
|
[FromRoute] string name,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute] string tag,
|
|
|
|
|
[FromRoute] string format,
|
|
|
|
|
[FromRoute] int? maxWidth,
|
|
|
|
|
[FromRoute] int? maxHeight,
|
|
|
|
|
[FromRoute] double? percentPlayed,
|
|
|
|
|
[FromRoute] int? unplayedCount,
|
|
|
|
|
[FromRoute][Required] string name,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] string tag,
|
|
|
|
|
[FromRoute][Required] string format,
|
|
|
|
|
[FromRoute][Required] int? maxWidth,
|
|
|
|
|
[FromRoute][Required] int? maxHeight,
|
|
|
|
|
[FromRoute][Required] double? percentPlayed,
|
|
|
|
|
[FromRoute][Required] int? unplayedCount,
|
|
|
|
|
[FromQuery] int? width,
|
|
|
|
|
[FromQuery] int? height,
|
|
|
|
|
[FromQuery] int? quality,
|
|
|
|
@ -836,7 +836,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[FromQuery] int? blur,
|
|
|
|
|
[FromQuery] string? backgroundColor,
|
|
|
|
|
[FromQuery] string? foregroundLayer,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var item = _libraryManager.GetStudio(name);
|
|
|
|
|
if (item == null)
|
|
|
|
@ -898,8 +898,8 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
|
public async Task<ActionResult> GetUserImage(
|
|
|
|
|
[FromRoute] Guid userId,
|
|
|
|
|
[FromRoute] ImageType imageType,
|
|
|
|
|
[FromRoute][Required] Guid userId,
|
|
|
|
|
[FromRoute][Required] ImageType imageType,
|
|
|
|
|
[FromQuery] string? tag,
|
|
|
|
|
[FromQuery] string? format,
|
|
|
|
|
[FromQuery] int? maxWidth,
|
|
|
|
@ -914,7 +914,7 @@ namespace Jellyfin.Api.Controllers
|
|
|
|
|
[FromQuery] int? blur,
|
|
|
|
|
[FromQuery] string? backgroundColor,
|
|
|
|
|
[FromQuery] string? foregroundLayer,
|
|
|
|
|
[FromRoute] int? imageIndex = null)
|
|
|
|
|
[FromRoute][Required] int? imageIndex = null)
|
|
|
|
|
{
|
|
|
|
|
var user = _userManager.GetUserById(userId);
|
|
|
|
|
if (user == null)
|
|
|
|
|