mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-26 22:46:37 -04:00
New: Custom Formats
Co-Authored-By: ta264 <ta264@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Books;
|
||||
using NzbDrone.Core.CustomFormats;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Qualities;
|
||||
@@ -22,7 +23,7 @@ namespace NzbDrone.Core.Organizer
|
||||
private static Edition _standardEdition;
|
||||
private static BookFile _singleTrackFile;
|
||||
private static BookFile _multiTrackFile;
|
||||
private static List<string> _preferredWords;
|
||||
private static List<CustomFormat> _customFormats;
|
||||
|
||||
public FileNameSampleService(IBuildFileNames buildFileNames)
|
||||
{
|
||||
@@ -63,6 +64,20 @@ namespace NzbDrone.Core.Organizer
|
||||
Book = _standardBook
|
||||
};
|
||||
|
||||
_customFormats = new List<CustomFormat>
|
||||
{
|
||||
new CustomFormat
|
||||
{
|
||||
Name = "Surround Sound",
|
||||
IncludeCustomFormatWhenRenaming = true
|
||||
},
|
||||
new CustomFormat
|
||||
{
|
||||
Name = "x264",
|
||||
IncludeCustomFormatWhenRenaming = true
|
||||
}
|
||||
};
|
||||
|
||||
var mediaInfo = new MediaInfoModel()
|
||||
{
|
||||
AudioFormat = "Flac Audio",
|
||||
@@ -95,11 +110,6 @@ namespace NzbDrone.Core.Organizer
|
||||
Part = 1,
|
||||
PartCount = 2
|
||||
};
|
||||
|
||||
_preferredWords = new List<string>
|
||||
{
|
||||
"iNTERNAL"
|
||||
};
|
||||
}
|
||||
|
||||
public SampleResult GetStandardTrackSample(NamingConfig nameSpec)
|
||||
@@ -137,7 +147,7 @@ namespace NzbDrone.Core.Organizer
|
||||
{
|
||||
try
|
||||
{
|
||||
return _buildFileNames.BuildBookFileName(author, bookFile.Edition.Value, bookFile, nameSpec, _preferredWords);
|
||||
return _buildFileNames.BuildBookFileName(author, bookFile.Edition.Value, bookFile, nameSpec, _customFormats);
|
||||
}
|
||||
catch (NamingFormatException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user