add bit depth, sample rate

This commit is contained in:
Kendall Garner 2025-07-13 07:12:13 -07:00
parent 8b141d652c
commit 4b4df28641
No known key found for this signature in database
GPG key ID: 9355F387FE765C94
8 changed files with 65 additions and 16 deletions

View file

@ -135,9 +135,10 @@ const normalizeSong = (
albumId: item.albumId?.toString() || '',
artistName: item.artist || '',
artists: getArtistList(item.artists, item.artistId, item.artist),
bitDepth: item.bitDepth || null,
bitRate: item.bitRate || 0,
bpm: item.bpm || null,
channels: null,
channels: item.channelCount || null,
comment: null,
compilation: null,
container: item.contentType,
@ -172,6 +173,7 @@ const normalizeSong = (
playCount: item?.playCount || 0,
releaseDate: null,
releaseYear: item.year ? String(item.year) : null,
sampleRate: item.samplingRate || null,
serverId: server?.id || 'unknown',
serverType: ServerType.SUBSONIC,
size: item.size,

View file

@ -85,8 +85,10 @@ const song = z.object({
artistId: id.optional(),
artists: z.array(simpleArtist),
averageRating: z.number().optional(),
bitDepth: z.number().optional(),
bitRate: z.number().optional(),
bpm: z.number().optional(),
channelCount: z.number().optional(),
contentType: z.string(),
contributors: z.array(contributor).optional(),
coverArt: z.string().optional(),
@ -103,6 +105,7 @@ const song = z.object({
path: z.string(),
playCount: z.number().optional(),
replayGain: songGain.optional(),
samplingRate: z.number().optional(),
size: z.number(),
starred: z.boolean().optional(),
suffix: z.string(),