natural numeric sort for tag and disable disc/track total for nd track filter

This commit is contained in:
Kendall Garner
2026-01-18 17:19:30 -08:00
parent 2dd83b111f
commit 45df497ee6
2 changed files with 10 additions and 6 deletions
@@ -1251,7 +1251,9 @@ export const JellyfinController: InternalControllerEndpoint = {
tags.push({ tags.push({
name: 'Tags', name: 'Tags',
options: res.body.Tags.sort((a, b) => options: res.body.Tags.sort((a, b) =>
a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()), a
.toLocaleLowerCase()
.localeCompare(b.toLocaleLowerCase(), undefined, { numeric: true }),
).map((tag) => ({ id: tag, name: tag })), ).map((tag) => ({ id: tag, name: tag })),
}); });
} }
@@ -59,19 +59,17 @@ const EXCLUDED_ALBUM_TAGS = new Set<string>([
'asin', 'asin',
'barcode', 'barcode',
'copyright', 'copyright',
'disctotal',
'encodedby', 'encodedby',
'isrc', 'isrc',
'key', 'key',
'language', 'language',
'musicbrainz_workid', 'musicbrainz_workid',
'script', 'script',
'tracktotal',
'website', 'website',
'work', 'work',
]); ]);
const EXCLUDED_SONG_TAGS = new Set<string>([]); const EXCLUDED_SONG_TAGS = new Set<string>(['disctotal', 'tracktotal']);
// Tags that use IDs as values as opposed to the tag value // Tags that use IDs as values as opposed to the tag value
const ID_TAGS = new Set<string>(['albumversion', 'mood']); const ID_TAGS = new Set<string>(['albumversion', 'mood']);
@@ -747,7 +745,7 @@ export const NavidromeController: InternalControllerEndpoint = {
const { apiClientProps } = args; const { apiClientProps } = args;
if (!hasFeature(apiClientProps.server, ServerFeature.TAGS)) { if (!hasFeature(apiClientProps.server, ServerFeature.TAGS)) {
return { boolTags: undefined, enumTags: undefined, excluded: { album: [], song: [] } }; return { excluded: { album: [], song: [] } };
} }
const res = await ndApiClient(apiClientProps).getTagList({ const res = await ndApiClient(apiClientProps).getTagList({
@@ -783,7 +781,11 @@ export const NavidromeController: InternalControllerEndpoint = {
name: data[0], name: data[0],
options: data[1] options: data[1]
.sort((a, b) => .sort((a, b) =>
a.name.toLocaleLowerCase().localeCompare(b.name.toLocaleLowerCase()), a.name
.toLocaleLowerCase()
.localeCompare(b.name.toLocaleLowerCase(), undefined, {
numeric: true,
}),
) )
.map((option) => ({ id: option.id, name: option.name })), .map((option) => ({ id: option.id, name: option.name })),
})) }))