mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
separate EP and Single in artist releasetypes
This commit is contained in:
@@ -52,7 +52,6 @@ import { Button } from '/@/shared/components/button/button';
|
|||||||
import { Grid } from '/@/shared/components/grid/grid';
|
import { Grid } from '/@/shared/components/grid/grid';
|
||||||
import { Group } from '/@/shared/components/group/group';
|
import { Group } from '/@/shared/components/group/group';
|
||||||
import { Icon } from '/@/shared/components/icon/icon';
|
import { Icon } from '/@/shared/components/icon/icon';
|
||||||
import { Separator } from '/@/shared/components/separator/separator';
|
|
||||||
import { Spinner } from '/@/shared/components/spinner/spinner';
|
import { Spinner } from '/@/shared/components/spinner/spinner';
|
||||||
import { Spoiler } from '/@/shared/components/spoiler/spoiler';
|
import { Spoiler } from '/@/shared/components/spoiler/spoiler';
|
||||||
import { Stack } from '/@/shared/components/stack/stack';
|
import { Stack } from '/@/shared/components/stack/stack';
|
||||||
@@ -894,7 +893,18 @@ const ArtistAlbums = () => {
|
|||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Priority 3: Single (includes EP and other non-album types)
|
// Priority 3: EP
|
||||||
|
const hasEPType = album.releaseTypes?.some((type) => type.toLowerCase() === 'ep');
|
||||||
|
if (hasEPType) {
|
||||||
|
const epKey = 'ep';
|
||||||
|
if (!acc[epKey]) {
|
||||||
|
acc[epKey] = [];
|
||||||
|
}
|
||||||
|
acc[epKey].push(album);
|
||||||
|
return acc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Priority 4: Single (other non-album types)
|
||||||
const hasAlbumType = album.releaseTypes?.some(
|
const hasAlbumType = album.releaseTypes?.some(
|
||||||
(type) => type.toLowerCase() === 'album',
|
(type) => type.toLowerCase() === 'album',
|
||||||
);
|
);
|
||||||
@@ -907,7 +917,7 @@ const ArtistAlbums = () => {
|
|||||||
return acc;
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Priority 4: Album
|
// Priority 5: Album
|
||||||
const albumKey = 'album';
|
const albumKey = 'album';
|
||||||
if (!acc[albumKey]) {
|
if (!acc[albumKey]) {
|
||||||
acc[albumKey] = [];
|
acc[albumKey] = [];
|
||||||
@@ -922,7 +932,7 @@ const ArtistAlbums = () => {
|
|||||||
}, [filteredAndSortedAlbums, routeId]);
|
}, [filteredAndSortedAlbums, routeId]);
|
||||||
|
|
||||||
const releaseTypeEntries = useMemo(() => {
|
const releaseTypeEntries = useMemo(() => {
|
||||||
const priorityOrder = ['album', 'single', 'compilation', 'appears-on'];
|
const priorityOrder = ['album', 'ep', 'single', 'compilation', 'appears-on'];
|
||||||
const getPriority = (releaseType: string) => {
|
const getPriority = (releaseType: string) => {
|
||||||
const index = priorityOrder.indexOf(releaseType);
|
const index = priorityOrder.indexOf(releaseType);
|
||||||
return index === -1 ? 999 : index;
|
return index === -1 ? 999 : index;
|
||||||
@@ -947,18 +957,15 @@ const ArtistAlbums = () => {
|
|||||||
postProcess: 'sentenceCase',
|
postProcess: 'sentenceCase',
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'ep':
|
||||||
|
displayName = t('releaseType.primary.ep', {
|
||||||
|
postProcess: 'sentenceCase',
|
||||||
|
});
|
||||||
|
break;
|
||||||
case 'single':
|
case 'single':
|
||||||
displayName = (
|
displayName = t('releaseType.primary.single', {
|
||||||
<>
|
postProcess: 'sentenceCase',
|
||||||
{t('releaseType.primary.single', {
|
});
|
||||||
postProcess: 'sentenceCase',
|
|
||||||
})}
|
|
||||||
<Separator />
|
|
||||||
{t('releaseType.primary.ep', {
|
|
||||||
postProcess: 'upperCase',
|
|
||||||
})}
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
displayName = releaseType;
|
displayName = releaseType;
|
||||||
|
|||||||
Reference in New Issue
Block a user