diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-16 13:06:31 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-10-16 13:06:31 -0400 |
| commit | d577e1c7b01c45bca49cb47a1af3697f904f9e4d (patch) | |
| tree | 4cc6fd08f7181722287de5041d944660b760d8a8 /MediaBrowser.Api/Social/SharingService.cs | |
| parent | 3741eb24263de151a57e66dd6770fc82f69fe9c4 (diff) | |
support image stubbing
Diffstat (limited to 'MediaBrowser.Api/Social/SharingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Social/SharingService.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/MediaBrowser.Api/Social/SharingService.cs b/MediaBrowser.Api/Social/SharingService.cs index 608008455..7d61c24ec 100644 --- a/MediaBrowser.Api/Social/SharingService.cs +++ b/MediaBrowser.Api/Social/SharingService.cs @@ -124,7 +124,7 @@ namespace MediaBrowser.Api.Social Task.WaitAll(task); } - public object Get(GetShareImage request) + public async Task<object> Get(GetShareImage request) { var share = _sharingManager.GetShareInfo(request.Id); @@ -143,7 +143,21 @@ namespace MediaBrowser.Api.Social if (image != null) { - return ToStaticFileResult(image.Path); + if (image.IsLocalFile) + { + return ToStaticFileResult(image.Path); + } + + try + { + // Don't fail the request over this + var updatedImage = await _libraryManager.ConvertImageToLocal(item, image, 0).ConfigureAwait(false); + return ToStaticFileResult(updatedImage.Path); + } + catch + { + + } } // Grab a dlna icon if nothing else is available |
