mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-10-05 10:51:16 +01:00
Change path default for audiobooks + description fixes (#933)
This commit is contained in:
@@ -106,7 +106,6 @@ export const NamingTemplateField = ({
|
||||
disabled={fieldDisabled}
|
||||
className="w-full rounded-lg border border-(--border-muted) bg-(--bg-soft) px-3 py-2 text-sm transition-colors focus:border-sky-500 focus:ring-2 focus:ring-sky-500/50 focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-60"
|
||||
/>
|
||||
{boundField.description && <p className="text-xs opacity-60">{boundField.description}</p>}
|
||||
</div>
|
||||
|
||||
{(hasPathSeparatorInFilename || preview.unknownTokens.length > 0) && (
|
||||
|
||||
@@ -2,11 +2,18 @@ import { describe, expect, it } from 'vitest';
|
||||
|
||||
import {
|
||||
buildNamingTemplatePreview,
|
||||
NAMING_TEMPLATE_TOKENS,
|
||||
renderNamingTemplate,
|
||||
SAMPLE_NAMING_METADATA,
|
||||
} from '../utils/namingTemplatePreview';
|
||||
|
||||
describe('namingTemplatePreview', () => {
|
||||
it('groups primary title with universal variables', () => {
|
||||
expect(NAMING_TEMPLATE_TOKENS.find((token) => token.token === 'PrimaryTitle')?.group).toBe(
|
||||
'Universal',
|
||||
);
|
||||
});
|
||||
|
||||
it('renders primary title in path previews', () => {
|
||||
const preview = buildNamingTemplatePreview(
|
||||
'{Author}/{Series/}{SeriesPosition - }{PrimaryTitle} ({Year})',
|
||||
|
||||
@@ -39,7 +39,7 @@ export const NAMING_TEMPLATE_TOKENS: NamingTemplateToken[] = [
|
||||
label: 'Primary title',
|
||||
description: 'Title without the subtitle suffix',
|
||||
value: 'The Hound of the Baskervilles',
|
||||
group: 'Core',
|
||||
group: 'Universal',
|
||||
},
|
||||
{
|
||||
token: 'Year',
|
||||
|
||||
Reference in New Issue
Block a user