Fix: Watch Together Raum-Erstellung + Download-Button
- Server/Frontend Protokoll-Mismatch behoben (create_room, join_room, room_created, room_joined, playback_state) - togglePlay sendet jetzt korrekt pause/resume statt toggle_play - Download-Button: SPA-Fallback fuer /downloads/ verhindert, 404 statt Reload - download-Attribut am Link hinzugefuegt Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
73f247ada3
commit
e748fc97e9
6 changed files with 74 additions and 61 deletions
|
|
@ -153,6 +153,14 @@ async function boot(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
// Serve download files (Electron installer etc.)
|
||||
const downloadsDir = path.join(import.meta.dirname ?? __dirname, '..', '..', 'downloads');
|
||||
app.use('/downloads', express.static(downloadsDir));
|
||||
// 404 for missing downloads (prevent SPA fallback)
|
||||
app.get('/downloads/{*splat}', (_req, res) => {
|
||||
res.status(404).json({ error: 'Download not found' });
|
||||
});
|
||||
|
||||
// SPA Fallback (MUST be after plugin routes)
|
||||
app.get('/{*splat}', (_req, res) => {
|
||||
res.sendFile(path.join(import.meta.dirname ?? __dirname, '..', '..', 'web', 'dist', 'index.html'));
|
||||
|
|
|
|||
|
|
@ -75,8 +75,7 @@ function getPlaybackState(room: Room): Record<string, any> {
|
|||
const currentTime = room.currentTime + (room.playing ? (Date.now() - room.lastSyncAt) / 1000 : 0);
|
||||
return {
|
||||
type: 'playback_state',
|
||||
videoUrl: room.currentVideo?.url ?? null,
|
||||
videoTitle: room.currentVideo?.title ?? null,
|
||||
currentVideo: room.currentVideo ? { url: room.currentVideo.url, title: room.currentVideo.title } : null,
|
||||
playing: room.playing,
|
||||
currentTime,
|
||||
updatedAt: Date.now(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue