mirror of
https://github.com/Readarr/Readarr
synced 2026-01-04 14:43:42 +01:00
Clean up naming tokens page
This commit is contained in:
parent
23772ce312
commit
c484a29099
2 changed files with 6 additions and 87 deletions
|
|
@ -30,11 +30,11 @@ const caseOptions = [
|
|||
const fileNameTokens = [
|
||||
{
|
||||
token: '{Author Name} - {Book Title} - {Quality Full}',
|
||||
example: 'Author Name - Book Title - MP3-320 Proper'
|
||||
example: 'Author Name - Book Title - MP3 Proper'
|
||||
},
|
||||
{
|
||||
token: '{Author.Name}.{Book.Title}.{Quality.Full}',
|
||||
example: 'Author.Name.Book.Title.MP3-320'
|
||||
example: 'Author.Name.Book.Title.MP3'
|
||||
}
|
||||
];
|
||||
|
||||
|
|
@ -62,26 +62,17 @@ const bookTokens = [
|
|||
{ token: '{Book Disambiguation}', example: 'Disambiguation' }
|
||||
];
|
||||
|
||||
const mediumTokens = [
|
||||
{ token: '{medium:0}', example: '1' },
|
||||
{ token: '{medium:00}', example: '01' }
|
||||
];
|
||||
|
||||
const mediumFormatTokens = [
|
||||
{ token: '{Medium Format}', example: 'CD' }
|
||||
];
|
||||
|
||||
const releaseDateTokens = [
|
||||
{ token: '{Release Year}', example: '2016' }
|
||||
];
|
||||
|
||||
const qualityTokens = [
|
||||
{ token: '{Quality Full}', example: 'FLAC Proper' },
|
||||
{ token: '{Quality Title}', example: 'FLAC' }
|
||||
{ token: '{Quality Full}', example: 'AZW3 Proper' },
|
||||
{ token: '{Quality Title}', example: 'AZW3' }
|
||||
];
|
||||
|
||||
const mediaInfoTokens = [
|
||||
{ token: '{MediaInfo AudioCodec}', example: 'FLAC' },
|
||||
{ token: '{MediaInfo AudioCodec}', example: 'MP3' },
|
||||
{ token: '{MediaInfo AudioChannels}', example: '2.0' },
|
||||
{ token: '{MediaInfo AudioBitRate}', example: '320kbps' },
|
||||
{ token: '{MediaInfo AudioBitsPerSample}', example: '24bit' },
|
||||
|
|
@ -94,7 +85,7 @@ const otherTokens = [
|
|||
];
|
||||
|
||||
const originalTokens = [
|
||||
{ token: '{Original Title}', example: 'Author.Name.Book.Name.2018.FLAC-EVOLVE' },
|
||||
{ token: '{Original Title}', example: 'Author.Name.Book.Name.2018.AZW3-EVOLVE' },
|
||||
{ token: '{Original Filename}', example: '01 - book name' }
|
||||
];
|
||||
|
||||
|
|
@ -306,56 +297,6 @@ class NamingModal extends Component {
|
|||
</div>
|
||||
}
|
||||
|
||||
{
|
||||
book &&
|
||||
<div>
|
||||
<FieldSet legend={translate('Medium')}>
|
||||
<div className={styles.groups}>
|
||||
{
|
||||
mediumTokens.map(({ token, example }) => {
|
||||
return (
|
||||
<NamingOption
|
||||
key={token}
|
||||
name={name}
|
||||
value={value}
|
||||
token={token}
|
||||
example={example}
|
||||
tokenSeparator={tokenSeparator}
|
||||
tokenCase={tokenCase}
|
||||
onPress={this.onOptionPress}
|
||||
/>
|
||||
);
|
||||
}
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</FieldSet>
|
||||
|
||||
<FieldSet legend={translate('MediumFormat')}>
|
||||
<div className={styles.groups}>
|
||||
{
|
||||
mediumFormatTokens.map(({ token, example }) => {
|
||||
return (
|
||||
<NamingOption
|
||||
key={token}
|
||||
name={name}
|
||||
value={value}
|
||||
token={token}
|
||||
example={example}
|
||||
tokenSeparator={tokenSeparator}
|
||||
tokenCase={tokenCase}
|
||||
onPress={this.onOptionPress}
|
||||
/>
|
||||
);
|
||||
}
|
||||
)
|
||||
}
|
||||
</div>
|
||||
</FieldSet>
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
{
|
||||
additional &&
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -35,17 +35,10 @@ public class FileNameBuilder : IBuildFileNames
|
|||
private static readonly Regex TitleRegex = new Regex(@"\{(?<prefix>[- ._\[(]*)(?<token>(?:[a-z0-9]+)(?:(?<separator>[- ._]+)(?:[a-z0-9]+))?)(?::(?<customFormat>[a-z0-9]+))?(?<suffix>[- ._)\]]*)\}",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public static readonly Regex TrackRegex = new Regex(@"(?<track>\{track(?:\:0+)?})",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private static readonly Regex MediumRegex = new Regex(@"(?<medium>\{medium(?:\:0+)?})",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public static readonly Regex SeasonEpisodePatternRegex = new Regex(@"(?<separator>(?<=})[- ._]+?)?(?<seasonEpisode>s?{season(?:\:0+)?}(?<episodeSeparator>[- ._]?[ex])(?<episode>{episode(?:\:0+)?}))(?<separator>[- ._]+?(?={))?",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public static readonly Regex ReleaseDateRegex = new Regex(@"\{Release(\s|\W|_)Year\}", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public static readonly Regex AuthorNameRegex = new Regex(@"(?<token>\{(?:Author)(?<separator>[- ._])(Clean)?Name(The)?\})",
|
||||
RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
|
|
@ -58,11 +51,6 @@ public class FileNameBuilder : IBuildFileNames
|
|||
private static readonly Regex ScenifyRemoveChars = new Regex(@"(?<=\s)(,|<|>|\/|\\|;|:|'|""|\||`|~|!|\?|@|$|%|^|\*|-|_|=){1}(?=\s)|('|:|\?|,)(?=(?:(?:s|m)\s)|\s|$)|(\(|\)|\[|\]|\{|\})", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
private static readonly Regex ScenifyReplaceChars = new Regex(@"[\/]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
//TODO: Support Written numbers (One, Two, etc) and Roman Numerals (I, II, III etc)
|
||||
private static readonly Regex MultiPartCleanupRegex = new Regex(@"(?:\(\d+\)|(Part|Pt\.?)\s?\d+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
private static readonly char[] TrackTitleTrimCharacters = new[] { ' ', '.', '?' };
|
||||
|
||||
private static readonly Regex TitlePrefixRegex = new Regex(@"^(The|An|A) (.*?)((?: *\([^)]+\))*)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public FileNameBuilder(INamingConfigService namingConfigService,
|
||||
|
|
@ -427,14 +415,4 @@ public string DefaultValue(string defaultValue)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public enum MultiEpisodeStyle
|
||||
{
|
||||
Extend = 0,
|
||||
Duplicate = 1,
|
||||
Repeat = 2,
|
||||
Scene = 3,
|
||||
Range = 4,
|
||||
PrefixedRange = 5
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue