resolve mono build failure

This commit is contained in:
Luke Pulverenti
2016-11-10 16:06:00 -05:00
parent 9b891f2c9a
commit abb7bb4fd2
9 changed files with 73 additions and 38 deletions

View File

@@ -7,6 +7,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
@@ -179,7 +180,7 @@ namespace MediaBrowser.Api.Images
/// </summary>
/// <param name="request">The request.</param>
/// <returns>System.Object.</returns>
public object Get(GetGeneralImage request)
public Task<object> Get(GetGeneralImage request)
{
var filename = string.Equals(request.Type, "primary", StringComparison.OrdinalIgnoreCase)
? "folder"
@@ -238,7 +239,7 @@ namespace MediaBrowser.Api.Images
/// </summary>
/// <param name="request">The request.</param>
/// <returns>System.Object.</returns>
public object Get(GetMediaInfoImage request)
public Task<object> Get(GetMediaInfoImage request)
{
var themeFolder = Path.Combine(_appPaths.MediaInfoImagesPath, request.Theme);

View File

@@ -421,7 +421,7 @@ namespace MediaBrowser.Api.Playback.Hls
// If all transcoding has completed, just return immediately
if (transcodingJob != null && transcodingJob.HasExited && FileSystem.FileExists(segmentPath))
{
return GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob);
return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false);
}
var segmentFilename = Path.GetFileName(segmentPath);
@@ -441,7 +441,7 @@ namespace MediaBrowser.Api.Playback.Hls
{
if (FileSystem.FileExists(segmentPath))
{
return GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob);
return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false);
}
//break;
}
@@ -457,10 +457,10 @@ namespace MediaBrowser.Api.Playback.Hls
}
cancellationToken.ThrowIfCancellationRequested();
return GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob);
return await GetSegmentResult(state, segmentPath, segmentIndex, transcodingJob).ConfigureAwait(false);
}
private object GetSegmentResult(StreamState state, string segmentPath, int index, TranscodingJob transcodingJob)
private Task<object> GetSegmentResult(StreamState state, string segmentPath, int index, TranscodingJob transcodingJob)
{
var segmentEndingPositionTicks = GetEndPositionTicks(state, index);
@@ -476,7 +476,7 @@ namespace MediaBrowser.Api.Playback.Hls
ApiEntryPoint.Instance.OnTranscodeEndRequest(transcodingJob);
}
}
}).Result;
});
}
private async Task<object> GetMasterPlaylistInternal(StreamRequest request, string method)

View File

@@ -124,13 +124,13 @@ namespace MediaBrowser.Api.Playback.Hls
/// </summary>
/// <param name="request">The request.</param>
/// <returns>System.Object.</returns>
public object Get(GetHlsAudioSegmentLegacy request)
public Task<object> Get(GetHlsAudioSegmentLegacy request)
{
// TODO: Deprecate with new iOS app
var file = request.SegmentId + Path.GetExtension(Request.PathInfo);
file = Path.Combine(_appPaths.TranscodingTempPath, file);
return ResultFactory.GetStaticFileResult(Request, file, FileShareMode.ReadWrite).Result;
return ResultFactory.GetStaticFileResult(Request, file, FileShareMode.ReadWrite);
}
private Task<object> GetFileResult(string path, string playlistPath)

View File

@@ -146,14 +146,14 @@ namespace MediaBrowser.Api.Social
{
if (image.IsLocalFile)
{
return _resultFactory.GetStaticFileResult(Request, image.Path);
return await _resultFactory.GetStaticFileResult(Request, image.Path).ConfigureAwait(false);
}
try
{
// Don't fail the request over this
var updatedImage = await _libraryManager.ConvertImageToLocal(item, image, 0).ConfigureAwait(false);
return _resultFactory.GetStaticFileResult(Request, updatedImage.Path);
return await _resultFactory.GetStaticFileResult(Request, updatedImage.Path).ConfigureAwait(false);
}
catch
{