mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-21 18:06:30 +02:00
fix: use compilation release type label on album details (#2236)
This commit is contained in:
@@ -105,7 +105,17 @@ const AlbumMetadataTags = ({ album }: AlbumMetadataTagsProps) => {
|
||||
const defaultTagItems = useMemo(() => {
|
||||
if (!album) return [];
|
||||
|
||||
const releaseTypes = normalizeReleaseTypes(album.releaseTypes ?? [], t).map((type) => ({
|
||||
const releaseTypes = [...(album.releaseTypes ?? [])];
|
||||
|
||||
const hasCompilationReleaseType = releaseTypes.some(
|
||||
(type) => type.toLowerCase() === 'compilation',
|
||||
);
|
||||
|
||||
if (album.isCompilation && !hasCompilationReleaseType) {
|
||||
releaseTypes.push('compilation');
|
||||
}
|
||||
|
||||
const releaseTypeItems = normalizeReleaseTypes(releaseTypes, t).map((type) => ({
|
||||
id: type,
|
||||
value: titleCase(type),
|
||||
}));
|
||||
@@ -124,24 +134,15 @@ const AlbumMetadataTags = ({ album }: AlbumMetadataTagsProps) => {
|
||||
|
||||
const items: Array<{ id: string; value: ReactNode | string | undefined }> = [];
|
||||
|
||||
items.push(
|
||||
...releaseTypes,
|
||||
{
|
||||
id: 'isCompilation',
|
||||
value: album?.isCompilation ? t('filter.isCompilation') : undefined,
|
||||
},
|
||||
...releaseCountries,
|
||||
...releaseStatuses,
|
||||
{
|
||||
id: 'explicitStatus',
|
||||
value:
|
||||
album.explicitStatus === ExplicitStatus.EXPLICIT
|
||||
? t('common.explicit')
|
||||
: album.explicitStatus === ExplicitStatus.CLEAN
|
||||
? t('common.clean')
|
||||
: undefined,
|
||||
},
|
||||
);
|
||||
items.push(...releaseTypeItems, ...releaseCountries, ...releaseStatuses, {
|
||||
id: 'explicitStatus',
|
||||
value:
|
||||
album.explicitStatus === ExplicitStatus.EXPLICIT
|
||||
? t('common.explicit')
|
||||
: album.explicitStatus === ExplicitStatus.CLEAN
|
||||
? t('common.clean')
|
||||
: undefined,
|
||||
});
|
||||
|
||||
return items.filter((item) => item.value);
|
||||
}, [album, t]);
|
||||
|
||||
Reference in New Issue
Block a user