aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-09-14 19:39:06 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-09-14 19:39:06 -0400
commit6dc9b169666bcfeb2edf3620c0646efa0c29606f (patch)
tree9e1383d616aade599f127512478b305aaa1e3b15 /MediaBrowser.Server.Implementations
parent52aad5466a4700a8759d1f4c6e4f2673c12a8f9e (diff)
update connect link text
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Connect/ConnectManager.cs11
-rw-r--r--MediaBrowser.Server.Implementations/Connect/Responses.cs9
-rw-r--r--MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json3
-rw-r--r--MediaBrowser.Server.Implementations/Localization/Server/server.json1
4 files changed, 21 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
index 3933b180e..d92ca8323 100644
--- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
+++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs
@@ -6,6 +6,7 @@ using MediaBrowser.Controller.Connect;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Security;
+using MediaBrowser.Model.Connect;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Serialization;
@@ -266,7 +267,7 @@ namespace MediaBrowser.Server.Implementations.Connect
return "https://connect.mediabrowser.tv/service/" + handler;
}
- public async Task LinkUser(string userId, string connectUsername)
+ public async Task<UserLinkResult> LinkUser(string userId, string connectUsername)
{
if (string.IsNullOrWhiteSpace(connectUsername))
{
@@ -313,17 +314,24 @@ namespace MediaBrowser.Server.Implementations.Connect
SetServerAccessToken(options);
+ var result = new UserLinkResult();
+
// No need to examine the response
using (var stream = (await _httpClient.Post(options).ConfigureAwait(false)).Content)
{
var response = _json.DeserializeFromStream<ServerUserAuthorizationResponse>(stream);
+
+ result.IsPending = string.Equals(response.AcceptStatus, "waiting", StringComparison.OrdinalIgnoreCase);
}
user.ConnectAccessKey = accessToken;
user.ConnectUserName = connectUser.Name;
user.ConnectUserId = connectUser.Id;
+ user.ConnectLinkType = UserLinkType.LinkedUser;
await user.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
+
+ return result;
}
public Task RemoveLink(string userId)
@@ -378,6 +386,7 @@ namespace MediaBrowser.Server.Implementations.Connect
user.ConnectAccessKey = null;
user.ConnectUserName = null;
user.ConnectUserId = null;
+ user.ConnectLinkType = UserLinkType.LinkedUser;
await user.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
}
diff --git a/MediaBrowser.Server.Implementations/Connect/Responses.cs b/MediaBrowser.Server.Implementations/Connect/Responses.cs
index a3b0369ba..eeb56d1c9 100644
--- a/MediaBrowser.Server.Implementations/Connect/Responses.cs
+++ b/MediaBrowser.Server.Implementations/Connect/Responses.cs
@@ -28,6 +28,13 @@ namespace MediaBrowser.Server.Implementations.Connect
public class ServerUserAuthorizationResponse
{
-
+ public string Id { get; set; }
+ public string ServerId { get; set; }
+ public string UserId { get; set; }
+ public string AccessToken { get; set; }
+ public string DateCreated { get; set; }
+ public bool IsActive { get; set; }
+ public string AcceptStatus { get; set; }
+ public string UserType { get; set; }
}
}
diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
index f8bb0f1d5..543bcced2 100644
--- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
+++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json
@@ -453,7 +453,8 @@
"MessageYouHaveAnActiveRecurringMembership": "You have an active {0} membership. You can upgrade your plan using the options below.",
"ButtonDelete": "Delete",
"HeaderMediaBrowserAccountAdded": "Media Browser Account Added",
- "MessageMediaBrowserAccontAdded": "A Media Browser account has been added to this user. An email will be sent to the owner of the account. The invitation will need to be confirmed by clicking a link within the email.",
+ "MessageMediaBrowserAccountAdded": "The Media Browser account has been successfully linked to this user.",
+ "MessagePendingMediaBrowserAccountAdded": "A Media Browser account has been linked to this user. An email will be sent to the owner of the account. The invitation will need to be confirmed by clicking a link within the email.",
"HeaderMediaBrowserAccountRemoved": "Media Browser Account Removed",
"MessageMediaBrowserAccontRemoved": "The Media Browser account has been removed from this user.",
"TooltipLinkedToMediaBrowserConnect": "Linked to Media Browser Connect"
diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json
index 86dc60c2e..781b3e927 100644
--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json
+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json
@@ -684,6 +684,7 @@
"OptionPlainVideoItemsHelp": "If enabled, all videos are represented in DIDL as \"object.item.videoItem\" instead of a more specific type, such as \"object.item.videoItem.movie\".",
"LabelSupportedMediaTypes": "Supported Media Types:",
"TabIdentification": "Identification",
+ "HeaderIdentification": "Identification",
"TabDirectPlay": "Direct Play",
"TabContainers": "Containers",
"TabCodecs": "Codecs",