mirror of
https://github.com/Afilmory/afilmory
synced 2026-04-25 07:15:36 +00:00
feat(builder): add mp4 extension support for Live Photos in storage providers (#218)
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@@ -536,7 +536,7 @@ export class B2StorageProvider implements StorageProvider {
|
|||||||
const ext = path.extname(file.key).toLowerCase()
|
const ext = path.extname(file.key).toLowerCase()
|
||||||
if (SUPPORTED_FORMATS.has(ext)) {
|
if (SUPPORTED_FORMATS.has(ext)) {
|
||||||
imageFile = file
|
imageFile = file
|
||||||
} else if (ext === '.mov') {
|
} else if (ext === '.mov' || ext === '.mp4') {
|
||||||
videoFile = file
|
videoFile = file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -390,8 +390,8 @@ export class GitHubStorageProvider implements StorageProvider {
|
|||||||
if (SUPPORTED_FORMATS.has(ext)) {
|
if (SUPPORTED_FORMATS.has(ext)) {
|
||||||
imageFile = file
|
imageFile = file
|
||||||
}
|
}
|
||||||
// 检查是否为 .mov 视频文件
|
// 检查是否为 .mov 或 .mp4 视频文件
|
||||||
else if (ext === '.mov') {
|
else if (ext === '.mov' || ext === '.mp4') {
|
||||||
videoFile = file
|
videoFile = file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,12 +353,16 @@ export class LocalStorageProvider implements StorageProvider {
|
|||||||
const baseName = path.parse(obj.key).name
|
const baseName = path.parse(obj.key).name
|
||||||
const dirName = path.dirname(obj.key)
|
const dirName = path.dirname(obj.key)
|
||||||
|
|
||||||
// 查找对应的 .mov 文件
|
// 查找对应的 .mov 或 .mp4 文件
|
||||||
const videoKey = path.join(dirName, `${baseName}.mov`).replaceAll('\\', '/')
|
const videoExtensions = ['.mov', '.mp4']
|
||||||
|
for (const videoExt of videoExtensions) {
|
||||||
|
const videoKey = path.join(dirName, `${baseName}${videoExt}`).replaceAll('\\', '/')
|
||||||
const videoObj = fileMap.get(videoKey.toLowerCase())
|
const videoObj = fileMap.get(videoKey.toLowerCase())
|
||||||
|
|
||||||
if (videoObj) {
|
if (videoObj) {
|
||||||
livePhotos.set(obj.key, videoObj)
|
livePhotos.set(obj.key, videoObj)
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -287,8 +287,8 @@ export class S3StorageProvider implements StorageProvider {
|
|||||||
if (SUPPORTED_FORMATS.has(ext)) {
|
if (SUPPORTED_FORMATS.has(ext)) {
|
||||||
imageFile = file
|
imageFile = file
|
||||||
}
|
}
|
||||||
// 检查是否为 .mov 视频文件
|
// 检查是否为 .mov 或 .mp4 视频文件
|
||||||
else if (ext === '.mov') {
|
else if (ext === '.mov' || ext === '.mp4') {
|
||||||
videoFile = file
|
videoFile = file
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user