aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Social/SharingService.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-10-16 13:06:31 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-10-16 13:06:31 -0400
commitd577e1c7b01c45bca49cb47a1af3697f904f9e4d (patch)
tree4cc6fd08f7181722287de5041d944660b760d8a8 /MediaBrowser.Api/Social/SharingService.cs
parent3741eb24263de151a57e66dd6770fc82f69fe9c4 (diff)
support image stubbing
Diffstat (limited to 'MediaBrowser.Api/Social/SharingService.cs')
-rw-r--r--MediaBrowser.Api/Social/SharingService.cs18
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