The Free Software Media System - Server Backend & API
fixes #1356 - [BUG] .mkv that stream copies, cannot be played without transcoding option turned on for user
Luke Pulverenti2fffbc2db029
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.csindex 0f58a9db82..421ccdb5d0 100644--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs@@ -962,6 +962,21 @@ namespace MediaBrowser.Api.Playbackawait AcquireResources(state, cancellationTokenSource).ConfigureAwait(false);+ if (state.VideoRequest != null && !string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))+ {+ var auth = AuthorizationContext.GetAuthorizationInfo(Request);+ if (!string.IsNullOrWhiteSpace(auth.UserId))+ {+ var user = UserManager.GetUserById(auth.UserId);+ if (!user.Policy.EnableVideoPlaybackTranscoding)+ {+ ApiEntryPoint.Instance.OnTranscodeFailedToStart(outputPath, TranscodingJobType, state);++ throw new ArgumentException("User does not have access to video transcoding");+ }+ }+ }+var transcodingId = Guid.NewGuid().ToString("N");var commandLineArgs = GetCommandLineArguments(outputPath, state, true);diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.csindex a47fcdf4f8..0ef7efe1b8 100644--- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs+++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs@@ -175,13 +175,6 @@ namespace MediaBrowser.Server.Implementations.Librarysource.SupportsTranscoding = false;}}- else if (string.Equals(item.MediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase))- {- if (!user.Policy.EnableVideoPlaybackTranscoding)- {- source.SupportsTranscoding = false;- }- }}}