Add toggle to watch folders
This commit is contained in:
+1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user