fix(shelf): fix public shelf book visibility (#1735)

This commit is contained in:
Alex
2026-06-13 17:52:14 +01:00
committed by GitHub
parent 0625095e1a
commit 48eefc03c2
2 changed files with 37 additions and 3 deletions
@@ -12,6 +12,7 @@ import org.booklore.repository.BookRepository;
import org.booklore.repository.UserContentRestrictionRepository;
import org.booklore.security.policy.ContentRestrictionSpecification;
import org.booklore.service.restriction.ContentRestrictionService;
import org.booklore.util.BookUtils;
import org.hibernate.Hibernate;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
@@ -154,9 +155,7 @@ public class BookQueryService {
}
if (dto.getShelves() != null && userId != null) {
dto.setShelves(dto.getShelves().stream()
.filter(shelf -> userId.equals(shelf.getUserId()))
.collect(Collectors.toSet()));
dto.setShelves(BookUtils.filterShelvesByUserId(dto.getShelves(), userId));
}
if (stripForListView) {