fix(thumb blob path): separators be wrongly modified

This commit is contained in:
Darren Yu 2025-12-04 16:31:28 +08:00
parent 67c6f937c9
commit ab0a6bf30c
No known key found for this signature in database
GPG Key ID: 2D69AA5646405984

View File

@ -164,7 +164,11 @@ func ReplaceMagicVar(rawString string, fsSeparator string, pathAvailable bool, b
return match
case "{blob_path}":
if blobAvailable {
return filepath.Dir(completeBlobPath) + fsSeparator
lastSlash := strings.LastIndexAny(completeBlobPath, "/\\")
if lastSlash >= 0 {
return completeBlobPath[:lastSlash] + fsSeparator
}
return fsSeparator
}
return match
default: