mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
add support for track subtitle display (#1177)
This commit is contained in:
@@ -16,3 +16,7 @@
|
|||||||
.name-container.large {
|
.name-container.large {
|
||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: var(--theme-colors-primary);
|
||||||
|
}
|
||||||
|
|||||||
@@ -83,8 +83,6 @@ function QueueSongTitleColumn(props: ItemTableListInnerColumn) {
|
|||||||
const path = getTitlePath(props.itemType, (props.data[props.rowIndex] as any).id as string);
|
const path = getTitlePath(props.itemType, (props.data[props.rowIndex] as any).id as string);
|
||||||
const item = props.data[props.rowIndex] as any;
|
const item = props.data[props.rowIndex] as any;
|
||||||
|
|
||||||
const textStyles = isActive ? { color: 'var(--theme-colors-primary)' } : {};
|
|
||||||
|
|
||||||
const titleLinkProps = path
|
const titleLinkProps = path
|
||||||
? {
|
? {
|
||||||
component: Link,
|
component: Link,
|
||||||
@@ -98,15 +96,29 @@ function QueueSongTitleColumn(props: ItemTableListInnerColumn) {
|
|||||||
<TableColumnContainer {...props}>
|
<TableColumnContainer {...props}>
|
||||||
<Text
|
<Text
|
||||||
className={clsx({
|
className={clsx({
|
||||||
|
[styles.active]: isActive,
|
||||||
[styles.compact]: props.size === 'compact',
|
[styles.compact]: props.size === 'compact',
|
||||||
[styles.large]: props.size === 'large',
|
[styles.large]: props.size === 'large',
|
||||||
[styles.nameContainer]: true,
|
[styles.nameContainer]: true,
|
||||||
})}
|
})}
|
||||||
isNoSelect
|
isNoSelect
|
||||||
{...titleLinkProps}
|
{...titleLinkProps}
|
||||||
style={textStyles}
|
|
||||||
>
|
>
|
||||||
{row}
|
{row}
|
||||||
|
{song?.trackSubtitle && props.itemType !== LibraryItem.QUEUE_SONG && (
|
||||||
|
<Text
|
||||||
|
className={clsx({
|
||||||
|
[styles.active]: isActive,
|
||||||
|
})}
|
||||||
|
component="span"
|
||||||
|
isMuted
|
||||||
|
size="sm"
|
||||||
|
>
|
||||||
|
{' ('}
|
||||||
|
{song.trackSubtitle}
|
||||||
|
{')'}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
</TableColumnContainer>
|
</TableColumnContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
+4
@@ -70,3 +70,7 @@
|
|||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
color: var(--theme-colors-primary);
|
||||||
|
}
|
||||||
|
|||||||
+19
-3
@@ -213,7 +213,6 @@ export const QueueSongTitleCombinedColumn = (props: ItemTableListInnerColumn) =>
|
|||||||
const path = getTitlePath(props.itemType, (props.data[props.rowIndex] as any).id as string);
|
const path = getTitlePath(props.itemType, (props.data[props.rowIndex] as any).id as string);
|
||||||
|
|
||||||
const item = props.data[props.rowIndex] as any;
|
const item = props.data[props.rowIndex] as any;
|
||||||
const textStyles = isActive ? { color: 'var(--theme-colors-primary)' } : {};
|
|
||||||
|
|
||||||
const titleLinkProps = path
|
const titleLinkProps = path
|
||||||
? {
|
? {
|
||||||
@@ -265,17 +264,34 @@ export const QueueSongTitleCombinedColumn = (props: ItemTableListInnerColumn) =>
|
|||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={clsx(styles.textContainer, {
|
className={clsx(styles.textContainer, {
|
||||||
|
[styles.active]: isActive,
|
||||||
[styles.compact]: props.size === 'compact',
|
[styles.compact]: props.size === 'compact',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Text
|
<Text
|
||||||
className={styles.title}
|
className={clsx({
|
||||||
|
[styles.active]: isActive,
|
||||||
|
[styles.title]: true,
|
||||||
|
})}
|
||||||
isNoSelect
|
isNoSelect
|
||||||
size="md"
|
size="md"
|
||||||
{...titleLinkProps}
|
{...titleLinkProps}
|
||||||
style={textStyles}
|
|
||||||
>
|
>
|
||||||
{row.name as string}
|
{row.name as string}
|
||||||
|
{song?.trackSubtitle && props.itemType !== LibraryItem.QUEUE_SONG && (
|
||||||
|
<Text
|
||||||
|
className={clsx({
|
||||||
|
[styles.active]: isActive,
|
||||||
|
})}
|
||||||
|
component="span"
|
||||||
|
isMuted
|
||||||
|
size="sm"
|
||||||
|
>
|
||||||
|
{' ('}
|
||||||
|
{song.trackSubtitle}
|
||||||
|
{')'}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<div className={styles.artists}>
|
<div className={styles.artists}>
|
||||||
<JoinedArtists
|
<JoinedArtists
|
||||||
|
|||||||
@@ -173,6 +173,13 @@ export const LeftControls = () => {
|
|||||||
to={AppRoute.NOW_PLAYING}
|
to={AppRoute.NOW_PLAYING}
|
||||||
>
|
>
|
||||||
{title || '—'}
|
{title || '—'}
|
||||||
|
{currentSong?.trackSubtitle && (
|
||||||
|
<Text component="span" isMuted size="sm">
|
||||||
|
{' ('}
|
||||||
|
{currentSong.trackSubtitle}
|
||||||
|
{')'}
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
{isSongDefined && (
|
{isSongDefined && (
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
|
|||||||
@@ -244,6 +244,7 @@ const normalizeSong = (
|
|||||||
size,
|
size,
|
||||||
tags: getTags(item),
|
tags: getTags(item),
|
||||||
trackNumber: item.IndexNumber,
|
trackNumber: item.IndexNumber,
|
||||||
|
trackSubtitle: null,
|
||||||
updatedAt: item.DateCreated,
|
updatedAt: item.DateCreated,
|
||||||
userFavorite: (item.UserData && item.UserData.IsFavorite) || false,
|
userFavorite: (item.UserData && item.UserData.IsFavorite) || false,
|
||||||
userRating: null,
|
userRating: null,
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ const normalizeSong = (
|
|||||||
size: item.size,
|
size: item.size,
|
||||||
tags: item.tags || null,
|
tags: item.tags || null,
|
||||||
trackNumber: item.trackNumber,
|
trackNumber: item.trackNumber,
|
||||||
|
trackSubtitle: item.tags?.subtitle ? item.tags.subtitle.join(' · ') : null,
|
||||||
updatedAt: item.updatedAt,
|
updatedAt: item.updatedAt,
|
||||||
userFavorite: item.starred || false,
|
userFavorite: item.starred || false,
|
||||||
userRating: item.rating || null,
|
userRating: item.rating || null,
|
||||||
|
|||||||
@@ -195,6 +195,7 @@ const normalizeSong = (
|
|||||||
size: item.size,
|
size: item.size,
|
||||||
tags: null,
|
tags: null,
|
||||||
trackNumber: item.track || 1,
|
trackNumber: item.track || 1,
|
||||||
|
trackSubtitle: null,
|
||||||
updatedAt: '',
|
updatedAt: '',
|
||||||
userFavorite: Boolean(item.starred) || false,
|
userFavorite: Boolean(item.starred) || false,
|
||||||
userRating: item.userRating || null,
|
userRating: item.userRating || null,
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ export type Song = {
|
|||||||
size: number;
|
size: number;
|
||||||
tags: null | Record<string, string[]>;
|
tags: null | Record<string, string[]>;
|
||||||
trackNumber: number;
|
trackNumber: number;
|
||||||
|
trackSubtitle: null | string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
userFavorite: boolean;
|
userFavorite: boolean;
|
||||||
userRating: null | number;
|
userRating: null | number;
|
||||||
|
|||||||
Reference in New Issue
Block a user