Skip to content

Commit 84a487e

Browse files
author
Scott Straughan
committed
Removed redundant code.
1 parent 8924bdc commit 84a487e

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

src/feeds/ResearchPaperFeed.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
#
1919

2020
from markdownfeeds.Generators.Default.Models.FeedItem import FeedItem
21-
from markdownfeeds.Generators.Json.Models.Author import Author
2221
from markdownfeeds.Generators.Json.Models.JsonFeedItem import JsonFeedItem
23-
from markdownfeeds.MarkdownFile import MarkdownFile
2422

2523
from src.feeds import BaseJsonFeed, Filters
2624

@@ -37,14 +35,6 @@ def _check_feed_items(
3735
super()._check_feed_items(feed_items)
3836
BaseJsonFeed._check_for_duplicates(feed_items, 'external_url')
3937

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-
4838
def _sort_feed_items(
4939
self, feed_items: [FeedItem]) -> [FeedItem]:
5040
"""
@@ -53,26 +43,6 @@ def _sort_feed_items(
5343
feed_items.sort(key=lambda feed_item: feed_item.get('date_published'), reverse=True)
5444
return feed_items
5545

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-
7646
def _generate_filters(
7747
self,
7848
feed_items: [JsonFeedItem]

0 commit comments

Comments
 (0)