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 6e5c0ef
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/reader/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1639,11 +1639,14 @@ 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

if src_entry.source:
attrs['source'] = dict(src_entry.source.__dict__)
else:
attrs['source'] = dict(src_entry.feed.__dict__)
if not src_entry.source or not src_entry.source.title:
attrs['source']['title'] = src_entry.feed.resolved_title

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

Expand Down

0 comments on commit 6e5c0ef

Please sign in to comment.