mirror of
https://github.com/Athou/commafeed.git
synced 2026-11-05 03:44:47 +00:00
restore empty categories when importing OPML files (#2364)
This commit is contained in:
@@ -47,7 +47,11 @@ public class OPMLImporter {
|
||||
|
||||
private void handleOutline(User user, Outline outline, FeedCategory parent, int position) {
|
||||
List<Outline> children = outline.getChildren();
|
||||
if (CollectionUtils.isNotEmpty(children)) {
|
||||
// an outline without children is an empty category, unless it describes a feed or another type of content
|
||||
boolean isCategory =
|
||||
CollectionUtils.isNotEmpty(children)
|
||||
|| StringUtils.isBlank(outline.getXmlUrl()) && StringUtils.isBlank(outline.getType());
|
||||
if (isCategory) {
|
||||
String name = FeedUtils.truncate(outline.getText(), 128);
|
||||
if (name == null) {
|
||||
name = FeedUtils.truncate(outline.getTitle(), 128);
|
||||
|
||||
Reference in New Issue
Block a user