refactor(lib,playback,whatsNew): home waveform→lib, timeline utils→playback, releaseNotes+changelog→whatsNew

This commit is contained in:
Psychotoxical
2026-06-30 20:26:34 +02:00
parent 695462ed87
commit aea8b7750b
37 changed files with 52 additions and 52 deletions
@@ -0,0 +1,32 @@
import { describe, it, expect } from 'vitest';
import { bootstrapTrackFromPlaySession, timelineHistoryToQueueRefs } from '@/features/playback/utils/timelineHistoryRefs';
describe('timelineHistoryRefs', () => {
it('maps history rows to queue refs', () => {
expect(timelineHistoryToQueueRefs([
{ serverId: 's1', trackId: 't1', playedAtMs: 1 },
{ serverId: 's2', trackId: 't2', playedAtMs: 2 },
])).toEqual([
{ serverId: 's1', trackId: 't1' },
{ serverId: 's2', trackId: 't2' },
]);
});
it('seeds bootstrap tracks with album cover metadata', () => {
const track = bootstrapTrackFromPlaySession({
serverId: 's2',
trackId: 't1',
title: 'Song',
artist: 'Artist',
album: 'Album',
albumId: 'al-1',
coverArtId: 'cover-1',
startedAtMs: 1,
listenedSec: 30,
completion: 'full',
});
expect(track.albumId).toBe('al-1');
expect(track.coverArt).toBe('cover-1');
expect(track.serverId).toBe('s2');
});
});