mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
remove more warnings
This commit is contained in:
@@ -89,7 +89,7 @@ public class FeedEntryStatusDAO extends GenericDAO<FeedEntryStatus> {
|
|||||||
query.where(STATUS.entryInserted.gt(newerThan));
|
query.where(STATUS.entryInserted.gt(newerThan));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (order == ReadingOrder.asc) {
|
if (order == ReadingOrder.ASC) {
|
||||||
query.orderBy(STATUS.entryPublished.asc(), STATUS.id.asc());
|
query.orderBy(STATUS.entryPublished.asc(), STATUS.id.asc());
|
||||||
} else {
|
} else {
|
||||||
query.orderBy(STATUS.entryPublished.desc(), STATUS.id.desc());
|
query.orderBy(STATUS.entryPublished.desc(), STATUS.id.desc());
|
||||||
@@ -162,7 +162,7 @@ public class FeedEntryStatusDAO extends GenericDAO<FeedEntryStatus> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (order != null) {
|
if (order != null) {
|
||||||
if (order == ReadingOrder.asc) {
|
if (order == ReadingOrder.ASC) {
|
||||||
query.orderBy(ENTRY.published.asc(), ENTRY.id.asc());
|
query.orderBy(ENTRY.published.asc(), ENTRY.id.asc());
|
||||||
} else {
|
} else {
|
||||||
query.orderBy(ENTRY.published.desc(), ENTRY.id.desc());
|
query.orderBy(ENTRY.published.desc(), ENTRY.id.desc());
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package com.commafeed.backend.feed;
|
package com.commafeed.backend.feed;
|
||||||
|
|
||||||
import java.net.MalformedURLException;
|
import java.net.URI;
|
||||||
import java.net.URL;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@@ -130,12 +128,7 @@ public class FeedUtils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
return URI.create(baseUrl).resolve(relativeUrl).toString();
|
||||||
return new URL(new URL(baseUrl), relativeUrl).toString();
|
|
||||||
} catch (MalformedURLException e) {
|
|
||||||
log.debug("could not parse url : {}", e.getMessage(), e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFaviconUrl(FeedSubscription subscription) {
|
public static String getFaviconUrl(FeedSubscription subscription) {
|
||||||
@@ -195,26 +188,24 @@ public class FeedUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void removeUnwantedFromSearch(List<Entry> entries, List<FeedEntryKeyword> keywords) {
|
public static void removeUnwantedFromSearch(List<Entry> entries, List<FeedEntryKeyword> keywords) {
|
||||||
Iterator<Entry> it = entries.iterator();
|
if (keywords.isEmpty()) {
|
||||||
while (it.hasNext()) {
|
return;
|
||||||
Entry entry = it.next();
|
}
|
||||||
boolean keep = true;
|
|
||||||
|
entries.removeIf(e -> {
|
||||||
|
String title = e.getTitle() == null ? null : Jsoup.parse(e.getTitle()).text();
|
||||||
|
String content = e.getContent() == null ? null : Jsoup.parse(e.getContent()).text();
|
||||||
for (FeedEntryKeyword keyword : keywords) {
|
for (FeedEntryKeyword keyword : keywords) {
|
||||||
String title = entry.getTitle() == null ? null : Jsoup.parse(entry.getTitle()).text();
|
|
||||||
String content = entry.getContent() == null ? null : Jsoup.parse(entry.getContent()).text();
|
|
||||||
boolean condition = !StringUtils.containsIgnoreCase(content, keyword.getKeyword())
|
boolean condition = !StringUtils.containsIgnoreCase(content, keyword.getKeyword())
|
||||||
&& !StringUtils.containsIgnoreCase(title, keyword.getKeyword());
|
&& !StringUtils.containsIgnoreCase(title, keyword.getKeyword());
|
||||||
if (keyword.getMode() == Mode.EXCLUDE) {
|
if (keyword.getMode() == Mode.EXCLUDE) {
|
||||||
condition = !condition;
|
condition = !condition;
|
||||||
}
|
}
|
||||||
if (condition) {
|
if (condition) {
|
||||||
keep = false;
|
return true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!keep) {
|
return false;
|
||||||
it.remove();
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
|
|||||||
import org.hibernate.annotations.JdbcTypeCode;
|
import org.hibernate.annotations.JdbcTypeCode;
|
||||||
|
|
||||||
import com.commafeed.backend.feed.FeedUtils;
|
import com.commafeed.backend.feed.FeedUtils;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -27,7 +28,14 @@ import lombok.Setter;
|
|||||||
public class FeedEntryContent extends AbstractModel {
|
public class FeedEntryContent extends AbstractModel {
|
||||||
|
|
||||||
public enum Direction {
|
public enum Direction {
|
||||||
ltr, rtl, unknown
|
@JsonProperty("ltr")
|
||||||
|
LTR,
|
||||||
|
|
||||||
|
@JsonProperty("rtl")
|
||||||
|
RTL,
|
||||||
|
|
||||||
|
@JsonProperty("unknown")
|
||||||
|
UNKNOWN
|
||||||
}
|
}
|
||||||
|
|
||||||
@Column(length = 2048)
|
@Column(length = 2048)
|
||||||
@@ -69,7 +77,7 @@ public class FeedEntryContent extends AbstractModel {
|
|||||||
|
|
||||||
@Column
|
@Column
|
||||||
@Enumerated(EnumType.STRING)
|
@Enumerated(EnumType.STRING)
|
||||||
private Direction direction = Direction.unknown;
|
private Direction direction = Direction.UNKNOWN;
|
||||||
|
|
||||||
@OneToMany(mappedBy = "content")
|
@OneToMany(mappedBy = "content")
|
||||||
private Set<FeedEntry> entries;
|
private Set<FeedEntry> entries;
|
||||||
@@ -93,9 +101,9 @@ public class FeedEntryContent extends AbstractModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isRTL() {
|
public boolean isRTL() {
|
||||||
if (direction == Direction.rtl) {
|
if (direction == Direction.RTL) {
|
||||||
return true;
|
return true;
|
||||||
} else if (direction == Direction.ltr) {
|
} else if (direction == Direction.LTR) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
// detect on the fly for content that was inserted before the direction field was added
|
// detect on the fly for content that was inserted before the direction field was added
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import jakarta.persistence.Table;
|
|||||||
|
|
||||||
import org.hibernate.annotations.JdbcTypeCode;
|
import org.hibernate.annotations.JdbcTypeCode;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@@ -25,23 +27,54 @@ import lombok.Setter;
|
|||||||
public class UserSettings extends AbstractModel {
|
public class UserSettings extends AbstractModel {
|
||||||
|
|
||||||
public enum ReadingMode {
|
public enum ReadingMode {
|
||||||
all, unread
|
@JsonProperty("all")
|
||||||
|
ALL,
|
||||||
|
|
||||||
|
@JsonProperty("unread")
|
||||||
|
UNREAD;
|
||||||
|
|
||||||
|
// method called for query parameters
|
||||||
|
public static ReadingMode fromString(final String s) {
|
||||||
|
return ReadingMode.valueOf(s.toUpperCase());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ReadingOrder {
|
public enum ReadingOrder {
|
||||||
asc, desc
|
@JsonProperty("asc")
|
||||||
}
|
ASC,
|
||||||
|
|
||||||
public enum ViewMode {
|
@JsonProperty("desc")
|
||||||
title, cozy, detailed, expanded
|
DESC;
|
||||||
|
|
||||||
|
// method called for query parameters
|
||||||
|
public static ReadingOrder fromString(final String s) {
|
||||||
|
return ReadingOrder.valueOf(s.toUpperCase());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ScrollMode {
|
public enum ScrollMode {
|
||||||
always, never, if_needed
|
@JsonProperty("always")
|
||||||
|
ALWAYS,
|
||||||
|
|
||||||
|
@JsonProperty("never")
|
||||||
|
NEVER,
|
||||||
|
|
||||||
|
@JsonProperty("if_needed")
|
||||||
|
IF_NEEDED
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum IconDisplayMode {
|
public enum IconDisplayMode {
|
||||||
always, never, on_desktop, on_mobile
|
@JsonProperty("always")
|
||||||
|
ALWAYS,
|
||||||
|
|
||||||
|
@JsonProperty("never")
|
||||||
|
NEVER,
|
||||||
|
|
||||||
|
@JsonProperty("on_desktop")
|
||||||
|
ON_DESKTOP,
|
||||||
|
|
||||||
|
@JsonProperty("on_mobile")
|
||||||
|
ON_MOBILE
|
||||||
}
|
}
|
||||||
|
|
||||||
@OneToOne(fetch = FetchType.LAZY)
|
@OneToOne(fetch = FetchType.LAZY)
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class FeedEntryContentService {
|
|||||||
entryContent.setAuthor(FeedUtils.truncate(cleaningService.clean(content.author(), baseUrl, true), 128));
|
entryContent.setAuthor(FeedUtils.truncate(cleaningService.clean(content.author(), baseUrl, true), 128));
|
||||||
entryContent.setCategories(FeedUtils.truncate(content.categories(), 4096));
|
entryContent.setCategories(FeedUtils.truncate(content.categories(), 4096));
|
||||||
entryContent.setDirection(
|
entryContent.setDirection(
|
||||||
FeedUtils.isRTL(content.title(), content.content()) ? FeedEntryContent.Direction.rtl : FeedEntryContent.Direction.ltr);
|
FeedUtils.isRTL(content.title(), content.content()) ? FeedEntryContent.Direction.RTL : FeedEntryContent.Direction.LTR);
|
||||||
|
|
||||||
Enclosure enclosure = content.enclosure();
|
Enclosure enclosure = content.enclosure();
|
||||||
if (enclosure != null) {
|
if (enclosure != null) {
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ package com.commafeed.frontend.model;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.commafeed.backend.model.UserSettings.IconDisplayMode;
|
||||||
|
import com.commafeed.backend.model.UserSettings.ReadingMode;
|
||||||
|
import com.commafeed.backend.model.UserSettings.ReadingOrder;
|
||||||
|
import com.commafeed.backend.model.UserSettings.ScrollMode;
|
||||||
|
|
||||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
|
||||||
@@ -20,13 +25,13 @@ public class Settings implements Serializable {
|
|||||||
description = "user reads all entries or unread entries only",
|
description = "user reads all entries or unread entries only",
|
||||||
allowableValues = "all,unread",
|
allowableValues = "all,unread",
|
||||||
requiredMode = RequiredMode.REQUIRED)
|
requiredMode = RequiredMode.REQUIRED)
|
||||||
private String readingMode;
|
private ReadingMode readingMode;
|
||||||
|
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "user reads entries in ascending or descending order",
|
description = "user reads entries in ascending or descending order",
|
||||||
allowableValues = "asc,desc",
|
allowableValues = "asc,desc",
|
||||||
requiredMode = RequiredMode.REQUIRED)
|
requiredMode = RequiredMode.REQUIRED)
|
||||||
private String readingOrder;
|
private ReadingOrder readingOrder;
|
||||||
|
|
||||||
@Schema(description = "user wants category and feeds with no unread entries shown", requiredMode = RequiredMode.REQUIRED)
|
@Schema(description = "user wants category and feeds with no unread entries shown", requiredMode = RequiredMode.REQUIRED)
|
||||||
private boolean showRead;
|
private boolean showRead;
|
||||||
@@ -47,7 +52,7 @@ public class Settings implements Serializable {
|
|||||||
description = "whether to scroll to the selected entry",
|
description = "whether to scroll to the selected entry",
|
||||||
allowableValues = "always,never,if_needed",
|
allowableValues = "always,never,if_needed",
|
||||||
requiredMode = RequiredMode.REQUIRED)
|
requiredMode = RequiredMode.REQUIRED)
|
||||||
private String scrollMode;
|
private ScrollMode scrollMode;
|
||||||
|
|
||||||
@Schema(description = "number of entries to keep above the selected entry when scrolling", requiredMode = RequiredMode.REQUIRED)
|
@Schema(description = "number of entries to keep above the selected entry when scrolling", requiredMode = RequiredMode.REQUIRED)
|
||||||
private int entriesToKeepOnTopWhenScrolling;
|
private int entriesToKeepOnTopWhenScrolling;
|
||||||
@@ -56,13 +61,13 @@ public class Settings implements Serializable {
|
|||||||
description = "whether to show the star icon in the header of entries",
|
description = "whether to show the star icon in the header of entries",
|
||||||
allowableValues = "always,never,on_desktop,on_mobile",
|
allowableValues = "always,never,on_desktop,on_mobile",
|
||||||
requiredMode = RequiredMode.REQUIRED)
|
requiredMode = RequiredMode.REQUIRED)
|
||||||
private String starIconDisplayMode;
|
private IconDisplayMode starIconDisplayMode;
|
||||||
|
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "whether to show the external link icon in the header of entries",
|
description = "whether to show the external link icon in the header of entries",
|
||||||
allowableValues = "always,never,on_desktop,on_mobile",
|
allowableValues = "always,never,on_desktop,on_mobile",
|
||||||
requiredMode = RequiredMode.REQUIRED)
|
requiredMode = RequiredMode.REQUIRED)
|
||||||
private String externalLinkIconDisplayMode;
|
private IconDisplayMode externalLinkIconDisplayMode;
|
||||||
|
|
||||||
@Schema(description = "ask for confirmation when marking all entries as read", requiredMode = RequiredMode.REQUIRED)
|
@Schema(description = "ask for confirmation when marking all entries as read", requiredMode = RequiredMode.REQUIRED)
|
||||||
private boolean markAllAsReadConfirmation;
|
private boolean markAllAsReadConfirmation;
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class CategoryREST {
|
|||||||
Entries entries = new Entries();
|
Entries entries = new Entries();
|
||||||
entries.setOffset(offset);
|
entries.setOffset(offset);
|
||||||
entries.setLimit(limit);
|
entries.setLimit(limit);
|
||||||
boolean unreadOnly = readType == ReadingMode.unread;
|
boolean unreadOnly = readType == ReadingMode.UNREAD;
|
||||||
if (StringUtils.isBlank(id)) {
|
if (StringUtils.isBlank(id)) {
|
||||||
id = ALL;
|
id = ALL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class FeedREST {
|
|||||||
entries.setOffset(offset);
|
entries.setOffset(offset);
|
||||||
entries.setLimit(limit);
|
entries.setLimit(limit);
|
||||||
|
|
||||||
boolean unreadOnly = readType == ReadingMode.unread;
|
boolean unreadOnly = readType == ReadingMode.UNREAD;
|
||||||
|
|
||||||
Instant newerThanDate = newerThan == null ? null : Instant.ofEpochMilli(newerThan);
|
Instant newerThanDate = newerThan == null ? null : Instant.ofEpochMilli(newerThan);
|
||||||
|
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ public class UserREST {
|
|||||||
User user = authenticationContext.getCurrentUser();
|
User user = authenticationContext.getCurrentUser();
|
||||||
UserSettings settings = userSettingsDAO.findByUser(user);
|
UserSettings settings = userSettingsDAO.findByUser(user);
|
||||||
if (settings != null) {
|
if (settings != null) {
|
||||||
s.setReadingMode(settings.getReadingMode().name());
|
s.setReadingMode(settings.getReadingMode());
|
||||||
s.setReadingOrder(settings.getReadingOrder().name());
|
s.setReadingOrder(settings.getReadingOrder());
|
||||||
s.setShowRead(settings.isShowRead());
|
s.setShowRead(settings.isShowRead());
|
||||||
|
|
||||||
s.getSharingSettings().setEmail(settings.isEmail());
|
s.getSharingSettings().setEmail(settings.isEmail());
|
||||||
@@ -116,10 +116,10 @@ public class UserREST {
|
|||||||
s.setCustomJs(settings.getCustomJs());
|
s.setCustomJs(settings.getCustomJs());
|
||||||
s.setLanguage(settings.getLanguage());
|
s.setLanguage(settings.getLanguage());
|
||||||
s.setScrollSpeed(settings.getScrollSpeed());
|
s.setScrollSpeed(settings.getScrollSpeed());
|
||||||
s.setScrollMode(settings.getScrollMode().name());
|
s.setScrollMode(settings.getScrollMode());
|
||||||
s.setEntriesToKeepOnTopWhenScrolling(settings.getEntriesToKeepOnTopWhenScrolling());
|
s.setEntriesToKeepOnTopWhenScrolling(settings.getEntriesToKeepOnTopWhenScrolling());
|
||||||
s.setStarIconDisplayMode(settings.getStarIconDisplayMode().name());
|
s.setStarIconDisplayMode(settings.getStarIconDisplayMode());
|
||||||
s.setExternalLinkIconDisplayMode(settings.getExternalLinkIconDisplayMode().name());
|
s.setExternalLinkIconDisplayMode(settings.getExternalLinkIconDisplayMode());
|
||||||
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
|
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
|
||||||
s.setMarkAllAsReadNavigateToNextUnread(settings.isMarkAllAsReadNavigateToNextUnread());
|
s.setMarkAllAsReadNavigateToNextUnread(settings.isMarkAllAsReadNavigateToNextUnread());
|
||||||
s.setCustomContextMenu(settings.isCustomContextMenu());
|
s.setCustomContextMenu(settings.isCustomContextMenu());
|
||||||
@@ -128,8 +128,8 @@ public class UserREST {
|
|||||||
s.setUnreadCountFavicon(settings.isUnreadCountFavicon());
|
s.setUnreadCountFavicon(settings.isUnreadCountFavicon());
|
||||||
s.setPrimaryColor(settings.getPrimaryColor());
|
s.setPrimaryColor(settings.getPrimaryColor());
|
||||||
} else {
|
} else {
|
||||||
s.setReadingMode(ReadingMode.unread.name());
|
s.setReadingMode(ReadingMode.UNREAD);
|
||||||
s.setReadingOrder(ReadingOrder.desc.name());
|
s.setReadingOrder(ReadingOrder.DESC);
|
||||||
s.setShowRead(true);
|
s.setShowRead(true);
|
||||||
|
|
||||||
s.getSharingSettings().setEmail(true);
|
s.getSharingSettings().setEmail(true);
|
||||||
@@ -144,10 +144,10 @@ public class UserREST {
|
|||||||
s.setScrollMarks(true);
|
s.setScrollMarks(true);
|
||||||
s.setLanguage("en");
|
s.setLanguage("en");
|
||||||
s.setScrollSpeed(400);
|
s.setScrollSpeed(400);
|
||||||
s.setScrollMode(ScrollMode.if_needed.name());
|
s.setScrollMode(ScrollMode.IF_NEEDED);
|
||||||
s.setEntriesToKeepOnTopWhenScrolling(1);
|
s.setEntriesToKeepOnTopWhenScrolling(1);
|
||||||
s.setStarIconDisplayMode(IconDisplayMode.on_desktop.name());
|
s.setStarIconDisplayMode(IconDisplayMode.ON_DESKTOP);
|
||||||
s.setExternalLinkIconDisplayMode(IconDisplayMode.on_desktop.name());
|
s.setExternalLinkIconDisplayMode(IconDisplayMode.ON_DESKTOP);
|
||||||
s.setMarkAllAsReadConfirmation(true);
|
s.setMarkAllAsReadConfirmation(true);
|
||||||
s.setMarkAllAsReadNavigateToNextUnread(false);
|
s.setMarkAllAsReadNavigateToNextUnread(false);
|
||||||
s.setCustomContextMenu(true);
|
s.setCustomContextMenu(true);
|
||||||
@@ -171,18 +171,18 @@ public class UserREST {
|
|||||||
s = new UserSettings();
|
s = new UserSettings();
|
||||||
s.setUser(user);
|
s.setUser(user);
|
||||||
}
|
}
|
||||||
s.setReadingMode(ReadingMode.valueOf(settings.getReadingMode()));
|
s.setReadingMode(settings.getReadingMode());
|
||||||
s.setReadingOrder(ReadingOrder.valueOf(settings.getReadingOrder()));
|
s.setReadingOrder(settings.getReadingOrder());
|
||||||
s.setShowRead(settings.isShowRead());
|
s.setShowRead(settings.isShowRead());
|
||||||
s.setScrollMarks(settings.isScrollMarks());
|
s.setScrollMarks(settings.isScrollMarks());
|
||||||
s.setCustomCss(settings.getCustomCss());
|
s.setCustomCss(settings.getCustomCss());
|
||||||
s.setCustomJs(CommaFeedConstants.USERNAME_DEMO.equals(user.getName()) ? "" : settings.getCustomJs());
|
s.setCustomJs(CommaFeedConstants.USERNAME_DEMO.equals(user.getName()) ? "" : settings.getCustomJs());
|
||||||
s.setLanguage(settings.getLanguage());
|
s.setLanguage(settings.getLanguage());
|
||||||
s.setScrollSpeed(settings.getScrollSpeed());
|
s.setScrollSpeed(settings.getScrollSpeed());
|
||||||
s.setScrollMode(ScrollMode.valueOf(settings.getScrollMode()));
|
s.setScrollMode(settings.getScrollMode());
|
||||||
s.setEntriesToKeepOnTopWhenScrolling(settings.getEntriesToKeepOnTopWhenScrolling());
|
s.setEntriesToKeepOnTopWhenScrolling(settings.getEntriesToKeepOnTopWhenScrolling());
|
||||||
s.setStarIconDisplayMode(IconDisplayMode.valueOf(settings.getStarIconDisplayMode()));
|
s.setStarIconDisplayMode(settings.getStarIconDisplayMode());
|
||||||
s.setExternalLinkIconDisplayMode(IconDisplayMode.valueOf(settings.getExternalLinkIconDisplayMode()));
|
s.setExternalLinkIconDisplayMode(settings.getExternalLinkIconDisplayMode());
|
||||||
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
|
s.setMarkAllAsReadConfirmation(settings.isMarkAllAsReadConfirmation());
|
||||||
s.setMarkAllAsReadNavigateToNextUnread(settings.isMarkAllAsReadNavigateToNextUnread());
|
s.setMarkAllAsReadNavigateToNextUnread(settings.isMarkAllAsReadNavigateToNextUnread());
|
||||||
s.setCustomContextMenu(settings.isCustomContextMenu());
|
s.setCustomContextMenu(settings.isCustomContextMenu());
|
||||||
|
|||||||
@@ -251,12 +251,12 @@ public class FeverREST {
|
|||||||
|
|
||||||
private List<Long> buildUnreadItemIds(User user, List<FeedSubscription> subscriptions) {
|
private List<Long> buildUnreadItemIds(User user, List<FeedSubscription> subscriptions) {
|
||||||
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user, subscriptions, true, null, null, 0,
|
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user, subscriptions, true, null, null, 0,
|
||||||
UNREAD_ITEM_IDS_BATCH_SIZE, ReadingOrder.desc, false, null, null, null);
|
UNREAD_ITEM_IDS_BATCH_SIZE, ReadingOrder.DESC, false, null, null, null);
|
||||||
return statuses.stream().map(s -> s.getEntry().getId()).toList();
|
return statuses.stream().map(s -> s.getEntry().getId()).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Long> buildSavedItemIds(User user) {
|
private List<Long> buildSavedItemIds(User user) {
|
||||||
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findStarred(user, null, 0, SAVED_ITEM_IDS_BATCH_SIZE, ReadingOrder.desc, false);
|
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findStarred(user, null, 0, SAVED_ITEM_IDS_BATCH_SIZE, ReadingOrder.DESC, false);
|
||||||
return statuses.stream().map(s -> s.getEntry().getId()).toList();
|
return statuses.stream().map(s -> s.getEntry().getId()).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ public class FeverREST {
|
|||||||
|
|
||||||
private List<FeverItem> buildItems(User user, List<FeedSubscription> subscriptions, Long sinceId, Long maxId) {
|
private List<FeverItem> buildItems(User user, List<FeedSubscription> subscriptions, Long sinceId, Long maxId) {
|
||||||
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user, subscriptions, false, null, null, 0, ITEMS_BATCH_SIZE,
|
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user, subscriptions, false, null, null, 0, ITEMS_BATCH_SIZE,
|
||||||
ReadingOrder.desc, false, null, sinceId, maxId);
|
ReadingOrder.DESC, false, null, sinceId, maxId);
|
||||||
return statuses.stream().map(this::mapStatus).toList();
|
return statuses.stream().map(this::mapStatus).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,4 +10,18 @@
|
|||||||
</column>
|
</column>
|
||||||
</addColumn>
|
</addColumn>
|
||||||
</changeSet>
|
</changeSet>
|
||||||
|
|
||||||
|
<changeSet id="uppercase-enum-values" author="athou">
|
||||||
|
<update tableName="USERSETTINGS">
|
||||||
|
<column name="readingOrder" valueComputed="upper(readingOrder)" />
|
||||||
|
<column name="readingMode" valueComputed="upper(readingMode)" />
|
||||||
|
<column name="scrollMode" valueComputed="upper(scrollMode)" />
|
||||||
|
<column name="starIconDisplayMode" valueComputed="upper(starIconDisplayMode)" />
|
||||||
|
<column name="externalLinkIconDisplayMode" valueComputed="upper(externalLinkIconDisplayMode)" />
|
||||||
|
</update>
|
||||||
|
<update tableName="FEEDENTRYCONTENTS">
|
||||||
|
<column name="direction" valueComputed="upper(direction)" />
|
||||||
|
</update>
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
|
|||||||
Reference in New Issue
Block a user