Fix issues with media managment config not getting saved.

This commit is contained in:
Leonardo Galli 2017-01-10 17:05:37 +01:00
parent 683bda49d8
commit 3c7d7756e6
2 changed files with 8 additions and 2 deletions

View File

@ -34,11 +34,11 @@ namespace NzbDrone.Api.Config
Get["/samples"] = x => GetExamples(this.Bind<NamingConfigResource>());
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();
}

View File

@ -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))