Merge branch 'backend-refactor-rev' into audit-merge-three
Adapt the refactored web player to the new backend API (id path params, bulk track adds, flat list items, mix kind) and port AddAlbumToPlayList to the backend conventions.
This commit is contained in:
@@ -46,11 +46,21 @@ export function toMixTrack(item: MixItemDto): Track {
|
||||
};
|
||||
}
|
||||
|
||||
const MIX_TEXTS: Record<MixDto['kind'], { title: string; subtitle: string }> = {
|
||||
Discovery: {
|
||||
title: 'Descubrimiento',
|
||||
subtitle: 'Canciones de tu biblioteca que todavía no has escuchado.'
|
||||
},
|
||||
Daily: {
|
||||
title: 'Tu mezcla diaria',
|
||||
subtitle: 'Lo que más escuchas, con alguna sorpresa de tu biblioteca.'
|
||||
}
|
||||
};
|
||||
|
||||
export function toMix(dto: MixDto): Mix {
|
||||
return {
|
||||
id: dto.id,
|
||||
title: dto.title,
|
||||
subtitle: dto.subtitle,
|
||||
...MIX_TEXTS[dto.kind],
|
||||
tracks: dto.items.map(toMixTrack)
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user