mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
set default values when importing
This commit is contained in:
@@ -59,6 +59,9 @@ public class OPMLImporter {
|
|||||||
if (category == null) {
|
if (category == null) {
|
||||||
category = new FeedCategory();
|
category = new FeedCategory();
|
||||||
category.setName(FeedUtils.truncate(outline.getText(), 128));
|
category.setName(FeedUtils.truncate(outline.getText(), 128));
|
||||||
|
if (StringUtils.isBlank(category.getName())) {
|
||||||
|
category.setName("Unnamed category");
|
||||||
|
}
|
||||||
category.setParent(parent);
|
category.setParent(parent);
|
||||||
category.setUser(user);
|
category.setUser(user);
|
||||||
feedCategoryDAO.save(category);
|
feedCategoryDAO.save(category);
|
||||||
@@ -69,9 +72,12 @@ public class OPMLImporter {
|
|||||||
handleOutline(user, child, category);
|
handleOutline(user, child, category);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
String title = outline.getText();
|
||||||
feedSubscriptionService.subscribe(user, outline.getXmlUrl(),
|
if (StringUtils.isBlank(title)) {
|
||||||
outline.getText(), parent);
|
title = "Unnamed subscription";
|
||||||
|
}
|
||||||
|
feedSubscriptionService.subscribe(user, outline.getXmlUrl(), title,
|
||||||
|
parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user