From 452b5c8f84a83ff0fc680da5cfce0bc288280056 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Thu, 7 Jul 2011 20:36:02 -0700 Subject: [PATCH] Renamed sorting config keys --- IISExpress/AppServer/applicationhost.config | 2 +- NzbDrone.Core.Test/MediaFileProviderTests.cs | 2 +- .../MediaFileProvider_GetNewFilenameTest.cs | 168 +++++++++--------- .../Providers/Core/ConfigProvider.cs | 20 +-- NzbDrone.Core/Providers/MediaFileProvider.cs | 17 +- NzbDrone.Core/Providers/SeriesProvider.cs | 2 +- .../Controllers/SettingsController.cs | 32 ++-- NzbDrone/app.config | 2 +- 8 files changed, 123 insertions(+), 122 deletions(-) diff --git a/IISExpress/AppServer/applicationhost.config b/IISExpress/AppServer/applicationhost.config index f1e3a3538..c04eb1d2c 100644 --- a/IISExpress/AppServer/applicationhost.config +++ b/IISExpress/AppServer/applicationhost.config @@ -125,7 +125,7 @@ - + diff --git a/NzbDrone.Core.Test/MediaFileProviderTests.cs b/NzbDrone.Core.Test/MediaFileProviderTests.cs index f0f799f33..979e423c0 100644 --- a/NzbDrone.Core.Test/MediaFileProviderTests.cs +++ b/NzbDrone.Core.Test/MediaFileProviderTests.cs @@ -146,7 +146,7 @@ public void CalculateFilePath_SeasonFolder_SingleNumber(string filename, int sea .Build(); var mocker = new AutoMoqer(); - mocker.GetMock().Setup(e => e.SeasonFolderFormat).Returns(seasonFolderFormat); + mocker.GetMock().Setup(e => e.SortingSeasonFolderFormat).Returns(seasonFolderFormat); //Act var result = mocker.Resolve().CalculateFilePath(fakeSeries, 1, filename, ".mkv"); diff --git a/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs b/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs index 6ec6da471..009d9f9db 100644 --- a/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs +++ b/NzbDrone.Core.Test/MediaFileProvider_GetNewFilenameTest.cs @@ -22,12 +22,12 @@ public void GetNewFilename_Series_Episode_Quality_S01E05_Dash() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(2); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -49,12 +49,12 @@ public void GetNewFilename_Episode_Quality_1x05_Dash() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(0); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -76,12 +76,12 @@ public void GetNewFilename_Series_Quality_01x05_Space() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(1); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -103,12 +103,12 @@ public void GetNewFilename_Series_s01e05_Space() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(3); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() @@ -131,12 +131,12 @@ public void GetNewFilename_Series_Episode_s01e05_Periods() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(3); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -158,12 +158,12 @@ public void GetNewFilename_Series_Episode_s01e05_Dash_Periods_Quality() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(3); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); var episode = Builder.CreateNew() .With(e => e.Title = "City Sushi") @@ -185,12 +185,12 @@ public void GetNewFilename_S01E05_Dash() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(2); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); var episode = Builder.CreateNew() @@ -213,13 +213,13 @@ public void GetNewFilename_multi_Series_Episode_Quality_S01E05_Scene_Dash() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(2); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(3); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -247,13 +247,13 @@ public void GetNewFilename_multi_Episode_Quality_1x05_Repeat_Dash() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(0); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -281,13 +281,13 @@ public void GetNewFilename_multi_Episode_Quality_01x05_Repeat_Space() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(true); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(0); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(false); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(true); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(false); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -315,13 +315,13 @@ public void GetNewFilename_multi_Series_Episode_s01e05_Duplicate_Period() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(true); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(1); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(3); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(true); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(1); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(3); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(1); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -349,13 +349,13 @@ public void GetNewFilename_multi_Series_S01E05_Extend_Dash_Period() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(true); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(2); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(true); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(0); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") @@ -383,13 +383,13 @@ public void GetNewFilename_multi_1x05_Repeat_Dash_Period() var mocker = new AutoMoqer(); var fakeConfig = mocker.GetMock(); - fakeConfig.SetupGet(c => c.SeriesName).Returns(false); - fakeConfig.SetupGet(c => c.EpisodeName).Returns(false); - fakeConfig.SetupGet(c => c.AppendQuality).Returns(false); - fakeConfig.SetupGet(c => c.SeparatorStyle).Returns(0); - fakeConfig.SetupGet(c => c.NumberStyle).Returns(0); - fakeConfig.SetupGet(c => c.ReplaceSpaces).Returns(true); - fakeConfig.SetupGet(c => c.MultiEpisodeStyle).Returns(2); + fakeConfig.SetupGet(c => c.SortingIncludeSeriesName).Returns(false); + fakeConfig.SetupGet(c => c.SortingEpisodeName).Returns(false); + fakeConfig.SetupGet(c => c.SortingAppendQuality).Returns(false); + fakeConfig.SetupGet(c => c.SortingSeparatorStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingNumberStyle).Returns(0); + fakeConfig.SetupGet(c => c.SortingReplaceSpaces).Returns(true); + fakeConfig.SetupGet(c => c.SortingMultiEpisodeStyle).Returns(2); var episodeOne = Builder.CreateNew() .With(e => e.Title = "Strawberries and Cream (1)") diff --git a/NzbDrone.Core/Providers/Core/ConfigProvider.cs b/NzbDrone.Core/Providers/Core/ConfigProvider.cs index f070fed0c..59902b6b6 100644 --- a/NzbDrone.Core/Providers/Core/ConfigProvider.cs +++ b/NzbDrone.Core/Providers/Core/ConfigProvider.cs @@ -197,25 +197,25 @@ public virtual String BlackholeDirectory set { SetValue("BlackholeDirectory", value); } } - public virtual bool SeriesName + public virtual bool SortingSeriesName { get { return GetValueBoolean("Sorting_SeriesName", true); } set { SetValue("Sorting_SeriesName", value); } } - public virtual bool EpisodeName + public virtual bool SortingEpisodeName { get { return GetValueBoolean("Sorting_EpisodeName", true); } set { SetValue("Sorting_EpisodeName", value); } } - public virtual bool ReplaceSpaces + public virtual bool SortingReplaceSpaces { get { return GetValueBoolean("Sorting_ReplaceSpaces", true); } set { SetValue("Sorting_ReplaceSpaces", value); } } - public virtual bool AppendQuality + public virtual bool SortingAppendQuality { get { return GetValueBoolean("Sorting_AppendQaulity", true); } set { SetValue("Sorting_AppendQaulity", value); } @@ -223,30 +223,30 @@ public virtual bool AppendQuality public virtual bool UseSeasonFolder { - get { return GetValueBoolean("Sorting_SeasonFolder", true); } + get { return GetValueBoolean("UseSeasonFolder", true); } - set { SetValue("Sorting_SeasonFolder", value); } + set { SetValue("UseSeasonFolder", value); } } - public virtual string SeasonFolderFormat + public virtual string SortingSeasonFolderFormat { get { return GetValue("Sorting_SeasonFolderFormat", "Season %s"); } set { SetValue("Sorting_SeasonFolderFormat", value); } } - public virtual int SeparatorStyle + public virtual int SortingSeparatorStyle { get { return GetValueInt("Sorting_SeparatorStyle"); } set { SetValue("Sorting_SeparatorStyle", value); } } - public virtual int NumberStyle + public virtual int SortingNumberStyle { get { return GetValueInt("Sorting_NumberStyle", 2); } set { SetValue("Sorting_NumberStyle", value); } } - public virtual int MultiEpisodeStyle + public virtual int SortingMultiEpisodeStyle { get { return GetValueInt("Sorting_MultiEpisodeStyle"); } set { SetValue("Sorting_MultiEpisodeStyle", value); } diff --git a/NzbDrone.Core/Providers/MediaFileProvider.cs b/NzbDrone.Core/Providers/MediaFileProvider.cs index 4ddb2032b..0a592c04f 100644 --- a/NzbDrone.Core/Providers/MediaFileProvider.cs +++ b/NzbDrone.Core/Providers/MediaFileProvider.cs @@ -83,7 +83,7 @@ public virtual FileInfo CalculateFilePath(Series series, int seasonNumber, strin string path = series.Path; if (series.SeasonFolder) { - var seasonFolder = _configProvider.SeasonFolderFormat + var seasonFolder = _configProvider.SortingSeasonFolderFormat .Replace("%0s", seasonNumber.ToString("00")) .Replace("%s", seasonNumber.ToString()); @@ -132,16 +132,17 @@ LEFT OUTER JOIN Episodes return updated; } + public virtual string GetNewFilename(IList episodes, string seriesTitle, QualityTypes quality) { - var separatorStyle = EpisodeSortingHelper.GetSeparatorStyle(_configProvider.SeparatorStyle); - var numberStyle = EpisodeSortingHelper.GetNumberStyle(_configProvider.NumberStyle); + var separatorStyle = EpisodeSortingHelper.GetSeparatorStyle(_configProvider.SortingSeparatorStyle); + var numberStyle = EpisodeSortingHelper.GetNumberStyle(_configProvider.SortingNumberStyle); string episodeNames = episodes[0].Title; string result = String.Empty; - if (_configProvider.SeriesName) + if (_configProvider.SortingIncludeSeriesName) { result += seriesTitle + separatorStyle.Pattern; } @@ -150,7 +151,7 @@ public virtual string GetNewFilename(IList episodes, string seriesTitle if (episodes.Count > 1) { - var multiEpisodeStyle = EpisodeSortingHelper.GetMultiEpisodeStyle(_configProvider.MultiEpisodeStyle); + var multiEpisodeStyle = EpisodeSortingHelper.GetMultiEpisodeStyle(_configProvider.SortingMultiEpisodeStyle); foreach (var episode in episodes.OrderBy(e => e.EpisodeNumber).Skip(1)) { @@ -174,16 +175,16 @@ public virtual string GetNewFilename(IList episodes, string seriesTitle .Replace("%x", numberStyle.EpisodeSeparator) .Replace("%p", separatorStyle.Pattern); - if (_configProvider.EpisodeName) + if (_configProvider.SortingEpisodeName) { episodeNames = episodeNames.TrimEnd(' ', '+'); result += separatorStyle.Pattern + episodeNames; } - if (_configProvider.AppendQuality) + if (_configProvider.SortingAppendQuality) result += String.Format(" [{0}]", quality); - if (_configProvider.ReplaceSpaces) + if (_configProvider.SortingReplaceSpaces) result = result.Replace(' ', '.'); Logger.Trace("New File Name is: [{0}]", result.Trim()); diff --git a/NzbDrone.Core/Providers/SeriesProvider.cs b/NzbDrone.Core/Providers/SeriesProvider.cs index 8d0ec18fd..7afaa51ae 100644 --- a/NzbDrone.Core/Providers/SeriesProvider.cs +++ b/NzbDrone.Core/Providers/SeriesProvider.cs @@ -109,7 +109,7 @@ public virtual void AddSeries(string path, int tvDbSeriesId, int qualityProfileI repoSeries.Monitored = true; //New shows should be monitored repoSeries.QualityProfileId = qualityProfileId; if (qualityProfileId == 0) - repoSeries.QualityProfileId = Convert.ToInt32(_configProvider.GetValue("DefaultQualityProfile", "1")); + repoSeries.QualityProfileId = _configProvider.DefaultQualityProfile; repoSeries.SeasonFolder = _configProvider.UseSeasonFolder; diff --git a/NzbDrone.Web/Controllers/SettingsController.cs b/NzbDrone.Web/Controllers/SettingsController.cs index 74a7a8d21..72a0b2713 100644 --- a/NzbDrone.Web/Controllers/SettingsController.cs +++ b/NzbDrone.Web/Controllers/SettingsController.cs @@ -163,15 +163,15 @@ public ActionResult EpisodeSorting() { var model = new EpisodeSortingModel(); - model.SeriesName = _configProvider.SeriesName; - model.EpisodeName = _configProvider.EpisodeName; - model.ReplaceSpaces = _configProvider.ReplaceSpaces; - model.AppendQuality = _configProvider.AppendQuality; + model.SeriesName = _configProvider.SortingIncludeSeriesName; + model.EpisodeName = _configProvider.SortingEpisodeName; + model.ReplaceSpaces = _configProvider.SortingReplaceSpaces; + model.AppendQuality = _configProvider.SortingAppendQuality; model.SeasonFolders = _configProvider.UseSeasonFolder; - model.SeasonFolderFormat = _configProvider.SeasonFolderFormat; - model.SeparatorStyle = _configProvider.SeparatorStyle; - model.NumberStyle = _configProvider.NumberStyle; - model.MultiEpisodeStyle = _configProvider.MultiEpisodeStyle; + model.SeasonFolderFormat = _configProvider.SortingSeasonFolderFormat; + model.SeparatorStyle = _configProvider.SortingSeparatorStyle; + model.NumberStyle = _configProvider.SortingNumberStyle; + model.MultiEpisodeStyle = _configProvider.SortingMultiEpisodeStyle; model.SeparatorStyles = new SelectList(EpisodeSortingHelper.GetSeparatorStyles(), "Id", "Name"); model.NumberStyles = new SelectList(EpisodeSortingHelper.GetNumberStyles(), "Id", "Name"); @@ -435,15 +435,15 @@ public ActionResult SaveEpisodeSorting(EpisodeSortingModel data) if (ModelState.IsValid) { - _configProvider.SeriesName = data.SeriesName; - _configProvider.EpisodeName = data.EpisodeName; - _configProvider.ReplaceSpaces = data.ReplaceSpaces; - _configProvider.AppendQuality = data.AppendQuality; + _configProvider.SortingIncludeSeriesName = data.SeriesName; + _configProvider.SortingEpisodeName = data.EpisodeName; + _configProvider.SortingReplaceSpaces = data.ReplaceSpaces; + _configProvider.SortingAppendQuality = data.AppendQuality; _configProvider.UseSeasonFolder = data.SeasonFolders; - _configProvider.SeasonFolderFormat = data.SeasonFolderFormat; - _configProvider.SeparatorStyle = data.SeparatorStyle; - _configProvider.NumberStyle = data.NumberStyle; - _configProvider.MultiEpisodeStyle = data.MultiEpisodeStyle; + _configProvider.SortingSeasonFolderFormat = data.SeasonFolderFormat; + _configProvider.SortingSeparatorStyle = data.SeparatorStyle; + _configProvider.SortingNumberStyle = data.NumberStyle; + _configProvider.SortingMultiEpisodeStyle = data.MultiEpisodeStyle; basicNotification.Title = SETTINGS_SAVED; _notificationProvider.Register(basicNotification); diff --git a/NzbDrone/app.config b/NzbDrone/app.config index 81d395705..19dd15844 100644 --- a/NzbDrone/app.config +++ b/NzbDrone/app.config @@ -4,6 +4,6 @@ - + \ No newline at end of file