Skip to content

Commit 9b42785

Browse files
authored
fix live photo detection with capital letter (#117)
Signed-off-by: Ricky Li <i@liqi.link>
1 parent 834d730 commit 9b42785

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/builder/src/storage/providers/github-provider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ export class GitHubStorageProvider implements StorageProvider {
242242
if (!obj.key) continue
243243

244244
const dir = path.dirname(obj.key)
245-
const basename = path.basename(obj.key, path.extname(obj.key))
245+
// use path.parse to safely get the filename without extension (case-insensitive extension handling)
246+
const basename = path.parse(obj.key).name
246247
const groupKey = `${dir}/${basename}`
247248

248249
if (!fileGroups.has(groupKey)) {

packages/builder/src/storage/providers/local-provider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ export class LocalStorageProvider implements StorageProvider {
236236

237237
// 如果是图片文件,查找对应的视频文件
238238
if (SUPPORTED_FORMATS.has(ext)) {
239-
const baseName = path.basename(obj.key, ext)
239+
// use path.parse to get the name without extension to avoid issues
240+
// when the file extension has different casing (e.g. .HEIC)
241+
const baseName = path.parse(obj.key).name
240242
const dirName = path.dirname(obj.key)
241243

242244
// 查找对应的 .mov 文件

packages/builder/src/storage/providers/s3-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export class S3StorageProvider implements StorageProvider {
229229
if (!obj.key) continue
230230

231231
const dir = path.dirname(obj.key)
232-
const basename = path.basename(obj.key, path.extname(obj.key))
232+
const basename = path.parse(obj.key).name
233233
const groupKey = `${dir}/${basename}`
234234

235235
if (!fileGroups.has(groupKey)) {

0 commit comments

Comments
 (0)