diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 7468b0b63..793066f32 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1710,7 +1710,7 @@ namespace MediaBrowser.Api.Playback } else { - var mediaSources = await MediaSourceManager.GetPlayackMediaSources(request.Id, cancellationToken).ConfigureAwait(false); + var mediaSources = await MediaSourceManager.GetPlayackMediaSources(request.Id, false, cancellationToken).ConfigureAwait(false); var mediaSource = string.IsNullOrEmpty(request.MediaSourceId) ? mediaSources.First() diff --git a/MediaBrowser.Api/Playback/MediaInfoService.cs b/MediaBrowser.Api/Playback/MediaInfoService.cs index 96958487b..e2d3caf5e 100644 --- a/MediaBrowser.Api/Playback/MediaInfoService.cs +++ b/MediaBrowser.Api/Playback/MediaInfoService.cs @@ -40,7 +40,7 @@ namespace MediaBrowser.Api.Playback public async Task Get(GetPlaybackInfo request) { - var mediaSources = await _mediaSourceManager.GetPlayackMediaSources(request.Id, request.UserId, CancellationToken.None).ConfigureAwait(false); + var mediaSources = await _mediaSourceManager.GetPlayackMediaSources(request.Id, request.UserId, true, CancellationToken.None).ConfigureAwait(false); return ToOptimizedResult(new LiveMediaInfoResult { @@ -50,7 +50,7 @@ namespace MediaBrowser.Api.Playback public async Task Get(GetLiveMediaInfo request) { - var mediaSources = await _mediaSourceManager.GetPlayackMediaSources(request.Id, request.UserId, CancellationToken.None).ConfigureAwait(false); + var mediaSources = await _mediaSourceManager.GetPlayackMediaSources(request.Id, request.UserId, true, CancellationToken.None).ConfigureAwait(false); return ToOptimizedResult(new LiveMediaInfoResult { diff --git a/MediaBrowser.Controller/Library/IMediaSourceManager.cs b/MediaBrowser.Controller/Library/IMediaSourceManager.cs index 58bcf6cff..c21fed6fc 100644 --- a/MediaBrowser.Controller/Library/IMediaSourceManager.cs +++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs @@ -41,17 +41,19 @@ namespace MediaBrowser.Controller.Library /// /// The identifier. /// The user identifier. + /// if set to true [enable path substitution]. /// The cancellation token. /// IEnumerable<MediaSourceInfo>. - Task> GetPlayackMediaSources(string id, string userId, CancellationToken cancellationToken); + Task> GetPlayackMediaSources(string id, string userId, bool enablePathSubstitution, CancellationToken cancellationToken); /// /// Gets the playack media sources. /// /// The identifier. + /// if set to true [enable path substitution]. /// The cancellation token. /// Task<IEnumerable<MediaSourceInfo>>. - Task> GetPlayackMediaSources(string id, CancellationToken cancellationToken); + Task> GetPlayackMediaSources(string id, bool enablePathSubstitution, CancellationToken cancellationToken); /// /// Gets the static media sources. diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs index 916174c4b..c5783e188 100644 --- a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs +++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs @@ -116,7 +116,7 @@ namespace MediaBrowser.MediaEncoding.Encoder } else { - var mediaSources = await _mediaSourceManager.GetPlayackMediaSources(request.ItemId, cancellationToken).ConfigureAwait(false); + var mediaSources = await _mediaSourceManager.GetPlayackMediaSources(request.ItemId, false, cancellationToken).ConfigureAwait(false); var mediaSource = string.IsNullOrEmpty(request.MediaSourceId) ? mediaSources.First() diff --git a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs index 746f978ea..719c984bd 100644 --- a/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs +++ b/MediaBrowser.Server.Implementations/Library/MediaSourceManager.cs @@ -125,7 +125,7 @@ namespace MediaBrowser.Server.Implementations.Library return list; } - public async Task> GetPlayackMediaSources(string id, string userId, CancellationToken cancellationToken) + public async Task> GetPlayackMediaSources(string id, string userId, bool enablePathSubstitution, CancellationToken cancellationToken) { var item = _libraryManager.GetItemById(id); IEnumerable mediaSources; @@ -142,12 +142,12 @@ namespace MediaBrowser.Server.Implementations.Library { if (string.IsNullOrWhiteSpace(userId)) { - mediaSources = hasMediaSources.GetMediaSources(true); + mediaSources = hasMediaSources.GetMediaSources(enablePathSubstitution); } else { var user = _userManager.GetUserById(userId); - mediaSources = GetStaticMediaSources(hasMediaSources, true, user); + mediaSources = GetStaticMediaSources(hasMediaSources, enablePathSubstitution, user); } } @@ -187,9 +187,9 @@ namespace MediaBrowser.Server.Implementations.Library } } - public Task> GetPlayackMediaSources(string id, CancellationToken cancellationToken) + public Task> GetPlayackMediaSources(string id, bool enablePathSubstitution, CancellationToken cancellationToken) { - return GetPlayackMediaSources(id, null, cancellationToken); + return GetPlayackMediaSources(id, null, enablePathSubstitution, cancellationToken); } public IEnumerable GetStaticMediaSources(IHasMediaSources item, bool enablePathSubstitution)