diff --git a/src/NzbDrone.Core/Organizer/BasicNamingConfig.cs b/src/NzbDrone.Core/Organizer/BasicNamingConfig.cs deleted file mode 100644 index b0dc16f6a..000000000 --- a/src/NzbDrone.Core/Organizer/BasicNamingConfig.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace NzbDrone.Core.Organizer -{ - public class BasicNamingConfig - { - public bool IncludeSeriesTitle { get; set; } - public bool IncludeEpisodeTitle { get; set; } - public bool IncludeQuality { get; set; } - public bool ReplaceSpaces { get; set; } - public string Separator { get; set; } - public string NumberStyle { get; set; } - } -} diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index 57ebfc5ca..115fa5d27 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -25,7 +25,6 @@ namespace NzbDrone.Core.Organizer string BuildFileName(List episodes, Series series, EpisodeFile episodeFile, string extension = "", NamingConfig namingConfig = null, List customFormats = null); string BuildFilePath(List episodes, Series series, EpisodeFile episodeFile, string extension, NamingConfig namingConfig = null, List customFormats = null); string BuildSeasonPath(Series series, int seasonNumber); - BasicNamingConfig GetBasicNamingConfig(NamingConfig nameSpec); string GetSeriesFolder(Series series, NamingConfig namingConfig = null); string GetSeasonFolder(Series series, int seasonNumber, NamingConfig namingConfig = null); bool RequiresEpisodeTitle(Series series, List episodes); @@ -253,52 +252,6 @@ namespace NzbDrone.Core.Organizer return path; } - public BasicNamingConfig GetBasicNamingConfig(NamingConfig nameSpec) - { - var episodeFormat = GetEpisodeFormat(nameSpec.StandardEpisodeFormat).LastOrDefault(); - - if (episodeFormat == null) - { - return new BasicNamingConfig(); - } - - var basicNamingConfig = new BasicNamingConfig - { - Separator = episodeFormat.Separator, - NumberStyle = episodeFormat.SeasonEpisodePattern - }; - - var titleTokens = TitleRegex.Matches(nameSpec.StandardEpisodeFormat); - - foreach (Match match in titleTokens) - { - var separator = match.Groups["separator"].Value; - var token = match.Groups["token"].Value; - - if (!separator.Equals(" ")) - { - basicNamingConfig.ReplaceSpaces = true; - } - - if (token.StartsWith("{Series", StringComparison.InvariantCultureIgnoreCase)) - { - basicNamingConfig.IncludeSeriesTitle = true; - } - - if (token.StartsWith("{Episode", StringComparison.InvariantCultureIgnoreCase)) - { - basicNamingConfig.IncludeEpisodeTitle = true; - } - - if (token.StartsWith("{Quality", StringComparison.InvariantCultureIgnoreCase)) - { - basicNamingConfig.IncludeQuality = true; - } - } - - return basicNamingConfig; - } - public string GetSeriesFolder(Series series, NamingConfig namingConfig = null) { if (namingConfig == null) diff --git a/src/Sonarr.Api.V3/Config/NamingConfigController.cs b/src/Sonarr.Api.V3/Config/NamingConfigController.cs index 137f24769..f940519aa 100644 --- a/src/Sonarr.Api.V3/Config/NamingConfigController.cs +++ b/src/Sonarr.Api.V3/Config/NamingConfigController.cs @@ -49,12 +49,6 @@ namespace Sonarr.Api.V3.Config var nameSpec = _namingConfigService.GetConfig(); var resource = nameSpec.ToResource(); - if (resource.StandardEpisodeFormat.IsNotNullOrWhiteSpace()) - { - var basicConfig = _filenameBuilder.GetBasicNamingConfig(nameSpec); - basicConfig.AddToResource(resource); - } - return resource; } diff --git a/src/Sonarr.Api.V3/Config/NamingConfigResource.cs b/src/Sonarr.Api.V3/Config/NamingConfigResource.cs index 4e4116807..f1acc9fe3 100644 --- a/src/Sonarr.Api.V3/Config/NamingConfigResource.cs +++ b/src/Sonarr.Api.V3/Config/NamingConfigResource.cs @@ -14,11 +14,5 @@ namespace Sonarr.Api.V3.Config public string SeriesFolderFormat { get; set; } public string SeasonFolderFormat { get; set; } public string SpecialsFolderFormat { get; set; } - public bool IncludeSeriesTitle { get; set; } - public bool IncludeEpisodeTitle { get; set; } - public bool IncludeQuality { get; set; } - public bool ReplaceSpaces { get; set; } - public string Separator { get; set; } - public string NumberStyle { get; set; } } } diff --git a/src/Sonarr.Api.V3/Config/NamingExampleResource.cs b/src/Sonarr.Api.V3/Config/NamingExampleResource.cs index 66e21aff8..6784e1a4b 100644 --- a/src/Sonarr.Api.V3/Config/NamingExampleResource.cs +++ b/src/Sonarr.Api.V3/Config/NamingExampleResource.cs @@ -32,26 +32,9 @@ namespace Sonarr.Api.V3.Config SeriesFolderFormat = model.SeriesFolderFormat, SeasonFolderFormat = model.SeasonFolderFormat, SpecialsFolderFormat = model.SpecialsFolderFormat - - // IncludeSeriesTitle - // IncludeEpisodeTitle - // IncludeQuality - // ReplaceSpaces - // Separator - // NumberStyle }; } - public static void AddToResource(this BasicNamingConfig basicNamingConfig, NamingConfigResource resource) - { - resource.IncludeSeriesTitle = basicNamingConfig.IncludeSeriesTitle; - resource.IncludeEpisodeTitle = basicNamingConfig.IncludeEpisodeTitle; - resource.IncludeQuality = basicNamingConfig.IncludeQuality; - resource.ReplaceSpaces = basicNamingConfig.ReplaceSpaces; - resource.Separator = basicNamingConfig.Separator; - resource.NumberStyle = basicNamingConfig.NumberStyle; - } - public static NamingConfig ToModel(this NamingConfigResource resource) { return new NamingConfig diff --git a/src/Sonarr.Api.V3/openapi.json b/src/Sonarr.Api.V3/openapi.json index ee63aefa5..139d7b2dd 100644 --- a/src/Sonarr.Api.V3/openapi.json +++ b/src/Sonarr.Api.V3/openapi.json @@ -4737,48 +4737,6 @@ "type": "string" } }, - { - "name": "includeSeriesTitle", - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "includeEpisodeTitle", - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "includeQuality", - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "replaceSpaces", - "in": "query", - "schema": { - "type": "boolean" - } - }, - { - "name": "separator", - "in": "query", - "schema": { - "type": "string" - } - }, - { - "name": "numberStyle", - "in": "query", - "schema": { - "type": "string" - } - }, { "name": "id", "in": "query", @@ -9825,26 +9783,6 @@ "specialsFolderFormat": { "type": "string", "nullable": true - }, - "includeSeriesTitle": { - "type": "boolean" - }, - "includeEpisodeTitle": { - "type": "boolean" - }, - "includeQuality": { - "type": "boolean" - }, - "replaceSpaces": { - "type": "boolean" - }, - "separator": { - "type": "string", - "nullable": true - }, - "numberStyle": { - "type": "string", - "nullable": true } }, "additionalProperties": false @@ -12082,4 +12020,4 @@ "apikey": [ ] } ] -} \ No newline at end of file +}