Merge pull request #5375 from crobibero/default-api-value

Specify defaults or set query parameter to nullable
pull/5382/head
Bond-009 4 years ago committed by GitHub
commit a0f6bc14a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -122,7 +122,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -174,7 +174,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -287,7 +287,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -339,7 +339,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,

@ -203,7 +203,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -218,7 +218,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions, [FromQuery] Dictionary<string, string> streamOptions,
[FromQuery] bool enableAdaptiveBitrateStreaming = true) [FromQuery] bool enableAdaptiveBitrateStreaming = true)
{ {
@ -255,7 +255,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -270,7 +270,7 @@ namespace Jellyfin.Api.Controllers
TranscodeReasons = transcodeReasons, TranscodeReasons = transcodeReasons,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
VideoStreamIndex = videoStreamIndex, VideoStreamIndex = videoStreamIndex,
Context = context, Context = context ?? EncodingContext.Streaming,
StreamOptions = streamOptions, StreamOptions = streamOptions,
EnableAdaptiveBitrateStreaming = enableAdaptiveBitrateStreaming EnableAdaptiveBitrateStreaming = enableAdaptiveBitrateStreaming
}; };
@ -370,7 +370,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -385,7 +385,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions, [FromQuery] Dictionary<string, string> streamOptions,
[FromQuery] bool enableAdaptiveBitrateStreaming = true) [FromQuery] bool enableAdaptiveBitrateStreaming = true)
{ {
@ -422,7 +422,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -437,7 +437,7 @@ namespace Jellyfin.Api.Controllers
TranscodeReasons = transcodeReasons, TranscodeReasons = transcodeReasons,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
VideoStreamIndex = videoStreamIndex, VideoStreamIndex = videoStreamIndex,
Context = context, Context = context ?? EncodingContext.Streaming,
StreamOptions = streamOptions, StreamOptions = streamOptions,
EnableAdaptiveBitrateStreaming = enableAdaptiveBitrateStreaming EnableAdaptiveBitrateStreaming = enableAdaptiveBitrateStreaming
}; };
@ -533,7 +533,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -548,7 +548,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions) [FromQuery] Dictionary<string, string> streamOptions)
{ {
var cancellationTokenSource = new CancellationTokenSource(); var cancellationTokenSource = new CancellationTokenSource();
@ -585,7 +585,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -600,7 +600,7 @@ namespace Jellyfin.Api.Controllers
TranscodeReasons = transcodeReasons, TranscodeReasons = transcodeReasons,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
VideoStreamIndex = videoStreamIndex, VideoStreamIndex = videoStreamIndex,
Context = context, Context = context ?? EncodingContext.Streaming,
StreamOptions = streamOptions StreamOptions = streamOptions
}; };
@ -698,7 +698,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -713,7 +713,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions) [FromQuery] Dictionary<string, string> streamOptions)
{ {
var cancellationTokenSource = new CancellationTokenSource(); var cancellationTokenSource = new CancellationTokenSource();
@ -750,7 +750,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -765,7 +765,7 @@ namespace Jellyfin.Api.Controllers
TranscodeReasons = transcodeReasons, TranscodeReasons = transcodeReasons,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
VideoStreamIndex = videoStreamIndex, VideoStreamIndex = videoStreamIndex,
Context = context, Context = context ?? EncodingContext.Streaming,
StreamOptions = streamOptions StreamOptions = streamOptions
}; };
@ -868,7 +868,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -883,7 +883,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions) [FromQuery] Dictionary<string, string> streamOptions)
{ {
var streamingRequest = new VideoRequestDto var streamingRequest = new VideoRequestDto
@ -920,7 +920,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -935,7 +935,7 @@ namespace Jellyfin.Api.Controllers
TranscodeReasons = transcodeReasons, TranscodeReasons = transcodeReasons,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
VideoStreamIndex = videoStreamIndex, VideoStreamIndex = videoStreamIndex,
Context = context, Context = context ?? EncodingContext.Streaming,
StreamOptions = streamOptions StreamOptions = streamOptions
}; };
@ -1040,7 +1040,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -1055,7 +1055,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions) [FromQuery] Dictionary<string, string> streamOptions)
{ {
var streamingRequest = new StreamingRequestDto var streamingRequest = new StreamingRequestDto
@ -1092,7 +1092,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -1107,7 +1107,7 @@ namespace Jellyfin.Api.Controllers
TranscodeReasons = transcodeReasons, TranscodeReasons = transcodeReasons,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
VideoStreamIndex = videoStreamIndex, VideoStreamIndex = videoStreamIndex,
Context = context, Context = context ?? EncodingContext.Streaming,
StreamOptions = streamOptions StreamOptions = streamOptions
}; };

