mirror of
https://github.com/janishutz/MusicPlayer.git
synced 2026-09-10 14:25:24 +02:00
feat: basic rendering of queue on share screen
This commit is contained in:
@@ -152,9 +152,9 @@ const sendUpdate = ( room: string, kind: 'state' | 'playlist' ) => {
|
||||
|
||||
if ( !roomObject ) return false;
|
||||
|
||||
roomObject.clients.forEach( client => client.response.write( `data: ${ JSON.stringify( {
|
||||
roomObject.clients.forEach( client => client.response.write( `data: json:${ JSON.stringify( {
|
||||
'type': kind,
|
||||
'data': JSON.stringify( roomObject[kind] )
|
||||
'data': roomObject[kind]
|
||||
} ) }\n\n` ) );
|
||||
|
||||
return true;
|
||||
|
||||
@@ -32,7 +32,7 @@ const routes = ( app: express.Application, foss: boolean, config: Config ) => {
|
||||
response.send(
|
||||
JSON.stringify( {
|
||||
'state': room?.state,
|
||||
'playlist': lastRequest < room!.playlist!.lastUpdate ? room!.playlist : undefined
|
||||
'playlist': ( lastRequest < room!.playlist!.lastUpdate || isNaN( lastRequest ) ) ? room!.playlist.playlist : undefined
|
||||
} )
|
||||
);
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user