From 3c7d7756e6be05c76874cb1999e29fa3c97e73ad Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Tue, 10 Jan 2017 17:05:37 +0100 Subject: [PATCH] Fix issues with media managment config not getting saved. --- src/NzbDrone.Api/Config/NamingConfigModule.cs | 4 ++-- src/NzbDrone.Core/Organizer/FileNameValidation.cs | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Api/Config/NamingConfigModule.cs b/src/NzbDrone.Api/Config/NamingConfigModule.cs index 04a67856e..94b515473 100644 --- a/src/NzbDrone.Api/Config/NamingConfigModule.cs +++ b/src/NzbDrone.Api/Config/NamingConfigModule.cs @@ -34,11 +34,11 @@ namespace NzbDrone.Api.Config Get["/samples"] = x => GetExamples(this.Bind()); SharedValidator.RuleFor(c => c.MultiEpisodeStyle).InclusiveBetween(0, 5); - SharedValidator.RuleFor(c => c.StandardEpisodeFormat).ValidEpisodeFormat(); + /*SharedValidator.RuleFor(c => c.StandardEpisodeFormat).ValidEpisodeFormat(); SharedValidator.RuleFor(c => c.DailyEpisodeFormat).ValidDailyEpisodeFormat(); SharedValidator.RuleFor(c => c.AnimeEpisodeFormat).ValidAnimeEpisodeFormat(); SharedValidator.RuleFor(c => c.SeriesFolderFormat).ValidSeriesFolderFormat(); - SharedValidator.RuleFor(c => c.SeasonFolderFormat).ValidSeasonFolderFormat(); + SharedValidator.RuleFor(c => c.SeasonFolderFormat).ValidSeasonFolderFormat();*/ SharedValidator.RuleFor(c => c.StandardMovieFormat).ValidMovieFormat(); SharedValidator.RuleFor(c => c.MovieFolderFormat).ValidMovieFolderFormat(); } diff --git a/src/NzbDrone.Core/Organizer/FileNameValidation.cs b/src/NzbDrone.Core/Organizer/FileNameValidation.cs index c1f4ac776..9ecfa6b42 100644 --- a/src/NzbDrone.Core/Organizer/FileNameValidation.cs +++ b/src/NzbDrone.Core/Organizer/FileNameValidation.cs @@ -67,6 +67,8 @@ namespace NzbDrone.Core.Organizer { var value = context.PropertyValue as string; + return true; + if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && !FileNameValidation.OriginalTokenRegex.IsMatch(value)) { @@ -89,6 +91,8 @@ namespace NzbDrone.Core.Organizer { var value = context.PropertyValue as string; + return true; + if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && !FileNameBuilder.AirDateRegex.IsMatch(value) && !FileNameValidation.OriginalTokenRegex.IsMatch(value)) @@ -112,6 +116,8 @@ namespace NzbDrone.Core.Organizer { var value = context.PropertyValue as string; + return true; + if (!FileNameBuilder.SeasonEpisodePatternRegex.IsMatch(value) && !FileNameBuilder.AbsoluteEpisodePatternRegex.IsMatch(value) && !FileNameValidation.OriginalTokenRegex.IsMatch(value))