mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
natural numeric sort for tag and disable disc/track total for nd track filter
This commit is contained in:
@@ -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 })),
|
||||||
}))
|
}))
|
||||||
|
|||||||
Reference in New Issue
Block a user