@ -96,7 +96,9 @@ namespace Jellyfin.Api.Controllers
[HttpDelete("Videos/ActiveEncodings")] [HttpDelete("Videos/ActiveEncodings")]
[Authorize(Policy = Policies.DefaultAuthorization)] [Authorize(Policy = Policies.DefaultAuthorization)]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
public ActionResult StopEncodingProcess([FromQuery] string deviceId, [FromQuery] string playSessionId) public ActionResult StopEncodingProcess(
[FromQuery, Required] string deviceId,
[FromQuery, Required] string playSessionId)
{ {
_transcodingJobHelper.KillTranscodingJobs(deviceId, playSessionId, path => true); _transcodingJobHelper.KillTranscodingJobs(deviceId, playSessionId, path => true);
return NoContent(); return NoContent();

@ -392,7 +392,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] Guid itemId, [FromRoute, Required] Guid itemId,
[FromRoute, Required] ImageType imageType, [FromRoute, Required] ImageType imageType,
[FromRoute, Required] int imageIndex, [FromRoute, Required] int imageIndex,
[FromQuery] int newIndex) [FromQuery, Required] int newIndex)
{ {
var item = _libraryManager.GetItemById(itemId); var item = _libraryManager.GetItemById(itemId);
if (item == null) if (item == null)
@ -741,7 +741,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult> GetArtistImage( public async Task<ActionResult> GetArtistImage(
[FromRoute, Required] string name, [FromRoute, Required] string name,
[FromRoute, Required] ImageType imageType, [FromRoute, Required] ImageType imageType,
[FromQuery] string tag, [FromQuery] string? tag,
[FromQuery] ImageFormat? format, [FromQuery] ImageFormat? format,
[FromQuery] int? maxWidth, [FromQuery] int? maxWidth,
[FromQuery] int? maxHeight, [FromQuery] int? maxHeight,
@ -820,7 +820,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult> GetGenreImage( public async Task<ActionResult> GetGenreImage(
[FromRoute, Required] string name, [FromRoute, Required] string name,
[FromRoute, Required] ImageType imageType, [FromRoute, Required] ImageType imageType,
[FromQuery] string tag, [FromQuery] string? tag,
[FromQuery] ImageFormat? format, [FromQuery] ImageFormat? format,
[FromQuery] int? maxWidth, [FromQuery] int? maxWidth,
[FromQuery] int? maxHeight, [FromQuery] int? maxHeight,
@ -900,7 +900,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] string name, [FromRoute, Required] string name,
[FromRoute, Required] ImageType imageType, [FromRoute, Required] ImageType imageType,
[FromRoute, Required] int imageIndex, [FromRoute, Required] int imageIndex,
[FromQuery] string tag, [FromQuery] string? tag,
[FromQuery] ImageFormat? format, [FromQuery] ImageFormat? format,
[FromQuery] int? maxWidth, [FromQuery] int? maxWidth,
[FromQuery] int? maxHeight, [FromQuery] int? maxHeight,
@ -978,7 +978,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult> GetMusicGenreImage( public async Task<ActionResult> GetMusicGenreImage(
[FromRoute, Required] string name, [FromRoute, Required] string name,
[FromRoute, Required] ImageType imageType, [FromRoute, Required] ImageType imageType,
[FromQuery] string tag, [FromQuery] string? tag,
[FromQuery] ImageFormat? format, [FromQuery] ImageFormat? format,
[FromQuery] int? maxWidth, [FromQuery] int? maxWidth,
[FromQuery] int? maxHeight, [FromQuery] int? maxHeight,
@ -1058,7 +1058,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] string name, [FromRoute, Required] string name,
[FromRoute, Required] ImageType imageType, [FromRoute, Required] ImageType imageType,
[FromRoute, Required] int imageIndex, [FromRoute, Required] int imageIndex,
[FromQuery] string tag, [FromQuery] string? tag,
[FromQuery] ImageFormat? format, [FromQuery] ImageFormat? format,
[FromQuery] int? maxWidth, [FromQuery] int? maxWidth,
[FromQuery] int? maxHeight, [FromQuery] int? maxHeight,
@ -1136,7 +1136,7 @@ namespace Jellyfin.Api.Controllers
public async Task<ActionResult> GetPersonImage( public async Task<ActionResult> GetPersonImage(
[FromRoute, Required] string name, [FromRoute, Required] string name,
[FromRoute, Required] ImageType imageType, [FromRoute, Required] ImageType imageType,
[FromQuery] string tag, [FromQuery] string? tag,
[FromQuery] ImageFormat? format, [FromQuery] ImageFormat? format,
[FromQuery] int? maxWidth, [FromQuery] int? maxWidth,
[FromQuery] int? maxHeight, [FromQuery] int? maxHeight,
@ -1216,7 +1216,7 @@ namespace Jellyfin.Api.Controllers
[FromRoute, Required] string name, [FromRoute, Required] string name,
[FromRoute, Required] ImageType imageType, [FromRoute, Required] ImageType imageType,
[FromRoute, Required] int imageIndex, [FromRoute, Required] int imageIndex,
[FromQuery] string tag, [FromQuery] string? tag,
[FromQuery] ImageFormat? format, [FromQuery] ImageFormat? format,
[FromQuery] int? maxWidth, [FromQuery] int? maxWidth,
[FromQuery] int? maxHeight, [FromQuery] int? maxHeight,

@ -195,7 +195,7 @@ namespace Jellyfin.Api.Controllers
[HttpPost("Items/{itemId}/ContentType")] [HttpPost("Items/{itemId}/ContentType")]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status404NotFound)]
public ActionResult UpdateItemContentType([FromRoute, Required] Guid itemId, [FromQuery] string contentType) public ActionResult UpdateItemContentType([FromRoute, Required] Guid itemId, [FromQuery] string? contentType)
{ {
var item = _libraryManager.GetItemById(itemId); var item = _libraryManager.GetItemById(itemId);
if (item == null) if (item == null)

@ -777,7 +777,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<LibraryOptionsResultDto> GetLibraryOptionsInfo( public ActionResult<LibraryOptionsResultDto> GetLibraryOptionsInfo(
[FromQuery] string? libraryContentType, [FromQuery] string? libraryContentType,
[FromQuery] bool isNewLibrary) [FromQuery] bool isNewLibrary = false)
{ {
var result = new LibraryOptionsResultDto(); var result = new LibraryOptionsResultDto();

@ -152,7 +152,7 @@ namespace Jellyfin.Api.Controllers
/// <returns>A <see cref="NoContentResult"/>.</returns> /// <returns>A <see cref="NoContentResult"/>.</returns>
[HttpPost("Sessions/Playing/Ping")] [HttpPost("Sessions/Playing/Ping")]
[ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status204NoContent)]
public ActionResult PingPlaybackSession([FromQuery] string playSessionId) public ActionResult PingPlaybackSession([FromQuery, Required] string playSessionId)
{ {
_transcodingJobHelper.PingTranscodingJob(playSessionId, null); _transcodingJobHelper.PingTranscodingJob(playSessionId, null);
return NoContent(); return NoContent();
@ -202,9 +202,9 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? mediaSourceId, [FromQuery] string? mediaSourceId,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] PlayMethod playMethod, [FromQuery] PlayMethod? playMethod,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] string playSessionId, [FromQuery] string? playSessionId,
[FromQuery] bool canSeek = false) [FromQuery] bool canSeek = false)
{ {
var playbackStartInfo = new PlaybackStartInfo var playbackStartInfo = new PlaybackStartInfo
@ -214,7 +214,7 @@ namespace Jellyfin.Api.Controllers
MediaSourceId = mediaSourceId, MediaSourceId = mediaSourceId,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
PlayMethod = playMethod, PlayMethod = playMethod ?? PlayMethod.Transcode,
PlaySessionId = playSessionId, PlaySessionId = playSessionId,
LiveStreamId = liveStreamId LiveStreamId = liveStreamId
}; };
@ -254,10 +254,10 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] int? volumeLevel, [FromQuery] int? volumeLevel,
[FromQuery] PlayMethod playMethod, [FromQuery] PlayMethod? playMethod,
[FromQuery] string? liveStreamId, [FromQuery] string? liveStreamId,
[FromQuery] string playSessionId, [FromQuery] string? playSessionId,
[FromQuery] RepeatMode repeatMode, [FromQuery] RepeatMode? repeatMode,
[FromQuery] bool isPaused = false, [FromQuery] bool isPaused = false,
[FromQuery] bool isMuted = false) [FromQuery] bool isMuted = false)
{ {
@ -271,10 +271,10 @@ namespace Jellyfin.Api.Controllers
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
VolumeLevel = volumeLevel, VolumeLevel = volumeLevel,
PlayMethod = playMethod, PlayMethod = playMethod ?? PlayMethod.Transcode,
PlaySessionId = playSessionId, PlaySessionId = playSessionId,
LiveStreamId = liveStreamId, LiveStreamId = liveStreamId,
RepeatMode = repeatMode RepeatMode = repeatMode ?? RepeatMode.RepeatNone
}; };
playbackProgressInfo.PlayMethod = ValidatePlayMethod(playbackProgressInfo.PlayMethod, playbackProgressInfo.PlaySessionId); playbackProgressInfo.PlayMethod = ValidatePlayMethod(playbackProgressInfo.PlayMethod, playbackProgressInfo.PlaySessionId);
@ -352,7 +352,7 @@ namespace Jellyfin.Api.Controllers
return _userDataRepository.GetUserDataDto(item, user); return _userDataRepository.GetUserDataDto(item, user);
} }
private PlayMethod ValidatePlayMethod(PlayMethod method, string playSessionId) private PlayMethod ValidatePlayMethod(PlayMethod method, string? playSessionId)
{ {
if (method == PlayMethod.Transcode) if (method == PlayMethod.Transcode)
{ {

@ -112,7 +112,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? maxAudioSampleRate, [FromQuery] int? maxAudioSampleRate,
[FromQuery] int? maxAudioBitDepth, [FromQuery] int? maxAudioBitDepth,
[FromQuery] bool? enableRemoteMedia, [FromQuery] bool? enableRemoteMedia,
[FromQuery] bool breakOnNonKeyFrames, [FromQuery] bool breakOnNonKeyFrames = false,
[FromQuery] bool enableRedirection = true) [FromQuery] bool enableRedirection = true)
{ {
var deviceProfile = GetDeviceProfile(container, transcodingContainer, audioCodec, transcodingProtocol, breakOnNonKeyFrames, transcodingAudioChannels, maxAudioSampleRate, maxAudioBitDepth, maxAudioChannels); var deviceProfile = GetDeviceProfile(container, transcodingContainer, audioCodec, transcodingProtocol, breakOnNonKeyFrames, transcodingAudioChannels, maxAudioSampleRate, maxAudioBitDepth, maxAudioChannels);

@ -198,7 +198,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -213,7 +213,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions, [FromQuery] Dictionary<string, string> streamOptions,
[FromQuery] int? maxWidth, [FromQuery] int? maxWidth,
[FromQuery] int? maxHeight, [FromQuery] int? maxHeight,
@ -253,7 +253,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -268,7 +268,7 @@ namespace Jellyfin.Api.Controllers
TranscodeReasons = transcodeReasons, TranscodeReasons = transcodeReasons,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
VideoStreamIndex = videoStreamIndex, VideoStreamIndex = videoStreamIndex,
Context = context, Context = context ?? EncodingContext.Streaming,
StreamOptions = streamOptions, StreamOptions = streamOptions,
MaxHeight = maxHeight, MaxHeight = maxHeight,
MaxWidth = maxWidth, MaxWidth = maxWidth,

@ -364,7 +364,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -379,7 +379,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions) [FromQuery] Dictionary<string, string> streamOptions)
{ {
var isHeadRequest = Request.Method == System.Net.WebRequestMethods.Http.Head; var isHeadRequest = Request.Method == System.Net.WebRequestMethods.Http.Head;
@ -418,7 +418,7 @@ namespace Jellyfin.Api.Controllers
Height = height, Height = height,
VideoBitRate = videoBitRate, VideoBitRate = videoBitRate,
SubtitleStreamIndex = subtitleStreamIndex, SubtitleStreamIndex = subtitleStreamIndex,
SubtitleMethod = subtitleMethod, SubtitleMethod = subtitleMethod ?? SubtitleDeliveryMethod.Encode,
MaxRefFrames = maxRefFrames, MaxRefFrames = maxRefFrames,
MaxVideoBitDepth = maxVideoBitDepth, MaxVideoBitDepth = maxVideoBitDepth,
RequireAvc = requireAvc ?? true, RequireAvc = requireAvc ?? true,
@ -433,7 +433,7 @@ namespace Jellyfin.Api.Controllers
TranscodeReasons = transcodeReasons, TranscodeReasons = transcodeReasons,
AudioStreamIndex = audioStreamIndex, AudioStreamIndex = audioStreamIndex,
VideoStreamIndex = videoStreamIndex, VideoStreamIndex = videoStreamIndex,
Context = context, Context = context ?? EncodingContext.Streaming,
StreamOptions = streamOptions StreamOptions = streamOptions
}; };
@ -620,7 +620,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] int? height, [FromQuery] int? height,
[FromQuery] int? videoBitRate, [FromQuery] int? videoBitRate,
[FromQuery] int? subtitleStreamIndex, [FromQuery] int? subtitleStreamIndex,
[FromQuery] SubtitleDeliveryMethod subtitleMethod, [FromQuery] SubtitleDeliveryMethod? subtitleMethod,
[FromQuery] int? maxRefFrames, [FromQuery] int? maxRefFrames,
[FromQuery] int? maxVideoBitDepth, [FromQuery] int? maxVideoBitDepth,
[FromQuery] bool? requireAvc, [FromQuery] bool? requireAvc,
@ -635,7 +635,7 @@ namespace Jellyfin.Api.Controllers
[FromQuery] string? transcodeReasons, [FromQuery] string? transcodeReasons,
[FromQuery] int? audioStreamIndex, [FromQuery] int? audioStreamIndex,
[FromQuery] int? videoStreamIndex, [FromQuery] int? videoStreamIndex,
[FromQuery] EncodingContext context, [FromQuery] EncodingContext? context,
[FromQuery] Dictionary<string, string> streamOptions) [FromQuery] Dictionary<string, string> streamOptions)
{ {
return GetVideoStream( return GetVideoStream(

Loading…
Cancel
Save