From 5282d17911deccfb652234deb07d6a707f7d638a Mon Sep 17 00:00:00 2001 From: LuciusAezerith <57662283+LuciusAezerith@users.noreply.github.com> Date: Sat, 2 May 2026 00:41:48 +0200 Subject: [PATCH] Added check for anime show type when fetching last activity date --- src/NzbDrone.Core/ImportLists/Simkl/SimklAPI.cs | 3 +++ src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs | 3 ++- src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs | 5 +++++ .../ImportLists/Simkl/User/SimklUserSettings.cs | 4 ---- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/ImportLists/Simkl/SimklAPI.cs b/src/NzbDrone.Core/ImportLists/Simkl/SimklAPI.cs index c0ac976f6..d81b23009 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/SimklAPI.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/SimklAPI.cs @@ -66,6 +66,9 @@ public class SimklSyncActivityResource { [JsonProperty("tv_shows")] public SimklTvSyncActivityResource TvShows { get; set; } + + [JsonProperty("anime")] + public SimklTvSyncActivityResource Anime { get; set; } } public class SimklTvSyncActivityResource diff --git a/src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs b/src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs index bc0240c07..d1b0dfe9f 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/SimklImportBase.cs @@ -4,6 +4,7 @@ using NzbDrone.Common.Extensions; using NzbDrone.Common.Http; using NzbDrone.Core.Configuration; +using NzbDrone.Core.ImportLists.Simkl.User; using NzbDrone.Core.Localization; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; @@ -110,7 +111,7 @@ private DateTime GetLastActivity() if (response?.Resource != null) { - return response.Resource.TvShows.All; + return (SimklUserShowType)Settings.ShowType == SimklUserShowType.Shows ? response.Resource.TvShows.All : response.Resource.Anime.All; } } catch (HttpException) diff --git a/src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs b/src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs index 27ed6086d..8a043543e 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/SimklSettingsBase.cs @@ -2,6 +2,7 @@ using FluentValidation; using NzbDrone.Common.Extensions; using NzbDrone.Core.Annotations; +using NzbDrone.Core.ImportLists.Simkl.User; using NzbDrone.Core.Validation; namespace NzbDrone.Core.ImportLists.Simkl @@ -32,6 +33,7 @@ public class SimklSettingsBase : ImportListSettingsBase public SimklSettingsBase() { SignIn = "startOAuth"; + ShowType = (int)SimklUserShowType.Shows; } public override string BaseUrl { get; set; } = "https://api.simkl.com"; @@ -51,6 +53,9 @@ public SimklSettingsBase() [FieldDefinition(99, Label = "ImportListsSimklSettingsAuthenticatewithSimkl", Type = FieldType.OAuth)] public string SignIn { get; set; } + [FieldDefinition(1, Label = "ImportListsSimklSettingsShowType", Type = FieldType.Select, SelectOptions = typeof(SimklUserShowType), HelpText = "ImportListsSimklSettingsShowTypeHelpText")] + public int ShowType { get; set; } + public override NzbDroneValidationResult Validate() { return new NzbDroneValidationResult(Validator.Validate((TSettings)this)); diff --git a/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserSettings.cs b/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserSettings.cs index cabd423a9..ad5f7c6b1 100644 --- a/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserSettings.cs +++ b/src/NzbDrone.Core/ImportLists/Simkl/User/SimklUserSettings.cs @@ -19,15 +19,11 @@ public class SimklUserSettings : SimklSettingsBase public SimklUserSettings() { ListType = (int)SimklUserListType.Watching; - ShowType = (int)SimklUserShowType.Shows; } [FieldDefinition(1, Label = "ImportListsSimklSettingsListType", Type = FieldType.Select, SelectOptions = typeof(SimklUserListType), HelpText = "ImportListsSimklSettingsListTypeHelpText")] public int ListType { get; set; } - [FieldDefinition(1, Label = "ImportListsSimklSettingsShowType", Type = FieldType.Select, SelectOptions = typeof(SimklUserShowType), HelpText = "ImportListsSimklSettingsShowTypeHelpText")] - public int ShowType { get; set; } - public override NzbDroneValidationResult Validate() { return new NzbDroneValidationResult(Validator.Validate(this));