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({
name: 'Tags',
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 })),
});
}
@@ -59,19 +59,17 @@ const EXCLUDED_ALBUM_TAGS = new Set<string>([
'asin',
'barcode',
'copyright',
'disctotal',
'encodedby',
'isrc',
'key',
'language',
'musicbrainz_workid',
'script',
'tracktotal',
'website',
'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
const ID_TAGS = new Set<string>(['albumversion', 'mood']);
@@ -747,7 +745,7 @@ export const NavidromeController: InternalControllerEndpoint = {
const { apiClientProps } = args;
if (!hasFeature(apiClientProps.server, ServerFeature.TAGS)) {
return { boolTags: undefined, enumTags: undefined, excluded: { album: [], song: [] } };
return { excluded: { album: [], song: [] } };
}
const res = await ndApiClient(apiClientProps).getTagList({
@@ -783,7 +781,11 @@ export const NavidromeController: InternalControllerEndpoint = {
name: data[0],
options: data[1]
.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 })),
}))