Add discsubtitle for navidrome (#217)
This commit is contained in:
parent
8b0fe69e1c
commit
45b80ac395
6 changed files with 20 additions and 1 deletions
|
@ -150,6 +150,7 @@ const normalizeSong = (
|
||||||
container: (item.MediaSources && item.MediaSources[0]?.Container) || null,
|
container: (item.MediaSources && item.MediaSources[0]?.Container) || null,
|
||||||
createdAt: item.DateCreated,
|
createdAt: item.DateCreated,
|
||||||
discNumber: (item.ParentIndexNumber && item.ParentIndexNumber) || 1,
|
discNumber: (item.ParentIndexNumber && item.ParentIndexNumber) || 1,
|
||||||
|
discSubtitle: null,
|
||||||
duration: item.RunTimeTicks / 10000,
|
duration: item.RunTimeTicks / 10000,
|
||||||
gain: item.LUFS
|
gain: item.LUFS
|
||||||
? {
|
? {
|
||||||
|
|
|
@ -88,6 +88,7 @@ const normalizeSong = (
|
||||||
container: item.suffix,
|
container: item.suffix,
|
||||||
createdAt: item.createdAt.split('T')[0],
|
createdAt: item.createdAt.split('T')[0],
|
||||||
discNumber: item.discNumber,
|
discNumber: item.discNumber,
|
||||||
|
discSubtitle: item.discSubtitle ? item.discSubtitle : null,
|
||||||
duration: item.duration * 1000,
|
duration: item.duration * 1000,
|
||||||
gain:
|
gain:
|
||||||
item.rgAlbumGain || item.rgTrackGain
|
item.rgAlbumGain || item.rgTrackGain
|
||||||
|
|
|
@ -181,22 +181,30 @@ const song = z.object({
|
||||||
bitRate: z.number(),
|
bitRate: z.number(),
|
||||||
bookmarkPosition: z.number(),
|
bookmarkPosition: z.number(),
|
||||||
bpm: z.number().optional(),
|
bpm: z.number().optional(),
|
||||||
|
catalogNum: z.string().optional(),
|
||||||
channels: z.number().optional(),
|
channels: z.number().optional(),
|
||||||
comment: z.string().optional(),
|
comment: z.string().optional(),
|
||||||
compilation: z.boolean(),
|
compilation: z.boolean(),
|
||||||
createdAt: z.string(),
|
createdAt: z.string(),
|
||||||
discNumber: z.number(),
|
discNumber: z.number(),
|
||||||
|
discSubtitle: z.string().optional(),
|
||||||
duration: z.number(),
|
duration: z.number(),
|
||||||
|
embedArtPath: z.string().optional(),
|
||||||
|
externalInfoUpdatedAt: z.string().optional(),
|
||||||
|
externalUrl: z.string().optional(),
|
||||||
fullText: z.string(),
|
fullText: z.string(),
|
||||||
genre: z.string(),
|
genre: z.string(),
|
||||||
genres: z.array(genre),
|
genres: z.array(genre),
|
||||||
hasCoverArt: z.boolean(),
|
hasCoverArt: z.boolean(),
|
||||||
id: z.string(),
|
id: z.string(),
|
||||||
|
imageFiles: z.string().optional(),
|
||||||
|
largeImageUrl: z.string().optional(),
|
||||||
lyrics: z.string().optional(),
|
lyrics: z.string().optional(),
|
||||||
mbzAlbumArtistId: z.string().optional(),
|
mbzAlbumArtistId: z.string().optional(),
|
||||||
mbzAlbumId: z.string().optional(),
|
mbzAlbumId: z.string().optional(),
|
||||||
mbzArtistId: z.string().optional(),
|
mbzArtistId: z.string().optional(),
|
||||||
mbzTrackId: z.string().optional(),
|
mbzTrackId: z.string().optional(),
|
||||||
|
mediumImageUrl: z.string().optional(),
|
||||||
orderAlbumArtistName: z.string(),
|
orderAlbumArtistName: z.string(),
|
||||||
orderAlbumName: z.string(),
|
orderAlbumName: z.string(),
|
||||||
orderArtistName: z.string(),
|
orderArtistName: z.string(),
|
||||||
|
@ -210,6 +218,7 @@ const song = z.object({
|
||||||
rgTrackGain: z.number().optional(),
|
rgTrackGain: z.number().optional(),
|
||||||
rgTrackPeak: z.number().optional(),
|
rgTrackPeak: z.number().optional(),
|
||||||
size: z.number(),
|
size: z.number(),
|
||||||
|
smallImageUrl: z.string().optional(),
|
||||||
sortAlbumArtistName: z.string(),
|
sortAlbumArtistName: z.string(),
|
||||||
sortArtistName: z.string(),
|
sortArtistName: z.string(),
|
||||||
starred: z.boolean(),
|
starred: z.boolean(),
|
||||||
|
|
|
@ -67,6 +67,7 @@ const normalizeSong = (
|
||||||
container: item.contentType,
|
container: item.contentType,
|
||||||
createdAt: item.created,
|
createdAt: item.created,
|
||||||
discNumber: item.discNumber || 1,
|
discNumber: item.discNumber || 1,
|
||||||
|
discSubtitle: null,
|
||||||
duration: item.duration ? item.duration * 1000 : 0,
|
duration: item.duration ? item.duration * 1000 : 0,
|
||||||
gain: null,
|
gain: null,
|
||||||
genres: item.genre
|
genres: item.genre
|
||||||
|
|
|
@ -190,6 +190,7 @@ export type Song = {
|
||||||
container: string | null;
|
container: string | null;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
discNumber: number;
|
discNumber: number;
|
||||||
|
discSubtitle: string | null;
|
||||||
duration: number;
|
duration: number;
|
||||||
gain: GainInfo | null;
|
gain: GainInfo | null;
|
||||||
genres: Genre[];
|
genres: Genre[];
|
||||||
|
|
|
@ -88,9 +88,15 @@ export const AlbumDetailContent = ({ tableRef, background }: AlbumDetailContentP
|
||||||
const songsByDiscNumber = detailQuery.data?.songs.filter(
|
const songsByDiscNumber = detailQuery.data?.songs.filter(
|
||||||
(s) => s.discNumber === discNumber,
|
(s) => s.discNumber === discNumber,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const discSubtitle = songsByDiscNumber?.[0]?.discSubtitle;
|
||||||
|
const discName = [`Disc ${discNumber}`.toLocaleUpperCase(), discSubtitle]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(': ');
|
||||||
|
|
||||||
rowData.push({
|
rowData.push({
|
||||||
id: `disc-${discNumber}`,
|
id: `disc-${discNumber}`,
|
||||||
name: `Disc ${discNumber}`.toLocaleUpperCase(),
|
name: discName,
|
||||||
});
|
});
|
||||||
rowData.push(...songsByDiscNumber);
|
rowData.push(...songsByDiscNumber);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue