mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
remove unused onlyIds parameter
This commit is contained in:
@@ -117,7 +117,6 @@ export interface GetEntriesRequest {
|
|||||||
newerThan?: number
|
newerThan?: number
|
||||||
order?: ReadingOrder
|
order?: ReadingOrder
|
||||||
keywords?: string
|
keywords?: string
|
||||||
onlyIds?: boolean
|
|
||||||
excludedSubscriptionIds?: string
|
excludedSubscriptionIds?: string
|
||||||
tag?: string
|
tag?: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ public class FeedEntryStatusDAO extends GenericDAO<FeedEntryStatus> {
|
|||||||
|
|
||||||
public List<FeedEntryStatus> findBySubscriptions(User user, List<FeedSubscription> subs, boolean unreadOnly,
|
public List<FeedEntryStatus> findBySubscriptions(User user, List<FeedSubscription> subs, boolean unreadOnly,
|
||||||
List<FeedEntryKeyword> keywords, Instant newerThan, int offset, int limit, ReadingOrder order, boolean includeContent,
|
List<FeedEntryKeyword> keywords, Instant newerThan, int offset, int limit, ReadingOrder order, boolean includeContent,
|
||||||
boolean onlyIds, String tag, Long minEntryId, Long maxEntryId) {
|
String tag, Long minEntryId, Long maxEntryId) {
|
||||||
|
|
||||||
JPAQuery<Tuple> query = query().select(entry, subscription, status).from(entry);
|
JPAQuery<Tuple> query = query().select(entry, subscription, status).from(entry);
|
||||||
query.join(entry.feed, feed);
|
query.join(entry.feed, feed);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public class FeedEntryService {
|
|||||||
public void markSubscriptionEntries(User user, List<FeedSubscription> subscriptions, Instant olderThan, Instant insertedBefore,
|
public void markSubscriptionEntries(User user, List<FeedSubscription> subscriptions, Instant olderThan, Instant insertedBefore,
|
||||||
List<FeedEntryKeyword> keywords) {
|
List<FeedEntryKeyword> keywords) {
|
||||||
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user, subscriptions, true, keywords, null, -1, -1, null,
|
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user, subscriptions, true, keywords, null, -1, -1, null,
|
||||||
false, false, null, null, null);
|
false, null, null, null);
|
||||||
markList(statuses, olderThan, insertedBefore);
|
markList(statuses, olderThan, insertedBefore);
|
||||||
cache.invalidateUnreadCount(subscriptions.toArray(new FeedSubscription[0]));
|
cache.invalidateUnreadCount(subscriptions.toArray(new FeedSubscription[0]));
|
||||||
cache.invalidateUserRootCategory(user);
|
cache.invalidateUserRootCategory(user);
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ public class CategoryREST {
|
|||||||
@Parameter(description = "ordering") @QueryParam("order") @DefaultValue("desc") ReadingOrder order,
|
@Parameter(description = "ordering") @QueryParam("order") @DefaultValue("desc") ReadingOrder order,
|
||||||
@Parameter(
|
@Parameter(
|
||||||
description = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords,
|
description = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords,
|
||||||
@Parameter(description = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds,
|
|
||||||
@Parameter(
|
@Parameter(
|
||||||
description = "comma-separated list of excluded subscription ids") @QueryParam("excludedSubscriptionIds") String excludedSubscriptionIds,
|
description = "comma-separated list of excluded subscription ids") @QueryParam("excludedSubscriptionIds") String excludedSubscriptionIds,
|
||||||
@Parameter(description = "keep only entries tagged with this tag") @QueryParam("tag") String tag) {
|
@Parameter(description = "keep only entries tagged with this tag") @QueryParam("tag") String tag) {
|
||||||
@@ -143,7 +142,7 @@ public class CategoryREST {
|
|||||||
List<FeedSubscription> subs = feedSubscriptionDAO.findAll(user);
|
List<FeedSubscription> subs = feedSubscriptionDAO.findAll(user);
|
||||||
removeExcludedSubscriptions(subs, excludedIds);
|
removeExcludedSubscriptions(subs, excludedIds);
|
||||||
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, subs, unreadOnly, entryKeywords, newerThanDate,
|
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, subs, unreadOnly, entryKeywords, newerThanDate,
|
||||||
offset, limit + 1, order, true, onlyIds, tag, null, null);
|
offset, limit + 1, order, true, tag, null, null);
|
||||||
|
|
||||||
for (FeedEntryStatus status : list) {
|
for (FeedEntryStatus status : list) {
|
||||||
entries.getEntries().add(Entry.build(status, config.getApplicationSettings().getImageProxyEnabled()));
|
entries.getEntries().add(Entry.build(status, config.getApplicationSettings().getImageProxyEnabled()));
|
||||||
@@ -151,7 +150,7 @@ public class CategoryREST {
|
|||||||
|
|
||||||
} else if (STARRED.equals(id)) {
|
} else if (STARRED.equals(id)) {
|
||||||
entries.setName("Starred");
|
entries.setName("Starred");
|
||||||
List<FeedEntryStatus> starred = feedEntryStatusDAO.findStarred(user, newerThanDate, offset, limit + 1, order, !onlyIds);
|
List<FeedEntryStatus> starred = feedEntryStatusDAO.findStarred(user, newerThanDate, offset, limit + 1, order, true);
|
||||||
for (FeedEntryStatus status : starred) {
|
for (FeedEntryStatus status : starred) {
|
||||||
entries.getEntries().add(Entry.build(status, config.getApplicationSettings().getImageProxyEnabled()));
|
entries.getEntries().add(Entry.build(status, config.getApplicationSettings().getImageProxyEnabled()));
|
||||||
}
|
}
|
||||||
@@ -162,7 +161,7 @@ public class CategoryREST {
|
|||||||
List<FeedSubscription> subs = feedSubscriptionDAO.findByCategories(user, categories);
|
List<FeedSubscription> subs = feedSubscriptionDAO.findByCategories(user, categories);
|
||||||
removeExcludedSubscriptions(subs, excludedIds);
|
removeExcludedSubscriptions(subs, excludedIds);
|
||||||
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, subs, unreadOnly, entryKeywords, newerThanDate,
|
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, subs, unreadOnly, entryKeywords, newerThanDate,
|
||||||
offset, limit + 1, order, true, onlyIds, tag, null, null);
|
offset, limit + 1, order, true, tag, null, null);
|
||||||
|
|
||||||
for (FeedEntryStatus status : list) {
|
for (FeedEntryStatus status : list) {
|
||||||
entries.getEntries().add(Entry.build(status, config.getApplicationSettings().getImageProxyEnabled()));
|
entries.getEntries().add(Entry.build(status, config.getApplicationSettings().getImageProxyEnabled()));
|
||||||
@@ -202,13 +201,11 @@ public class CategoryREST {
|
|||||||
@Parameter(description = "date ordering") @QueryParam("order") @DefaultValue("desc") ReadingOrder order,
|
@Parameter(description = "date ordering") @QueryParam("order") @DefaultValue("desc") ReadingOrder order,
|
||||||
@Parameter(
|
@Parameter(
|
||||||
description = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords,
|
description = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords,
|
||||||
@Parameter(description = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds,
|
|
||||||
@Parameter(
|
@Parameter(
|
||||||
description = "comma-separated list of excluded subscription ids") @QueryParam("excludedSubscriptionIds") String excludedSubscriptionIds,
|
description = "comma-separated list of excluded subscription ids") @QueryParam("excludedSubscriptionIds") String excludedSubscriptionIds,
|
||||||
@Parameter(description = "keep only entries tagged with this tag") @QueryParam("tag") String tag) {
|
@Parameter(description = "keep only entries tagged with this tag") @QueryParam("tag") String tag) {
|
||||||
|
|
||||||
Response response = getCategoryEntries(user, id, readType, newerThan, offset, limit, order, keywords, onlyIds,
|
Response response = getCategoryEntries(user, id, readType, newerThan, offset, limit, order, keywords, excludedSubscriptionIds, tag);
|
||||||
excludedSubscriptionIds, tag);
|
|
||||||
if (response.getStatus() != Status.OK.getStatusCode()) {
|
if (response.getStatus() != Status.OK.getStatusCode()) {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,10 +143,8 @@ public class FeedREST {
|
|||||||
@Parameter(description = "only entries newer than this") @QueryParam("newerThan") Long newerThan,
|
@Parameter(description = "only entries newer than this") @QueryParam("newerThan") Long newerThan,
|
||||||
@Parameter(description = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset,
|
@Parameter(description = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset,
|
||||||
@Parameter(description = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit,
|
@Parameter(description = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit,
|
||||||
@Parameter(description = "ordering") @QueryParam("order") @DefaultValue("desc") ReadingOrder order,
|
@Parameter(description = "ordering") @QueryParam("order") @DefaultValue("desc") ReadingOrder order, @Parameter(
|
||||||
@Parameter(
|
description = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords) {
|
||||||
description = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords,
|
|
||||||
@Parameter(description = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds) {
|
|
||||||
|
|
||||||
Preconditions.checkNotNull(id);
|
Preconditions.checkNotNull(id);
|
||||||
Preconditions.checkNotNull(readType);
|
Preconditions.checkNotNull(readType);
|
||||||
@@ -174,7 +172,7 @@ public class FeedREST {
|
|||||||
entries.setFeedLink(subscription.getFeed().getLink());
|
entries.setFeedLink(subscription.getFeed().getLink());
|
||||||
|
|
||||||
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, Collections.singletonList(subscription), unreadOnly,
|
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, Collections.singletonList(subscription), unreadOnly,
|
||||||
entryKeywords, newerThanDate, offset, limit + 1, order, true, onlyIds, null, null, null);
|
entryKeywords, newerThanDate, offset, limit + 1, order, true, null, null, null);
|
||||||
|
|
||||||
for (FeedEntryStatus status : list) {
|
for (FeedEntryStatus status : list) {
|
||||||
entries.getEntries().add(Entry.build(status, config.getApplicationSettings().getImageProxyEnabled()));
|
entries.getEntries().add(Entry.build(status, config.getApplicationSettings().getImageProxyEnabled()));
|
||||||
@@ -209,12 +207,10 @@ public class FeedREST {
|
|||||||
@Parameter(description = "only entries newer than this") @QueryParam("newerThan") Long newerThan,
|
@Parameter(description = "only entries newer than this") @QueryParam("newerThan") Long newerThan,
|
||||||
@Parameter(description = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset,
|
@Parameter(description = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset,
|
||||||
@Parameter(description = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit,
|
@Parameter(description = "limit for paging, default 20, maximum 1000") @DefaultValue("20") @QueryParam("limit") int limit,
|
||||||
@Parameter(description = "date ordering") @QueryParam("order") @DefaultValue("desc") ReadingOrder order,
|
@Parameter(description = "date ordering") @QueryParam("order") @DefaultValue("desc") ReadingOrder order, @Parameter(
|
||||||
@Parameter(
|
description = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords) {
|
||||||
description = "search for keywords in either the title or the content of the entries, separated by spaces, 3 characters minimum") @QueryParam("keywords") String keywords,
|
|
||||||
@Parameter(description = "return only entry ids") @DefaultValue("false") @QueryParam("onlyIds") boolean onlyIds) {
|
|
||||||
|
|
||||||
Response response = getFeedEntries(user, id, readType, newerThan, offset, limit, order, keywords, onlyIds);
|
Response response = getFeedEntries(user, id, readType, newerThan, offset, limit, order, keywords);
|
||||||
if (response.getStatus() != Status.OK.getStatusCode()) {
|
if (response.getStatus() != Status.OK.getStatusCode()) {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ 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, true, 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,7 +281,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, false, null, sinceId, maxId);
|
ReadingOrder.desc, false, null, sinceId, maxId);
|
||||||
return statuses.stream().map(this::mapStatus).toList();
|
return statuses.stream().map(this::mapStatus).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ public class NextUnreadServlet extends HttpServlet {
|
|||||||
if (StringUtils.isBlank(categoryId) || CategoryREST.ALL.equals(categoryId)) {
|
if (StringUtils.isBlank(categoryId) || CategoryREST.ALL.equals(categoryId)) {
|
||||||
List<FeedSubscription> subs = feedSubscriptionDAO.findAll(user.get());
|
List<FeedSubscription> subs = feedSubscriptionDAO.findAll(user.get());
|
||||||
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user.get(), subs, true, null, null, 0, 1, order,
|
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user.get(), subs, true, null, null, 0, 1, order,
|
||||||
true, false, null, null, null);
|
true, null, null, null);
|
||||||
s = Iterables.getFirst(statuses, null);
|
s = Iterables.getFirst(statuses, null);
|
||||||
} else {
|
} else {
|
||||||
FeedCategory category = feedCategoryDAO.findById(user.get(), Long.valueOf(categoryId));
|
FeedCategory category = feedCategoryDAO.findById(user.get(), Long.valueOf(categoryId));
|
||||||
@@ -76,7 +76,7 @@ public class NextUnreadServlet extends HttpServlet {
|
|||||||
List<FeedCategory> children = feedCategoryDAO.findAllChildrenCategories(user.get(), category);
|
List<FeedCategory> children = feedCategoryDAO.findAllChildrenCategories(user.get(), category);
|
||||||
List<FeedSubscription> subscriptions = feedSubscriptionDAO.findByCategories(user.get(), children);
|
List<FeedSubscription> subscriptions = feedSubscriptionDAO.findByCategories(user.get(), children);
|
||||||
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user.get(), subscriptions, true, null, null, 0,
|
List<FeedEntryStatus> statuses = feedEntryStatusDAO.findBySubscriptions(user.get(), subscriptions, true, null, null, 0,
|
||||||
1, order, true, false, null, null, null);
|
1, order, true, null, null, null);
|
||||||
s = Iterables.getFirst(statuses, null);
|
s = Iterables.getFirst(statuses, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user