mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
refactor(lib,playback,whatsNew): home waveform→lib, timeline utils→playback, releaseNotes+changelog→whatsNew
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import type { QueueItemRef } from '@/lib/media/trackTypes';
|
||||
import type { PlaySessionRecentTrack } from '@/lib/api/library';
|
||||
import type { TimelinePlayedRef } from '@/features/playback/store/timelineSessionHistory';
|
||||
import type { Track } from '@/lib/media/trackTypes';
|
||||
|
||||
export function timelineHistoryToQueueRefs(
|
||||
history: TimelinePlayedRef[],
|
||||
): QueueItemRef[] {
|
||||
return history.map(row => ({ serverId: row.serverId, trackId: row.trackId }));
|
||||
}
|
||||
|
||||
export function bootstrapTrackFromPlaySession(row: PlaySessionRecentTrack): Track {
|
||||
const albumId = row.albumId ?? '';
|
||||
const coverArt = row.coverArtId ?? albumId;
|
||||
return {
|
||||
id: row.trackId,
|
||||
title: row.title,
|
||||
artist: row.artist ?? '',
|
||||
album: row.album ?? '',
|
||||
albumId,
|
||||
coverArt,
|
||||
duration: 0,
|
||||
serverId: row.serverId,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user