mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
Merge pull request #5375 from crobibero/default-api-value
Specify defaults or set query parameter to nullable
(cherry picked from commit a0f6bc14a2)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua M. Boniface
parent
046dd7fa60
commit
e4bf57c739
@@ -152,7 +152,7 @@ namespace Jellyfin.Api.Controllers
|
||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||
[HttpPost("Sessions/Playing/Ping")]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public ActionResult PingPlaybackSession([FromQuery] string playSessionId)
|
||||
public ActionResult PingPlaybackSession([FromQuery, Required] string playSessionId)
|
||||
{
|
||||
_transcodingJobHelper.PingTranscodingJob(playSessionId, null);
|
||||
return NoContent();
|
||||
@@ -202,9 +202,9 @@ namespace Jellyfin.Api.Controllers
|
||||
[FromQuery] string? mediaSourceId,
|
||||
[FromQuery] int? audioStreamIndex,
|
||||
[FromQuery] int? subtitleStreamIndex,
|
||||
[FromQuery] PlayMethod playMethod,
|
||||
[FromQuery] PlayMethod? playMethod,
|
||||
[FromQuery] string? liveStreamId,
|
||||
[FromQuery] string playSessionId,
|
||||
[FromQuery] string? playSessionId,
|
||||
[FromQuery] bool canSeek = false)
|
||||
{
|
||||
var playbackStartInfo = new PlaybackStartInfo
|
||||
@@ -214,7 +214,7 @@ namespace Jellyfin.Api.Controllers
|
||||
MediaSourceId = mediaSourceId,
|
||||
AudioStreamIndex = audioStreamIndex,
|
||||
SubtitleStreamIndex = subtitleStreamIndex,
|
||||
PlayMethod = playMethod,
|
||||
PlayMethod = playMethod ?? PlayMethod.Transcode,
|
||||
PlaySessionId = playSessionId,
|
||||
LiveStreamId = liveStreamId
|
||||
};
|
||||
@@ -254,10 +254,10 @@ namespace Jellyfin.Api.Controllers
|
||||
[FromQuery] int? audioStreamIndex,
|
||||
[FromQuery] int? subtitleStreamIndex,
|
||||
[FromQuery] int? volumeLevel,
|
||||
[FromQuery] PlayMethod playMethod,
|
||||
[FromQuery] PlayMethod? playMethod,
|
||||
[FromQuery] string? liveStreamId,
|
||||
[FromQuery] string playSessionId,
|
||||
[FromQuery] RepeatMode repeatMode,
|
||||
[FromQuery] string? playSessionId,
|
||||
[FromQuery] RepeatMode? repeatMode,
|
||||
[FromQuery] bool isPaused = false,
|
||||
[FromQuery] bool isMuted = false)
|
||||
{
|
||||
@@ -271,10 +271,10 @@ namespace Jellyfin.Api.Controllers
|
||||
AudioStreamIndex = audioStreamIndex,
|
||||
SubtitleStreamIndex = subtitleStreamIndex,
|
||||
VolumeLevel = volumeLevel,
|
||||
PlayMethod = playMethod,
|
||||
PlayMethod = playMethod ?? PlayMethod.Transcode,
|
||||
PlaySessionId = playSessionId,
|
||||
LiveStreamId = liveStreamId,
|
||||
RepeatMode = repeatMode
|
||||
RepeatMode = repeatMode ?? RepeatMode.RepeatNone
|
||||
};
|
||||
|
||||
playbackProgressInfo.PlayMethod = ValidatePlayMethod(playbackProgressInfo.PlayMethod, playbackProgressInfo.PlaySessionId);
|
||||
@@ -352,7 +352,7 @@ namespace Jellyfin.Api.Controllers
|
||||
return _userDataRepository.GetUserDataDto(item, user);
|
||||
}
|
||||
|
||||
private PlayMethod ValidatePlayMethod(PlayMethod method, string playSessionId)
|
||||
private PlayMethod ValidatePlayMethod(PlayMethod method, string? playSessionId)
|
||||
{
|
||||
if (method == PlayMethod.Transcode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user