More signals
This commit is contained in:
-4
@@ -43,16 +43,12 @@ public class LibraryController {
|
||||
return libraryService.parseLibraryBooks(libraryId, force);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@DeleteMapping("/{libraryId}")
|
||||
public ResponseEntity<?> deleteLibrary(@PathVariable long libraryId) {
|
||||
libraryService.deleteLibrary(libraryId);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/{libraryId}/book/{bookId}/withNeighbors")
|
||||
public ResponseEntity<BookWithNeighborsDTO> getBookWithNeighbours(@PathVariable long libraryId, @PathVariable long bookId) {
|
||||
return ResponseEntity.ok(booksService.getBookWithNeighbours(libraryId, bookId));
|
||||
|
||||
@@ -21,6 +21,8 @@ public interface BookRepository extends JpaRepository<Book, Long>, JpaSpecificat
|
||||
|
||||
Optional<Book> findBookByIdAndLibraryId(long id, long libraryId);
|
||||
|
||||
Optional<Book> findBookByFileNameAndLibraryId(String fileName, long libraryId);
|
||||
|
||||
@Query("SELECT b FROM Book b JOIN b.metadata bm WHERE LOWER(bm.title) LIKE LOWER(CONCAT('%', :title, '%'))")
|
||||
List<Book> findByTitleContainingIgnoreCase(@Param("title") String title);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class PdfFileProcessor implements FileProcessor {
|
||||
File bookFile = new File(libraryFile.getFilePath());
|
||||
String fileName = bookFile.getName();
|
||||
if (!forceProcess) {
|
||||
Optional<Book> bookOptional = bookRepository.findByFileName(fileName);
|
||||
Optional<Book> bookOptional = bookRepository.findBookByFileNameAndLibraryId(fileName, libraryFile.getLibrary().getId());
|
||||
if (bookOptional.isPresent()) {
|
||||
return FileProcessResult.builder()
|
||||
.libraryFile(libraryFile)
|
||||
|
||||
Reference in New Issue
Block a user