1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-19 17:32:38 +01:00

Fixed: Remove old naming config from API responses

Closes #9741
This commit is contained in:
Qstick 2024-02-10 21:32:55 -06:00
parent ed340be2b1
commit 38cd130da5
5 changed files with 1 additions and 42 deletions

View File

@ -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; }
}
}

View File

@ -24,7 +24,6 @@ public interface IBuildFileNames
{
string BuildFileName(Movie movie, MovieFile movieFile, NamingConfig namingConfig = null, List<CustomFormat> customFormats = null);
string BuildFilePath(Movie movie, string fileName, string extension);
BasicNamingConfig GetBasicNamingConfig(NamingConfig nameSpec);
string GetMovieFolder(Movie movie, NamingConfig namingConfig = null);
}
@ -155,11 +154,6 @@ public string BuildFilePath(Movie movie, string fileName, string extension)
return Path.Combine(path, fileName + extension);
}
public BasicNamingConfig GetBasicNamingConfig(NamingConfig nameSpec)
{
return new BasicNamingConfig(); // For now let's be lazy
}
public string GetMovieFolder(Movie movie, NamingConfig namingConfig = null)
{
if (namingConfig == null)

View File

@ -44,12 +44,6 @@ public NamingConfigResource GetNamingConfig()
var nameSpec = _namingConfigService.GetConfig();
var resource = nameSpec.ToResource();
if (resource.StandardMovieFormat.IsNotNullOrWhiteSpace())
{
var basicConfig = _filenameBuilder.GetBasicNamingConfig(nameSpec);
basicConfig.AddToResource(resource);
}
return resource;
}

View File

@ -10,9 +10,5 @@ public class NamingConfigResource : RestResource
public ColonReplacementFormat ColonReplacementFormat { get; set; }
public string StandardMovieFormat { get; set; }
public string MovieFolderFormat { get; set; }
public bool IncludeQuality { get; set; }
public bool ReplaceSpaces { get; set; }
public string Separator { get; set; }
public string NumberStyle { get; set; }
}
}

View File

@ -20,23 +20,10 @@ public static NamingConfigResource ToResource(this NamingConfig model)
ReplaceIllegalCharacters = model.ReplaceIllegalCharacters,
ColonReplacementFormat = model.ColonReplacementFormat,
StandardMovieFormat = model.StandardMovieFormat,
MovieFolderFormat = model.MovieFolderFormat,
// IncludeQuality
// ReplaceSpaces
// Separator
// NumberStyle
MovieFolderFormat = model.MovieFolderFormat
};
}
public static void AddToResource(this BasicNamingConfig basicNamingConfig, NamingConfigResource resource)
{
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