fix build warning

This commit is contained in:
Athou
2025-07-28 19:55:36 +02:00
parent 03312c1592
commit ff7aa890a6
6 changed files with 39 additions and 35 deletions

View File

@@ -2,8 +2,6 @@ package com.commafeed.frontend.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
@@ -16,10 +14,6 @@ import com.commafeed.backend.model.FeedEntryContent;
import com.commafeed.backend.model.FeedEntryStatus;
import com.commafeed.backend.model.FeedEntryTag;
import com.commafeed.backend.model.FeedSubscription;
import com.rometools.rome.feed.synd.SyndContentImpl;
import com.rometools.rome.feed.synd.SyndEnclosureImpl;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndEntryImpl;
import io.quarkus.runtime.annotations.RegisterForReflection;
import lombok.Data;
@@ -149,26 +143,4 @@ public class Entry implements Serializable {
return entry;
}
public SyndEntry asRss() {
SyndEntry entry = new SyndEntryImpl();
entry.setUri(getGuid());
entry.setTitle(getTitle());
entry.setAuthor(getAuthor());
SyndContentImpl content = new SyndContentImpl();
content.setValue(getContent());
entry.setContents(Collections.singletonList(content));
if (getEnclosureUrl() != null) {
SyndEnclosureImpl enclosure = new SyndEnclosureImpl();
enclosure.setType(getEnclosureType());
enclosure.setUrl(getEnclosureUrl());
entry.setEnclosures(Collections.singletonList(enclosure));
}
entry.setLink(getUrl());
entry.setPublishedDate(getDate() == null ? null : Date.from(getDate()));
return entry;
}
}

View File

@@ -40,6 +40,7 @@ import com.commafeed.backend.dao.FeedCategoryDAO;
import com.commafeed.backend.dao.FeedEntryStatusDAO;
import com.commafeed.backend.dao.FeedSubscriptionDAO;
import com.commafeed.backend.feed.FeedEntryKeyword;
import com.commafeed.backend.feed.FeedUtils;
import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.FeedEntryStatus;
import com.commafeed.backend.model.FeedSubscription;
@@ -217,7 +218,7 @@ public class CategoryREST {
feed.setTitle("CommaFeed - " + entries.getName());
feed.setDescription("CommaFeed - " + entries.getName());
feed.setLink(uri.getBaseUri().toString());
feed.setEntries(entries.getEntries().stream().map(Entry::asRss).toList());
feed.setEntries(entries.getEntries().stream().map(FeedUtils::asRss).toList());
SyndFeedOutput output = new SyndFeedOutput();
StringWriter writer = new StringWriter();

View File

@@ -48,6 +48,7 @@ import com.commafeed.backend.feed.FeedEntryKeyword;
import com.commafeed.backend.feed.FeedFetcher;
import com.commafeed.backend.feed.FeedFetcher.FeedFetcherResult;
import com.commafeed.backend.feed.FeedRefreshEngine;
import com.commafeed.backend.feed.FeedUtils;
import com.commafeed.backend.model.Feed;
import com.commafeed.backend.model.FeedCategory;
import com.commafeed.backend.model.FeedEntry;
@@ -219,7 +220,7 @@ public class FeedREST {
feed.setTitle("CommaFeed - " + entries.getName());
feed.setDescription("CommaFeed - " + entries.getName());
feed.setLink(uri.getBaseUri().toString());
feed.setEntries(entries.getEntries().stream().map(Entry::asRss).toList());
feed.setEntries(entries.getEntries().stream().map(FeedUtils::asRss).toList());
SyndFeedOutput output = new SyndFeedOutput();
StringWriter writer = new StringWriter();