Open
Conversation
…ontent and improving formatting. Cleaned up unnecessary sections and ensured consistency in comments. Signed-off-by: Mika Ipstenu Epstein <ipstenu@halfelf.org>
Currently planet feed is ordered by when the CACHE file was last written (file mtime), not by when the post was published. Meaning any new feeds listed would be showing as newer. To fix this, I have updated venus/planet/splice.py, build the list of entries to include by getting the Atom XML updated or published data and sorting by that first. This will still respect new_feed_items, max_items, sub_ids, and idindex; only the order in which cache files are considered changes. Signed-off-by: Mika Ipstenu Epstein <ipstenu@halfelf.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
Feeds are showing out of order. This is because the planet is ordered by when the cache file was last written (file mtime), not by when the post was published. So:
Relevant code:
splicenever looks at the entry’s date; it only uses filemtimeandpath.Summary of Changes
1. Helper
_entry_date_sort_key(filepath)(venus/planet/splice.py)<updated>or<published>(Atom NS) and parses it withfeedparser._parse_date_iso8601().time.gmtime(os.stat(filepath).st_mtime).2. Sort by entry date (newest first) (venus/planet/splice.py)
dirfrom(os.stat(file).st_mtime, file)and reversed it.dirby calling_entry_date_sort_key(file)for each cache file and appending(sort_key, file).dir.sort(key=lambda x: x[0], reverse=True)so newest entry date is first.new_feed_items,max_items,sub_ids, and idindex. Only the order of iteration over cache files changed.3. Shared
atomNSatomNS = 'http://www.w3.org/2005/Atom'is defined at module level and used by the helper and the existinggetElementsByTagNameNS(atomNS, 'source')in the loop.Result
The planet page is ordered by the entry’s published/updated date (newest first), so Jan 29, 2026 will appear before April 14, 2025 when you rebuild. Tests were not run in this environment (Python 2 / venv expectations), but the change only affects sort order, not which entries are included, so the existing count assertions (12, 8, 9 entries) should still hold.