fix live photo detection with capital letter (#117)

Signed-off-by: Ricky Li <i@liqi.link>
This commit is contained in:
Ricky Li
2025-10-20 17:28:13 +08:00
committed by GitHub
parent 834d730797
commit 9b4278565f
3 changed files with 6 additions and 3 deletions

View File

@@ -242,7 +242,8 @@ export class GitHubStorageProvider implements StorageProvider {
if (!obj.key) continue
const dir = path.dirname(obj.key)
const basename = path.basename(obj.key, path.extname(obj.key))
// use path.parse to safely get the filename without extension (case-insensitive extension handling)
const basename = path.parse(obj.key).name
const groupKey = `${dir}/${basename}`
if (!fileGroups.has(groupKey)) {

View File

@@ -236,7 +236,9 @@ export class LocalStorageProvider implements StorageProvider {
// 如果是图片文件,查找对应的视频文件
if (SUPPORTED_FORMATS.has(ext)) {
const baseName = path.basename(obj.key, ext)
// use path.parse to get the name without extension to avoid issues
// when the file extension has different casing (e.g. .HEIC)
const baseName = path.parse(obj.key).name
const dirName = path.dirname(obj.key)
// 查找对应的 .mov 文件

View File

@@ -229,7 +229,7 @@ export class S3StorageProvider implements StorageProvider {
if (!obj.key) continue
const dir = path.dirname(obj.key)
const basename = path.basename(obj.key, path.extname(obj.key))
const basename = path.parse(obj.key).name
const groupKey = `${dir}/${basename}`
if (!fileGroups.has(groupKey)) {