From 8112ca5a43091cbbc81c94c969ca7e1d773bb236 Mon Sep 17 00:00:00 2001 From: Qstick Date: Fri, 29 May 2020 23:35:08 -0400 Subject: [PATCH] Fixed: Use User Slug for User List Trakt Requests (Requires Re-Auth for affected users) Fixes #4168 Fixes #4440 --- src/NzbDrone.Core/NetImport/Trakt/TraktAPI.cs | 8 ++++++++ src/NzbDrone.Core/NetImport/Trakt/TraktImportBase.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/NetImport/Trakt/TraktAPI.cs b/src/NzbDrone.Core/NetImport/Trakt/TraktAPI.cs index 62b759bc9..138c1a80f 100644 --- a/src/NzbDrone.Core/NetImport/Trakt/TraktAPI.cs +++ b/src/NzbDrone.Core/NetImport/Trakt/TraktAPI.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; + namespace NzbDrone.Core.NetImport.Trakt { public class TraktMovieIdsResource @@ -49,5 +51,11 @@ public class UserSettingsResponse public class TraktUserResource { public string Username { get; set; } + public TraktUserIdsResource Ids { get; set; } + } + + public class TraktUserIdsResource + { + public string Slug { get; set; } } } diff --git a/src/NzbDrone.Core/NetImport/Trakt/TraktImportBase.cs b/src/NzbDrone.Core/NetImport/Trakt/TraktImportBase.cs index 4bd57e6ff..6b5fb83ba 100644 --- a/src/NzbDrone.Core/NetImport/Trakt/TraktImportBase.cs +++ b/src/NzbDrone.Core/NetImport/Trakt/TraktImportBase.cs @@ -94,7 +94,7 @@ private string GetUserName(string accessToken) if (response != null && response.Resource != null) { - return response.Resource.User.Username; + return response.Resource.User.Ids.Slug; } } catch (HttpException)