mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
build icon url server side
This commit is contained in:
@@ -70,6 +70,7 @@ public class CategoryREST extends AbstractResourceREST {
|
||||
@ApiParam(value = "date ordering", allowableValues = "asc,desc") @QueryParam("order") @DefaultValue("desc") ReadingOrder order) {
|
||||
|
||||
Preconditions.checkNotNull(readType);
|
||||
limit = Math.min(limit, 50);
|
||||
|
||||
Entries entries = new Entries();
|
||||
boolean unreadOnly = readType == ReadType.unread;
|
||||
@@ -82,7 +83,9 @@ public class CategoryREST extends AbstractResourceREST {
|
||||
List<FeedEntryStatus> unreadEntries = feedEntryStatusDAO.findAll(
|
||||
getUser(), unreadOnly, offset, limit, order, true);
|
||||
for (FeedEntryStatus status : unreadEntries) {
|
||||
entries.getEntries().add(Entry.build(status));
|
||||
entries.getEntries().add(
|
||||
Entry.build(status, applicationSettingsService.get()
|
||||
.getPublicUrl()));
|
||||
}
|
||||
|
||||
} else if (STARRED.equals(id)) {
|
||||
@@ -90,7 +93,9 @@ public class CategoryREST extends AbstractResourceREST {
|
||||
List<FeedEntryStatus> starred = feedEntryStatusDAO.findStarred(
|
||||
getUser(), offset, limit, order, true);
|
||||
for (FeedEntryStatus status : starred) {
|
||||
entries.getEntries().add(Entry.build(status));
|
||||
entries.getEntries().add(
|
||||
Entry.build(status, applicationSettingsService.get()
|
||||
.getPublicUrl()));
|
||||
}
|
||||
} else {
|
||||
FeedCategory feedCategory = feedCategoryDAO.findById(getUser(),
|
||||
@@ -102,7 +107,9 @@ public class CategoryREST extends AbstractResourceREST {
|
||||
.findByCategories(childrenCategories, getUser(),
|
||||
unreadOnly, offset, limit, order, true);
|
||||
for (FeedEntryStatus status : unreadEntries) {
|
||||
entries.getEntries().add(Entry.build(status));
|
||||
entries.getEntries().add(
|
||||
Entry.build(status, applicationSettingsService
|
||||
.get().getPublicUrl()));
|
||||
}
|
||||
entries.setName(feedCategory.getName());
|
||||
}
|
||||
@@ -347,7 +354,9 @@ public class CategoryREST extends AbstractResourceREST {
|
||||
.equals(subscription.getCategory().getId(), id))) {
|
||||
Long size = unreadCount.get(subscription.getId());
|
||||
long unread = size == null ? 0 : size;
|
||||
Subscription sub = Subscription.build(subscription, unread);
|
||||
Subscription sub = Subscription
|
||||
.build(subscription, applicationSettingsService.get()
|
||||
.getPublicUrl(), unread);
|
||||
category.getFeeds().add(sub);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ public class EntryREST extends AbstractResourceREST {
|
||||
@ApiParam(value = "offset for paging") @DefaultValue("0") @QueryParam("offset") int offset,
|
||||
@ApiParam(value = "limit for paging") @DefaultValue("-1") @QueryParam("limit") int limit) {
|
||||
keywords = StringUtils.trimToEmpty(keywords);
|
||||
limit = Math.min(limit, 50);
|
||||
Preconditions.checkArgument(StringUtils.length(keywords) >= 3);
|
||||
|
||||
Entries entries = new Entries();
|
||||
@@ -71,7 +72,8 @@ public class EntryREST extends AbstractResourceREST {
|
||||
List<FeedEntryStatus> entriesStatus = feedEntryStatusDAO
|
||||
.findByKeywords(getUser(), keywords, offset, limit);
|
||||
for (FeedEntryStatus status : entriesStatus) {
|
||||
list.add(Entry.build(status));
|
||||
list.add(Entry.build(status, applicationSettingsService.get()
|
||||
.getPublicUrl()));
|
||||
}
|
||||
|
||||
entries.setName("Search for : " + keywords);
|
||||
|
||||
@@ -75,6 +75,8 @@ public class FeedREST extends AbstractResourceREST {
|
||||
|
||||
Preconditions.checkNotNull(id);
|
||||
Preconditions.checkNotNull(readType);
|
||||
|
||||
limit = Math.min(limit, 50);
|
||||
|
||||
Entries entries = new Entries();
|
||||
boolean unreadOnly = readType == ReadType.unread;
|
||||
@@ -90,7 +92,9 @@ public class FeedREST extends AbstractResourceREST {
|
||||
.findByFeed(subscription.getFeed(), getUser(), unreadOnly,
|
||||
offset, limit, order, true);
|
||||
for (FeedEntryStatus status : unreadEntries) {
|
||||
entries.getEntries().add(Entry.build(status));
|
||||
entries.getEntries().add(
|
||||
Entry.build(status, applicationSettingsService.get()
|
||||
.getPublicUrl()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -221,7 +225,9 @@ public class FeedREST extends AbstractResourceREST {
|
||||
if (sub == null) {
|
||||
return Response.status(Status.NOT_FOUND).build();
|
||||
}
|
||||
return Response.ok(Subscription.build(sub, 0)).build();
|
||||
return Response.ok(
|
||||
Subscription.build(sub, applicationSettingsService.get()
|
||||
.getPublicUrl(), 0)).build();
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
Reference in New Issue
Block a user