Skip to content

Commit

Permalink
copy_entry() should prefer feed title if source title is None. #290
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon24 committed Dec 5, 2024
1 parent b5e5e82 commit 35af3c6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/reader/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1639,11 +1639,12 @@ def copy_entry(self, src: EntryInput, dst: EntryInput, /) -> None:

attrs = dict(src_entry.__dict__)
attrs['feed_url'], attrs['id'] = dst_resource_id
if not src_entry.source:
feed = src_entry.feed
attrs['source'] = dict(feed.__dict__)
if feed.user_title:
attrs['source']['title'] = feed.user_title

feed = src_entry.feed
attrs['source'] = dict((src_entry.source or feed).__dict__)
# TODO: "or feed.resolved_title" is not tested
attrs['source']['title'] = attrs['source']['title'] or feed.resolved_title

attrs['recent_sort'] = recent_sort
attrs['added_by'] = 'user'

Expand Down

0 comments on commit 35af3c6

Please sign in to comment.