fix(library-processing): re-fetch library entity after clearing entity manager during rescan (#2507)
* fix(library-processing): re-fetch library entity after clearing entity manager during rescan Ensure the latest library entity state is retrieved after clearing the entity manager in rescanLibrary. Add test to verify fresh entity is used for subsequent processing. Signed-off-by: Balázs Szücs <bszucs1209@gmail.com> * test(library-processing): update rescan test to verify grouping service usage and remove obsolete assertions Signed-off-by: Balázs Szücs <bszucs1209@gmail.com> --------- Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
+3
@@ -98,6 +98,9 @@ public class LibraryProcessingService {
|
||||
}
|
||||
bookRestorationService.restoreDeletedBooks(libraryFiles);
|
||||
entityManager.clear();
|
||||
// Re-fetch library entity to get fresh state after entity manager was cleared
|
||||
libraryEntity = libraryRepository.findById(context.getLibraryId())
|
||||
.orElseThrow(() -> ApiError.LIBRARY_NOT_FOUND.createException(context.getLibraryId()));
|
||||
|
||||
List<LibraryFile> newFiles = detectNewBookPaths(libraryFiles, libraryEntity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user