aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-06-03 11:26:39 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-06-03 11:26:39 -0400
commit5c5d7d034b0943d00c9f92085368e7a372462212 (patch)
tree29d74dbce2085234a4f834b109a2e59872c80c51
parent2771dd62891813c481c95ce662dd4b4678151689 (diff)
add more sync indicators
-rw-r--r--MediaBrowser.Api/Images/ImageService.cs12
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectManager.cs18
2 files changed, 20 insertions, 10 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs
index 8c6cc0a18..b8ea62137 100644
--- a/MediaBrowser.Api/Images/ImageService.cs
+++ b/MediaBrowser.Api/Images/ImageService.cs
@@ -675,10 +675,18 @@ namespace MediaBrowser.Api.Images
private ImageFormat[] GetClientSupportedFormats()
{
- if ((Request.AcceptTypes ?? new string[] { }).Contains("image/webp", StringComparer.OrdinalIgnoreCase))
+ var supportsWebP = (Request.AcceptTypes ?? new string[] {}).Contains("image/webp", StringComparer.OrdinalIgnoreCase);
+
+ var userAgent = Request.UserAgent ?? string.Empty;
+
+ if (userAgent.IndexOf("crosswalk", StringComparison.OrdinalIgnoreCase) != -1 &&
+ userAgent.IndexOf("android", StringComparison.OrdinalIgnoreCase) != -1)
{
- var userAgent = Request.UserAgent ?? string.Empty;
+ supportsWebP = true;
+ }
+ if (supportsWebP)
+ {
// Not displaying properly on iOS
if (userAgent.IndexOf("cfnetwork", StringComparison.OrdinalIgnoreCase) == -1)
{
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
index 048287faa..4569503c0 100644
--- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
+++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
@@ -376,6 +376,11 @@ namespace MediaBrowser.Server.Implementations.Connect
public async Task<UserLinkResult> LinkUser(string userId, string connectUsername)
{
+ if (string.IsNullOrWhiteSpace(ConnectServerId))
+ {
+ await UpdateConnectInfo().ConfigureAwait(false);
+ }
+
await _operationLock.WaitAsync().ConfigureAwait(false);
try
@@ -400,10 +405,6 @@ namespace MediaBrowser.Server.Implementations.Connect
}
if (string.IsNullOrWhiteSpace(ConnectServerId))
{
- await UpdateConnectInfo().ConfigureAwait(false);
- }
- if (string.IsNullOrWhiteSpace(ConnectServerId))
- {
throw new ArgumentNullException("ConnectServerId");
}
@@ -474,6 +475,11 @@ namespace MediaBrowser.Server.Implementations.Connect
public async Task<UserLinkResult> InviteUser(ConnectAuthorizationRequest request)
{
+ if (string.IsNullOrWhiteSpace(ConnectServerId))
+ {
+ await UpdateConnectInfo().ConfigureAwait(false);
+ }
+
await _operationLock.WaitAsync().ConfigureAwait(false);
try
@@ -497,10 +503,6 @@ namespace MediaBrowser.Server.Implementations.Connect
}
if (string.IsNullOrWhiteSpace(ConnectServerId))
{
- await UpdateConnectInfo().ConfigureAwait(false);
- }
- if (string.IsNullOrWhiteSpace(ConnectServerId))
- {
throw new ArgumentNullException("ConnectServerId");
}