fix(api): skip physical books in metadata manager to prevent NPE (#234)
Physical books have no associated file, so calling getPrimaryBookFile() returns null. The metadata manager was crashing with NullPointerException when merging/consolidating metadata (authors, genres, etc.) that included physical books. This fix skips physical books in writeMetadataToFile() since there is no file to write metadata to. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
2474cdd4ae
commit
ebdcd0bc19
+3
@@ -59,6 +59,9 @@ public class MetadataManagementService {
|
||||
for (BookMetadataEntity metadata : metadataList) {
|
||||
if (metadata.getBook() != null) {
|
||||
BookEntity book = metadata.getBook();
|
||||
if (Boolean.TRUE.equals(book.getIsPhysical())) {
|
||||
continue;
|
||||
}
|
||||
boolean bookModified = false;
|
||||
|
||||
var primaryFile = book.getPrimaryBookFile();
|
||||
|
||||
Reference in New Issue
Block a user