mirror of
https://github.com/Afilmory/afilmory
synced 2026-02-01 14:44:48 +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()
|
||||
if (SUPPORTED_FORMATS.has(ext)) {
|
||||
imageFile = file
|
||||
} else if (ext === '.mov') {
|
||||
} else if (ext === '.mov' || ext === '.mp4') {
|
||||
videoFile = file
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,8 +390,8 @@ export class GitHubStorageProvider implements StorageProvider {
|
||||
if (SUPPORTED_FORMATS.has(ext)) {
|
||||
imageFile = file
|
||||
}
|
||||
// 检查是否为 .mov 视频文件
|
||||
else if (ext === '.mov') {
|
||||
// 检查是否为 .mov 或 .mp4 视频文件
|
||||
else if (ext === '.mov' || ext === '.mp4') {
|
||||
videoFile = file
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,12 +353,16 @@ export class LocalStorageProvider implements StorageProvider {
|
||||
const baseName = path.parse(obj.key).name
|
||||
const dirName = path.dirname(obj.key)
|
||||
|
||||
// 查找对应的 .mov 文件
|
||||
const videoKey = path.join(dirName, `${baseName}.mov`).replaceAll('\\', '/')
|
||||
const videoObj = fileMap.get(videoKey.toLowerCase())
|
||||
// 查找对应的 .mov 或 .mp4 文件
|
||||
const videoExtensions = ['.mov', '.mp4']
|
||||
for (const videoExt of videoExtensions) {
|
||||
const videoKey = path.join(dirName, `${baseName}${videoExt}`).replaceAll('\\', '/')
|
||||
const videoObj = fileMap.get(videoKey.toLowerCase())
|
||||
|
||||
if (videoObj) {
|
||||
livePhotos.set(obj.key, videoObj)
|
||||
if (videoObj) {
|
||||
livePhotos.set(obj.key, videoObj)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -287,8 +287,8 @@ export class S3StorageProvider implements StorageProvider {
|
||||
if (SUPPORTED_FORMATS.has(ext)) {
|
||||
imageFile = file
|
||||
}
|
||||
// 检查是否为 .mov 视频文件
|
||||
else if (ext === '.mov') {
|
||||
// 检查是否为 .mov 或 .mp4 视频文件
|
||||
else if (ext === '.mov' || ext === '.mp4') {
|
||||
videoFile = file
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user