Add toggle to watch folders

This commit is contained in:
aditya.chandel
2025-02-07 02:39:49 -07:00
parent 931718bdae
commit 581f6a32a5
5 changed files with 19 additions and 6 deletions
@@ -19,4 +19,5 @@ public class CreateLibraryRequest {
private String icon;
@NotEmpty
private List<LibraryPath> paths;
private boolean watch;
}
@@ -50,6 +50,7 @@ public class LibraryService {
LibraryEntity library = libraryRepository.findById(libraryId).orElseThrow(() -> ApiError.LIBRARY_NOT_FOUND.createException(libraryId));
library.setName(request.getName());
library.setIcon(request.getIcon());
library.setWatch(request.isWatch());
Set<String> currentPaths = library.getLibraryPaths().stream().map(LibraryPathEntity::getPath).collect(Collectors.toSet());
Set<String> updatedPaths = request.getPaths().stream().map(LibraryPath::getPath).collect(Collectors.toSet());
@@ -110,6 +111,7 @@ public class LibraryService {
.collect(Collectors.toList())
)
.icon(request.getIcon())
.watch(request.isWatch())
.build();
libraryEntity = libraryRepository.save(libraryEntity);