don't apply path substitution when transcoding

pull/702/head
Luke Pulverenti 10 years ago
parent afeafd9444
commit fede730dc1

@ -1710,7 +1710,7 @@ namespace MediaBrowser.Api.Playback
} }
else 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) var mediaSource = string.IsNullOrEmpty(request.MediaSourceId)
? mediaSources.First() ? mediaSources.First()

@ -40,7 +40,7 @@ namespace MediaBrowser.Api.Playback
public async Task<object> Get(GetPlaybackInfo request) public async Task<object> 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 return ToOptimizedResult(new LiveMediaInfoResult
{ {
@ -50,7 +50,7 @@ namespace MediaBrowser.Api.Playback
public async Task<object> Get(GetLiveMediaInfo request) public async Task<object> 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 return ToOptimizedResult(new LiveMediaInfoResult
{ {

@ -41,17 +41,19 @@ namespace MediaBrowser.Controller.Library
/// </summary> /// </summary>
/// <param name="id">The identifier.</param> /// <param name="id">The identifier.</param>
/// <param name="userId">The user identifier.</param> /// <param name="userId">The user identifier.</param>
/// <param name="enablePathSubstitution">if set to <c>true</c> [enable path substitution].</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>IEnumerable&lt;MediaSourceInfo&gt;.</returns> /// <returns>IEnumerable&lt;MediaSourceInfo&gt;.</returns>
Task<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, string userId, CancellationToken cancellationToken); Task<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, string userId, bool enablePathSubstitution, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Gets the playack media sources. /// Gets the playack media sources.
/// </summary> /// </summary>
/// <param name="id">The identifier.</param> /// <param name="id">The identifier.</param>
/// <param name="enablePathSubstitution">if set to <c>true</c> [enable path substitution].</param>
/// <param name="cancellationToken">The cancellation token.</param> /// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;IEnumerable&lt;MediaSourceInfo&gt;&gt;.</returns> /// <returns>Task&lt;IEnumerable&lt;MediaSourceInfo&gt;&gt;.</returns>
Task<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, CancellationToken cancellationToken); Task<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, bool enablePathSubstitution, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Gets the static media sources. /// Gets the static media sources.

@ -116,7 +116,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
} }
else 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) var mediaSource = string.IsNullOrEmpty(request.MediaSourceId)
? mediaSources.First() ? mediaSources.First()

@ -125,7 +125,7 @@ namespace MediaBrowser.Server.Implementations.Library
return list; return list;
} }
public async Task<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, string userId, CancellationToken cancellationToken) public async Task<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, string userId, bool enablePathSubstitution, CancellationToken cancellationToken)
{ {
var item = _libraryManager.GetItemById(id); var item = _libraryManager.GetItemById(id);
IEnumerable<MediaSourceInfo> mediaSources; IEnumerable<MediaSourceInfo> mediaSources;
@ -142,12 +142,12 @@ namespace MediaBrowser.Server.Implementations.Library
{ {
if (string.IsNullOrWhiteSpace(userId)) if (string.IsNullOrWhiteSpace(userId))
{ {
mediaSources = hasMediaSources.GetMediaSources(true); mediaSources = hasMediaSources.GetMediaSources(enablePathSubstitution);
} }
else else
{ {
var user = _userManager.GetUserById(userId); 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<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, CancellationToken cancellationToken) public Task<IEnumerable<MediaSourceInfo>> GetPlayackMediaSources(string id, bool enablePathSubstitution, CancellationToken cancellationToken)
{ {
return GetPlayackMediaSources(id, null, cancellationToken); return GetPlayackMediaSources(id, null, enablePathSubstitution, cancellationToken);
} }
public IEnumerable<MediaSourceInfo> GetStaticMediaSources(IHasMediaSources item, bool enablePathSubstitution) public IEnumerable<MediaSourceInfo> GetStaticMediaSources(IHasMediaSources item, bool enablePathSubstitution)

Loading…
Cancel
Save