You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
2.1 KiB
60 lines
2.1 KiB
using NzbDrone.Core.Organizer;
|
|
|
|
namespace Lidarr.Api.V1.Config
|
|
{
|
|
public class NamingExampleResource
|
|
{
|
|
public string SingleTrackExample { get; set; }
|
|
public string ArtistFolderExample { get; set; }
|
|
public string AlbumFolderExample { get; set; }
|
|
}
|
|
|
|
public static class NamingConfigResourceMapper
|
|
{
|
|
public static NamingConfigResource ToResource(this NamingConfig model)
|
|
{
|
|
return new NamingConfigResource
|
|
{
|
|
Id = model.Id,
|
|
|
|
RenameTracks = model.RenameTracks,
|
|
ReplaceIllegalCharacters = model.ReplaceIllegalCharacters,
|
|
StandardTrackFormat = model.StandardTrackFormat,
|
|
ArtistFolderFormat = model.ArtistFolderFormat,
|
|
AlbumFolderFormat = model.AlbumFolderFormat
|
|
//IncludeSeriesTitle
|
|
//IncludeEpisodeTitle
|
|
//IncludeQuality
|
|
//ReplaceSpaces
|
|
//Separator
|
|
//NumberStyle
|
|
};
|
|
}
|
|
|
|
public static void AddToResource(this BasicNamingConfig basicNamingConfig, NamingConfigResource resource)
|
|
{
|
|
resource.IncludeArtistName = basicNamingConfig.IncludeArtistName;
|
|
resource.IncludeAlbumTitle = basicNamingConfig.IncludeAlbumTitle;
|
|
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
|
|
{
|
|
Id = resource.Id,
|
|
|
|
RenameTracks = resource.RenameTracks,
|
|
ReplaceIllegalCharacters = resource.ReplaceIllegalCharacters,
|
|
StandardTrackFormat = resource.StandardTrackFormat,
|
|
|
|
ArtistFolderFormat = resource.ArtistFolderFormat,
|
|
AlbumFolderFormat = resource.AlbumFolderFormat
|
|
};
|
|
}
|
|
}
|
|
}
|