fix: normalize organize category roots

This commit is contained in:
ShukeBta
2026-06-25 08:54:42 +08:00
parent 89af1dad32
commit 16c3ed239a
10 changed files with 213 additions and 15 deletions
+8
View File
@@ -160,6 +160,14 @@ func redirectOrganizeStagingRoot(root string) string {
return cleaned
}
func normalizeOrganizeDestinationRoot(root string) string {
cleaned := redirectOrganizeStagingRoot(root)
if collectionRoot := organizeMediaCollectionRoot(cleaned); collectionRoot != "" {
return collectionRoot
}
return cleaned
}
func pathAlreadyEndsWith(path, suffix string) bool {
base := strings.TrimSpace(filepath.Base(filepath.Clean(path)))
return strings.EqualFold(base, suffix)