18
18
#
19
19
20
20
from markdownfeeds .Generators .Default .Models .FeedItem import FeedItem
21
- from markdownfeeds .Generators .Json .Models .Author import Author
22
21
from markdownfeeds .Generators .Json .Models .JsonFeedItem import JsonFeedItem
23
- from markdownfeeds .MarkdownFile import MarkdownFile
24
22
25
23
from src .feeds import BaseJsonFeed , Filters
26
24
@@ -37,14 +35,6 @@ def _check_feed_items(
37
35
super ()._check_feed_items (feed_items )
38
36
BaseJsonFeed ._check_for_duplicates (feed_items , 'external_url' )
39
37
40
- def _inject_feed_item_details (
41
- self , feed_item : JsonFeedItem , markdown_file : MarkdownFile ) -> JsonFeedItem :
42
- """
43
- Inject any additional feed item details.
44
- """
45
- feed_item = self ._inject_authors_into_featured (feed_item )
46
- return super ()._inject_feed_item_details (feed_item , markdown_file )
47
-
48
38
def _sort_feed_items (
49
39
self , feed_items : [FeedItem ]) -> [FeedItem ]:
50
40
"""
@@ -53,26 +43,6 @@ def _sort_feed_items(
53
43
feed_items .sort (key = lambda feed_item : feed_item .get ('date_published' ), reverse = True )
54
44
return feed_items
55
45
56
- @staticmethod
57
- def _inject_authors_into_featured (
58
- feed_item : JsonFeedItem
59
- ) -> JsonFeedItem :
60
- """
61
- This function replaces any "authors" list items that reference a contributor using their username with
62
- their contributor profile.
63
- """
64
- if not feed_item .has ('authors' ):
65
- return feed_item
66
-
67
- authors = feed_item .get ('authors' )
68
- for key , value in enumerate (authors ):
69
- author = Author ()
70
- author .inject_dict (value )
71
- authors [key ] = author
72
-
73
- feed_item .set ('authors' , authors )
74
- return feed_item
75
-
76
46
def _generate_filters (
77
47
self ,
78
48
feed_items : [JsonFeedItem ]
0 commit comments