If two separate groups refer to same songs can be inteference if files being renamed
If two separate groups refer to same songs can be interfence if files being renamed.
group one works out new filernames
group two works out filename based and check for duplicates on existing filenames in group one (because group one files not yet saved)
group one save changes
group two save changes but has to rename because clashes with the new names in group one
This is fairly rare but does happen, the solution would be to single thread Save so group one completes all work before group 2 but this would slow down processing, also note only a problem if user is actually renaming files.
Better would be to just single thread the check for duplicate filenames, rename part but tricky to do not least because cannot pass Session object to new thread for any db changes.
Fixed, split save and rename and check against fileystsem ust before rename.