Allow parentheses (angle brackets) in file name pattern (#1601)
This commit is contained in:
+13
-13
@@ -181,49 +181,49 @@
|
|||||||
<div class="example-category">
|
<div class="example-category">
|
||||||
<h4 class="subsection-title">Examples with Full Metadata</h4>
|
<h4 class="subsection-title">Examples with Full Metadata</h4>
|
||||||
<div class="metadata-sample">
|
<div class="metadata-sample">
|
||||||
<span>title: <code>Harry Potter and the Sorcerer's Stone</code></span>
|
<span>title: <code>The Name of the Wind</code></span>
|
||||||
<span>subtitle: <code>The Boy Who Lived</code></span>
|
<span>subtitle: <code>Special Edition</code></span>
|
||||||
<span>authors: <code>J.K. Rowling</code></span>
|
<span>authors: <code>Patrick Rothfuss</code></span>
|
||||||
<span>series: <code>Harry Potter</code></span>
|
<span>series: <code>The Kingkiller Chronicle</code></span>
|
||||||
<span>seriesIndex: <code>01</code></span>
|
<span>seriesIndex: <code>01</code></span>
|
||||||
<span>year: <code>1997</code></span>
|
<span>year: <code>2007</code></span>
|
||||||
<span>currentFilename: <code>harry1_original.epub</code></span>
|
<span>currentFilename: <code>name_of_the_wind_original.epub</code></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="example-list">
|
<div class="example-list">
|
||||||
<div class="example-item">
|
<div class="example-item">
|
||||||
<p class="example-pattern"><strong>Basic pattern:</strong> <code>{{ '{authors} - {title}' }}</code></p>
|
<p class="example-pattern"><strong>Basic pattern:</strong> <code>{{ '{authors} - {title}' }}</code></p>
|
||||||
<p class="example-output"><strong>Output:</strong> <code>J.K. Rowling - Harry Potter and the Sorcerer's Stone.epub</code></p>
|
<p class="example-output"><strong>Output:</strong> <code>Patrick Rothfuss - The Name of the Wind.epub</code></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="example-item">
|
<div class="example-item">
|
||||||
<p class="example-pattern"><strong>Pattern with punctuation:</strong> <code>{{ '{title}: {series}' }}</code></p>
|
<p class="example-pattern"><strong>Pattern with punctuation:</strong> <code>{{ '{title}: {series}' }}</code></p>
|
||||||
<p class="example-output"><strong>Output:</strong> <code>Harry Potter and the Sorcerer's Stone: Harry Potter.epub</code></p>
|
<p class="example-output"><strong>Output:</strong> <code>The Name of the Wind: The Kingkiller Chronicle.epub</code></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="example-item">
|
<div class="example-item">
|
||||||
<p class="example-pattern"><strong>Series in folder path:</strong> <code>{{ '{authors}/{series}/{seriesIndex} - {title}' }}</code></p>
|
<p class="example-pattern"><strong>Series in folder path:</strong> <code>{{ '{authors}/{series}/{seriesIndex} - {title}' }}</code></p>
|
||||||
<p class="example-output"><strong>Output:</strong> <code>J.K. Rowling/Harry Potter/01 - Harry Potter and the Sorcerer's Stone.epub</code></p>
|
<p class="example-output"><strong>Output:</strong> <code>Patrick Rothfuss/The Kingkiller Chronicle/01 - The Name of the Wind.epub</code></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="example-item">
|
<div class="example-item">
|
||||||
<p class="example-pattern"><strong>Folder only:</strong> <code>{{ '{title}/' }}</code></p>
|
<p class="example-pattern"><strong>Folder only:</strong> <code>{{ '{title}/' }}</code></p>
|
||||||
<p class="example-output"><strong>Output:</strong> <code>/Harry Potter and the Sorcerer's Stone/harry1_original.epub</code></p>
|
<p class="example-output"><strong>Output:</strong> <code>/The Name of the Wind/name_of_the_wind_original.epub</code></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="example-item">
|
<div class="example-item">
|
||||||
<p class="example-pattern"><strong>Absolute path:</strong> <code>{{ '/{authors}/{title}' }}</code></p>
|
<p class="example-pattern"><strong>Absolute path:</strong> <code>{{ '/{authors}/{title}' }}</code></p>
|
||||||
<p class="example-output"><strong>Output:</strong> <code>/J.K. Rowling/Harry Potter and the Sorcerer's Stone.epub</code></p>
|
<p class="example-output"><strong>Output:</strong> <code>/Patrick Rothfuss/The Name of the Wind.epub</code></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="example-item">
|
<div class="example-item">
|
||||||
<p class="example-pattern"><strong>Reuse original filename in path:</strong> <code>{{ '{authors}/{series}/{currentFilename}' }}</code></p>
|
<p class="example-pattern"><strong>Reuse original filename in path:</strong> <code>{{ '{authors}/{series}/{currentFilename}' }}</code></p>
|
||||||
<p class="example-output"><strong>Output:</strong> <code>J.K. Rowling/Harry Potter/harry1_original.epub</code></p>
|
<p class="example-output"><strong>Output:</strong> <code>Patrick Rothfuss/The Kingkiller Chronicle/name_of_the_wind_original.epub</code></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="example-item">
|
<div class="example-item">
|
||||||
<p class="example-pattern"><strong>Title + Subtitle:</strong> <code>{{ '{title}: {subtitle}' }}</code></p>
|
<p class="example-pattern"><strong>Title + Subtitle:</strong> <code>{{ '{title}: {subtitle}' }}</code></p>
|
||||||
<p class="example-output"><strong>Output:</strong> <code>Harry Potter and the Sorcerer's Stone: The Boy Who Lived.epub</code></p>
|
<p class="example-output"><strong>Output:</strong> <code>The Name of the Wind: The Kingkiller Chronicle: Day One.epub</code></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+12
-12
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
.settings-description {
|
.settings-description {
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
.section-description {
|
.section-description {
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
label {
|
label {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--p-text-color);
|
color: var(--p-text-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
.error-message {
|
.error-message {
|
||||||
color: var(--p-red-500);
|
color: var(--p-red-500);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
margin-top: 0.25rem;
|
margin-top: 0.25rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@
|
|||||||
|
|
||||||
.preview-label {
|
.preview-label {
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.preview-value {
|
.preview-value {
|
||||||
@@ -227,7 +227,7 @@
|
|||||||
|
|
||||||
.placeholders-description {
|
.placeholders-description {
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
|
|
||||||
code {
|
code {
|
||||||
@@ -263,7 +263,7 @@
|
|||||||
|
|
||||||
li {
|
li {
|
||||||
color: var(--p-text-color);
|
color: var(--p-text-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -280,7 +280,7 @@
|
|||||||
.optional-blocks-info {
|
.optional-blocks-info {
|
||||||
p {
|
p {
|
||||||
color: var(--p-text-color);
|
color: var(--p-text-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
@@ -307,7 +307,7 @@
|
|||||||
|
|
||||||
li {
|
li {
|
||||||
color: var(--p-text-color);
|
color: var(--p-text-color);
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
margin-bottom: 0.25rem;
|
margin-bottom: 0.25rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -342,7 +342,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
span {
|
span {
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
color: var(--p-text-muted-color);
|
color: var(--p-text-muted-color);
|
||||||
|
|
||||||
code {
|
code {
|
||||||
@@ -376,7 +376,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.example-pattern {
|
.example-pattern {
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
@@ -392,7 +392,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.example-output {
|
.example-output {
|
||||||
font-size: 0.875rem;
|
font-size: 0.9rem;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
||||||
strong {
|
strong {
|
||||||
|
|||||||
+10
-10
@@ -21,15 +21,15 @@ import {ExternalDocLinkComponent} from '../../../shared/components/external-doc-
|
|||||||
})
|
})
|
||||||
export class FileNamingPatternComponent implements OnInit {
|
export class FileNamingPatternComponent implements OnInit {
|
||||||
readonly exampleMetadata: Record<string, string> = {
|
readonly exampleMetadata: Record<string, string> = {
|
||||||
title: "Harry Potter and the Sorcerer's Stone",
|
title: "The Name of the Wind",
|
||||||
subtitle: 'The Boy Who Lived',
|
subtitle: "Special Edition",
|
||||||
authors: 'J.K. Rowling',
|
authors: "Patrick Rothfuss",
|
||||||
year: '1997',
|
year: "2007",
|
||||||
series: 'Harry Potter',
|
series: "The Kingkiller Chronicle",
|
||||||
seriesIndex: '01',
|
seriesIndex: "01",
|
||||||
language: 'en',
|
language: "English",
|
||||||
publisher: 'Bloomsbury',
|
publisher: "DAW Books",
|
||||||
isbn: '9780747532699',
|
isbn: "9780756404741",
|
||||||
};
|
};
|
||||||
|
|
||||||
defaultPattern = '';
|
defaultPattern = '';
|
||||||
@@ -95,7 +95,7 @@ export class FileNamingPatternComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
validatePattern(pattern: string): boolean {
|
validatePattern(pattern: string): boolean {
|
||||||
const validPatternRegex = /^[\w\s\-{}\/().<>.,:'"]*$/;
|
const validPatternRegex = /^[\w\s\-{}\[\]\/().<>.,:'"]*$/;
|
||||||
return validPatternRegex.test(pattern);
|
return validPatternRegex.test(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user