feat: name downloaded file after the video title and add a back-to-home link
The download endpoint served files under their internal uuid-based storage name; it now builds the Content-Disposition filename from the probed video title (persisted on submit) with the original extension, falling back to the old behavior when no title is available. The status page also gets an always-visible link back to the homepage. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -88,4 +88,21 @@ describe('POST /api/downloads', () => {
|
||||
data: expect.objectContaining({ clipStart: 10, clipEnd: 30, audioQuality: '192' }),
|
||||
})
|
||||
})
|
||||
|
||||
it('stores the video title when provided', async () => {
|
||||
await POST(req({
|
||||
url: 'https://y.com', format: 'mp4', quality: 'best', subtitles: false,
|
||||
title: 'My Video',
|
||||
}))
|
||||
expect(mockCreate).toHaveBeenCalledWith({
|
||||
data: expect.objectContaining({ title: 'My Video' }),
|
||||
})
|
||||
})
|
||||
|
||||
it('stores a null title when not provided', async () => {
|
||||
await POST(req({ url: 'https://y.com', format: 'mp4', quality: 'best', subtitles: false }))
|
||||
expect(mockCreate).toHaveBeenCalledWith({
|
||||
data: expect.objectContaining({ title: null }),
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user