feat(viewer): add context-aware series collapse functionality (#2073)
- Introduced support for context-specific series collapse preferences for libraries, shelves, and magic shelves. - Improved backward compatibility with legacy preference structures. - Added JSON aliasing for `seriesCollapse` to maintain API compatibility. - Extended entity selection in view preferences to include magic shelves. - Enhanced error handling in app settings service to filter null values. - Optimized series collapse preference management, ensuring local and global overrides persist accurately. Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package com.adityachandel.booklore.model.dto;
|
||||
|
||||
import com.adityachandel.booklore.model.dto.settings.SidebarSortOption;
|
||||
import com.adityachandel.booklore.model.enums.*;
|
||||
import com.fasterxml.jackson.annotation.JsonAlias;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -93,6 +94,7 @@ public class BookLoreUser {
|
||||
private String sortDir;
|
||||
private String view;
|
||||
private Float coverSize;
|
||||
@JsonAlias("seriesCollapse")
|
||||
private Boolean seriesCollapsed;
|
||||
}
|
||||
|
||||
@@ -114,7 +116,8 @@ public class BookLoreUser {
|
||||
private String sortKey;
|
||||
private String sortDir;
|
||||
private String view;
|
||||
private Boolean seriesCollapse;
|
||||
@JsonAlias("seriesCollapse")
|
||||
private Boolean seriesCollapsed;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
+3
-1
@@ -95,7 +95,9 @@ public class AppSettingService {
|
||||
}
|
||||
|
||||
private Map<String, String> getSettingsMap() {
|
||||
return settingPersistenceHelper.appSettingsRepository.findAll().stream().collect(Collectors.toMap(AppSettingEntity::getName, AppSettingEntity::getVal));
|
||||
return settingPersistenceHelper.appSettingsRepository.findAll().stream()
|
||||
.filter(entity -> entity.getName() != null && entity.getVal() != null)
|
||||
.collect(Collectors.toMap(AppSettingEntity::getName, AppSettingEntity::getVal));
|
||||
}
|
||||
|
||||
private PublicAppSetting buildPublicSetting() {
|
||||
|
||||
Reference in New Issue
Block a user