diff --git a/src/NzbDrone.Core/ImportLists/Goodreads/GoodreadsImportListBase.cs b/src/NzbDrone.Core/ImportLists/Goodreads/GoodreadsImportListBase.cs index 90f7255ea..edb68e07e 100644 --- a/src/NzbDrone.Core/ImportLists/Goodreads/GoodreadsImportListBase.cs +++ b/src/NzbDrone.Core/ImportLists/Goodreads/GoodreadsImportListBase.cs @@ -50,7 +50,7 @@ namespace NzbDrone.Core.ImportLists.Goodreads { try { - GetUser(); + GetUser(Settings.UserId); return null; } catch (Common.Http.HttpException ex) @@ -106,7 +106,7 @@ namespace NzbDrone.Core.ImportLists.Goodreads Settings.AccessToken = qscoll["oauth_token"]; Settings.AccessTokenSecret = qscoll["oauth_token_secret"]; - var user = GetUser(); + var user = GetUser(Settings.UserId); return new { @@ -165,9 +165,18 @@ namespace NzbDrone.Core.ImportLists.Goodreads return HttpUtility.ParseQueryString(response.Content); } - private Tuple GetUser() + private Tuple GetUser(string id) { - var builder = RequestBuilder().SetSegment("route", $"api/auth_user"); + var builder = RequestBuilder(); + + if (id == null) + { + builder.SetSegment("route", "api/auth_user"); + } + else + { + builder.SetSegment("route", $"user/show/{id}.xml"); + } var httpResponse = OAuthGet(builder); diff --git a/src/NzbDrone.Core/ImportLists/Goodreads/GoodreadsSettingsBase.cs b/src/NzbDrone.Core/ImportLists/Goodreads/GoodreadsSettingsBase.cs index 777769f76..52fabeb0e 100644 --- a/src/NzbDrone.Core/ImportLists/Goodreads/GoodreadsSettingsBase.cs +++ b/src/NzbDrone.Core/ImportLists/Goodreads/GoodreadsSettingsBase.cs @@ -38,7 +38,7 @@ namespace NzbDrone.Core.ImportLists.Goodreads [FieldDefinition(0, Label = "Request Token Secret", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] public string RequestTokenSecret { get; set; } - [FieldDefinition(0, Label = "User Id", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)] + [FieldDefinition(0, Label = "User Id", HelpText = "User Id to import from. Leave blank to use the authenticated Goodreads user.", Type = FieldType.Textbox, Advanced = true)] public string UserId { get; set; } [FieldDefinition(0, Label = "User Name", Type = FieldType.Textbox, Hidden = HiddenType.Hidden)]