diff --git a/src/Trash.Tests/Radarr/CustomFormat/Processors/GuideSteps/ConfigStepTest.cs b/src/Trash.Tests/Radarr/CustomFormat/Processors/GuideSteps/ConfigStepTest.cs index 8da1aed2..0efa68d4 100644 --- a/src/Trash.Tests/Radarr/CustomFormat/Processors/GuideSteps/ConfigStepTest.cs +++ b/src/Trash.Tests/Radarr/CustomFormat/Processors/GuideSteps/ConfigStepTest.cs @@ -40,7 +40,6 @@ namespace Trash.Tests.Radarr.CustomFormat.Processors.GuideSteps var processor = new ConfigStep(); processor.Process(testProcessedCfs, testConfig); - processor.RenamedCustomFormats.Should().BeEmpty(); processor.CustomFormatsNotInGuide.Should().BeEmpty(); processor.ConfigData.Should().BeEquivalentTo(new List { @@ -113,7 +112,6 @@ namespace Trash.Tests.Radarr.CustomFormat.Processors.GuideSteps var processor = new ConfigStep(); processor.Process(testProcessedCfs, testConfig); - processor.RenamedCustomFormats.Should().BeEmpty(); processor.CustomFormatsNotInGuide.Should().BeEmpty(); processor.ConfigData.Should().BeEquivalentTo(new List { @@ -149,7 +147,6 @@ namespace Trash.Tests.Radarr.CustomFormat.Processors.GuideSteps var processor = new ConfigStep(); processor.Process(testProcessedCfs, testConfig); - processor.RenamedCustomFormats.Should().BeEmpty(); processor.CustomFormatsNotInGuide.Should().BeEquivalentTo(new List {"name3"}, op => op .Using(jctx => jctx.Subject.Should().BeEquivalentTo(jctx.Expectation)) .WhenTypeIs()); @@ -166,46 +163,5 @@ namespace Trash.Tests.Radarr.CustomFormat.Processors.GuideSteps .Using(jctx => jctx.Subject.Should().BeEquivalentTo(jctx.Expectation)) .WhenTypeIs()); } - - [Test] - public void Custom_formats_with_same_trash_id_and_same_name_in_cache_are_in_renamed_list() - { - var testProcessedCfs = new List - { - new("name1", "id1", new JObject()) - { - CacheEntry = new TrashIdMapping("id1", "name2") - }, - new("name2", "id2", new JObject()) - { - CacheEntry = new TrashIdMapping("id2", "name1") - } - }; - - var testConfig = new CustomFormatConfig[] - { - new() - { - Names = new List {"name1", "name2"} - } - }; - - var processor = new ConfigStep(); - processor.Process(testProcessedCfs, testConfig); - - processor.RenamedCustomFormats.Should().BeEquivalentTo(testProcessedCfs, op => op - .Using(jctx => jctx.Subject.Should().BeEquivalentTo(jctx.Expectation)) - .WhenTypeIs()); - processor.CustomFormatsNotInGuide.Should().BeEmpty(); - processor.ConfigData.Should().BeEquivalentTo(new List - { - new() - { - CustomFormats = testProcessedCfs - } - }, op => op - .Using(jctx => jctx.Subject.Should().BeEquivalentTo(jctx.Expectation)) - .WhenTypeIs()); - } } } diff --git a/src/Trash/Radarr/CustomFormat/Processors/GuideSteps/ConfigStep.cs b/src/Trash/Radarr/CustomFormat/Processors/GuideSteps/ConfigStep.cs index 397be0bb..1cb8a910 100644 --- a/src/Trash/Radarr/CustomFormat/Processors/GuideSteps/ConfigStep.cs +++ b/src/Trash/Radarr/CustomFormat/Processors/GuideSteps/ConfigStep.cs @@ -8,7 +8,6 @@ namespace Trash.Radarr.CustomFormat.Processors.GuideSteps { public class ConfigStep : IConfigStep { - public List RenamedCustomFormats { get; private set; } = new(); public List CustomFormatsNotInGuide { get; } = new(); public List ConfigData { get; } = new(); @@ -40,28 +39,6 @@ namespace Trash.Radarr.CustomFormat.Processors.GuideSteps QualityProfiles = configCf.QualityProfiles }); } - - var allCfs = ConfigData - .SelectMany(cd => cd.CustomFormats.Select(cf => cf)) - .Distinct() - .ToList(); - - // List of CFs in cache vs guide that have mismatched Trash ID. This means that a CF was renamed - // to the same name as a previous CF's name, and we should treat that one as missing. - // CustomFormatsSameNameDiffTrashId = allCfs - // .Where(cf => cf.CacheEntry != null) - // .GroupBy(cf => allCfs.FirstOrDefault( - // cf2 => cf2.Name.EqualsIgnoreCase(cf.CacheEntry!.CustomFormatName) && - // !cf2.TrashId.EqualsIgnoreCase(cf.CacheEntry.TrashId))) - // .Where(grp => grp.Key != null) - // .Select(grp => grp.Append(grp.Key!).ToList()) - // .ToList(); - - // CFs in the guide that match the same TrashID in cache but have different names. Warn the user that it - // is renamed in the guide and they need to update their config. - RenamedCustomFormats = allCfs - .Where(cf => cf.CacheEntry != null && !cf.CacheEntry.CustomFormatName.EqualsIgnoreCase(cf.Name)) - .ToList(); } } } diff --git a/src/Trash/Radarr/CustomFormat/Processors/GuideSteps/IConfigStep.cs b/src/Trash/Radarr/CustomFormat/Processors/GuideSteps/IConfigStep.cs index 789c6518..95e29bc9 100644 --- a/src/Trash/Radarr/CustomFormat/Processors/GuideSteps/IConfigStep.cs +++ b/src/Trash/Radarr/CustomFormat/Processors/GuideSteps/IConfigStep.cs @@ -5,7 +5,6 @@ namespace Trash.Radarr.CustomFormat.Processors.GuideSteps { public interface IConfigStep { - List RenamedCustomFormats { get; } List CustomFormatsNotInGuide { get; } List ConfigData { get; }