mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 02:46:52 +00:00
refactor(storage): use original filenames and fix download UX
- Store uploaded files as files/{ulid}/{original-name} instead of files/{ulid}/raw
- Store transcoded videos as {stem}-{resolution}.mp4 (e.g. foo-720p.mp4)
- Store transcoded images as {stem}-{width}p.webp (e.g. foo-1920p.webp)
- Add download?: boolean param to presign - only sets Content-Disposition: attachment when true
- Local storage handler only sets Content-Disposition when ?download=1 query param is present
- Add POST /api/files/download-url endpoint for key-based single file downloads
- Uses ResourceType.Asset for permission check
- Validates key belongs to the asset's storage directory
- Fix existing download-links API to pass download: true to presign
- Fix breadcrumb navbar download: video shows resolution submenu, others download directly
- Fix video player download: calls download-url API, shows correct file type label
- Remove filename query param hack from presign URLs
- Add sanitizeFilename() and stemFromKey() utility helpers
- Add key field to VideoTranscode DTO interface
This commit is contained in:
@@ -148,6 +148,15 @@ function FileViewPage() {
|
||||
},
|
||||
isRootFolder: false,
|
||||
fileId,
|
||||
downloadInfo: {
|
||||
originalKey: fileData.media?.original?.key,
|
||||
videoTranscodes: fileData.media?.videoTranscodes?.map((t) => ({
|
||||
key: t.key,
|
||||
width: t.width,
|
||||
height: t.height,
|
||||
isRaw: t.isRaw,
|
||||
})),
|
||||
},
|
||||
versions: versionsDataList,
|
||||
onFolderClick: (id: string) => {
|
||||
navigate({
|
||||
|
||||
Reference in New Issue
Block a user