Skip to content

Commit

Permalink
Reverse OPML feeds list when importing
Browse files Browse the repository at this point in the history
Since the app orders based on when the feed is created, we are reversing the OPML list in order to try and preserve the order as much as we can. It might still get affected, because we are doing parallel processing (since we are doing joinAll it should be fine, but not entirely sure).
  • Loading branch information
msasikanth committed Oct 29, 2023
1 parent e40c7e6 commit 07030bc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class OpmlManager(
val totalFeedCount = feedLinks.size
val processedFeedsCount = AtomicInt(0)

feedLinks.chunked(IMPORT_CHUNKS).forEach { feedsGroup ->
feedLinks.reversed().chunked(IMPORT_CHUNKS).forEach { feedsGroup ->
feedsGroup
.map { feed -> launch { rssRepository.addFeed(feedLink = feed.link, title = feed.title) } }
.joinAll()
Expand Down

0 comments on commit 07030bc

Please sign in to comment.