]> uap-core.de Git - rssreader.git/commitdiff
fix feed group item sorting
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 27 Nov 2025 19:49:22 +0000 (20:49 +0100)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Thu, 27 Nov 2025 19:49:22 +0000 (20:49 +0100)
rss-application/src/main/kotlin/de/unixwork/rssreader/FeedList.kt
rss-application/src/main/kotlin/de/unixwork/rssreader/Item.kt
rss-application/src/main/kotlin/de/unixwork/rssreader/MainWindow.kt

index ac69e1ecd1231161765da2a107cdb97bdd00dee3..1943dd1d4a284f7369fbe2114cc992a7548b5782 100644 (file)
@@ -113,7 +113,7 @@ class FeedList(window: MainWindow) : Document() {
                 collection.items.add(item)
             }
         }
-        collection.items.sortByDescending { it.pubDate }
+        collection.items.sortByDescending { it.date }
         collection.itemsLoaded = true
 
         loadFeed(collection)
index 30431fa161304ab248509f5bb91f7f808b48b0c3..b70bd0dc8ef17a04b855abe4fa9d4edef98f7395 100644 (file)
@@ -22,6 +22,8 @@ class Item(id: Int) {
     var feedName: String? = null
     var feedUrl: String? = null
 
+    val date: Instant? get() = updated ?: pubDate
+
     var collection: FeedCollection? = null
 
     fun getContent(): Content {
index cd6211bb46f34aeb6c6cbe301aa83209b5111f3c..a9abfe1fed94fa21c4e609cd4b8be7c4803f0d05 100644 (file)
@@ -270,7 +270,7 @@ class MainWindow() {
                         when(col) {
                             0 -> result = elm.title
                             1 -> {
-                                val date = elm.updated ?: elm.pubDate
+                                val date = elm.date
                                 date?.let {
                                     val localDate = date.atZone(ZoneId.systemDefault()).toLocalDate()
                                     val now = LocalDate.now()