mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-19 17:32:38 +01:00
parent
ed340be2b1
commit
38cd130da5
@ -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; }
|
||||
}
|
||||
}
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user