From d9704a999dba8e5e68f42c185ba07b641995c1db Mon Sep 17 00:00:00 2001 From: Bogdan Date: Mon, 7 Apr 2025 16:32:11 +0300 Subject: [PATCH] Fixed: Remove support for IMDb Lists of the form 'ls12345678' --- .../RadarrList2/IMDb/IMDbListRequestGenerator.cs | 2 +- .../ImportLists/RadarrList2/IMDb/IMDbListSettings.cs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/ImportLists/RadarrList2/IMDb/IMDbListRequestGenerator.cs b/src/NzbDrone.Core/ImportLists/RadarrList2/IMDb/IMDbListRequestGenerator.cs index 60cba5c824..b7ffe72c3f 100644 --- a/src/NzbDrone.Core/ImportLists/RadarrList2/IMDb/IMDbListRequestGenerator.cs +++ b/src/NzbDrone.Core/ImportLists/RadarrList2/IMDb/IMDbListRequestGenerator.cs @@ -12,7 +12,7 @@ protected override HttpRequest GetHttpRequest() // Use IMDb list Export for user lists to bypass RadarrAPI caching if (Settings.ListId.StartsWith("ls", StringComparison.OrdinalIgnoreCase)) { - return new HttpRequest($"https://www.imdb.com/list/{Settings.ListId}/export", new HttpAccept("*/*")); + throw new Exception("IMDb lists of the form 'ls12345678' are no longer supported. Feel free to remove this list after you review your Clean Library Level."); } return RequestBuilder.Create() diff --git a/src/NzbDrone.Core/ImportLists/RadarrList2/IMDb/IMDbListSettings.cs b/src/NzbDrone.Core/ImportLists/RadarrList2/IMDb/IMDbListSettings.cs index 7cf18332b7..2056bc9bcb 100644 --- a/src/NzbDrone.Core/ImportLists/RadarrList2/IMDb/IMDbListSettings.cs +++ b/src/NzbDrone.Core/ImportLists/RadarrList2/IMDb/IMDbListSettings.cs @@ -8,9 +8,10 @@ public class IMDbSettingsValidator : AbstractValidator { public IMDbSettingsValidator() { - RuleFor(c => c.ListId) - .Matches(@"^top250$|^popular$|^ls\d+$|^ur\d+$") - .WithMessage("List ID must be 'top250', 'popular', an IMDb List ID of the form 'ls12345678' or an IMDb user watchlist of the form 'ur12345678'"); + RuleFor(c => c.ListId).Cascade(CascadeMode.Stop) + .NotEmpty() + .Matches(@"^(top250|popular)$|^ur\d+$") + .WithMessage("List ID must be 'top250', 'popular' or an IMDb user watchlist of the form 'ur12345678'"); } } @@ -18,7 +19,7 @@ public class IMDbListSettings : ImportListSettingsBase { private static readonly IMDbSettingsValidator Validator = new (); - [FieldDefinition(1, Label = "List/User ID", HelpText = "IMDb list ID (e.g ls12345678), IMDb user ID (e.g. ur12345678), 'top250' or 'popular'")] + [FieldDefinition(1, Label = "List/User ID", HelpText = "IMDb user ID (e.g. ur12345678), 'top250' or 'popular'")] public string ListId { get; set; } public override NzbDroneValidationResult Validate()