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
@@ -210,7 +210,9 @@ func (o *OrganizerService) resolveOrganizeSourceLayoutRoot(ctx context.Context,
layoutRoot = categoryRoot(layoutRoot, sanitizeFilename(layout.Category))
}
if !matchedLibrary && !req.DryRun {
o.ensureOrganizeLibraryForRoot(ctx, layoutRoot, layout.MediaType, layout.Category)
if targetLibrary, ok := o.ensureOrganizeLibraryForRoot(ctx, layoutRoot, layout.MediaType, layout.Category); ok {
targetLibraryID = targetLibrary.ID
}
}
return layoutRoot, targetLibraryID
}