mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
position is now always set (#1076)
This commit is contained in:
@@ -38,6 +38,6 @@ public class FeedCategory extends AbstractModel {
|
||||
|
||||
private boolean collapsed;
|
||||
|
||||
private Integer position;
|
||||
private int position;
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class FeedSubscription extends AbstractModel {
|
||||
@OneToMany(mappedBy = "subscription", cascade = CascadeType.REMOVE)
|
||||
private Set<FeedEntryStatus> statuses;
|
||||
|
||||
private Integer position;
|
||||
private int position;
|
||||
|
||||
@Column(name = "filtering_expression", length = 4096)
|
||||
private String filter;
|
||||
|
||||
@@ -35,5 +35,5 @@ public class Category implements Serializable {
|
||||
private boolean expanded;
|
||||
|
||||
@ApiModelProperty(value = "position of the category in the list", required = true)
|
||||
private Integer position;
|
||||
private int position;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class Subscription implements Serializable {
|
||||
private String categoryId;
|
||||
|
||||
@ApiModelProperty("position of the subscription's in the list")
|
||||
private Integer position;
|
||||
private int position;
|
||||
|
||||
@ApiModelProperty(value = "date of the newest item", dataType = "number")
|
||||
private Date newestItemTime;
|
||||
|
||||
@@ -458,7 +458,7 @@ public class CategoryREST {
|
||||
category.getChildren().add(child);
|
||||
}
|
||||
}
|
||||
Collections.sort(category.getChildren(), (o1, o2) -> ObjectUtils.compare(o1.getPosition(), o2.getPosition()));
|
||||
category.getChildren().sort(Comparator.comparing(Category::getPosition).thenComparing(Category::getName));
|
||||
|
||||
for (FeedSubscription subscription : subscriptions) {
|
||||
if (id == null && subscription.getCategory() == null
|
||||
@@ -468,7 +468,7 @@ public class CategoryREST {
|
||||
category.getFeeds().add(sub);
|
||||
}
|
||||
}
|
||||
Collections.sort(category.getFeeds(), (o1, o2) -> ObjectUtils.compare(o1.getPosition(), o2.getPosition()));
|
||||
category.getFeeds().sort(Comparator.comparing(Subscription::getPosition).thenComparing(Subscription::getName));
|
||||
|
||||
return category;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user