mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 04:20:12 +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({
|
||||
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 })),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user