mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fixing NYPost feed by ensuring enclosures with href attrbiutes are added to stories even without content. Thanks @kleinmatic!
This commit is contained in:
parent
c756bb6bcf
commit
e1fac42bf1
2 changed files with 3 additions and 2 deletions
|
@ -2615,6 +2615,7 @@ class MStory(mongo.Document):
|
||||||
RE_RS_KEY = re.compile(r"^RS:(\d+):(\d+)$")
|
RE_RS_KEY = re.compile(r"^RS:(\d+):(\d+)$")
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
content = self.story_content_z if self.story_content_z else ""
|
||||||
return f"{self.story_hash}: {self.story_title[:20]} ({len(self.story_content_z)} bytes)"
|
return f"{self.story_hash}: {self.story_title[:20]} ({len(self.story_content_z)} bytes)"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -151,9 +151,9 @@ def pre_process_story(entry, encoding):
|
||||||
|
|
||||||
# Add each media enclosure as a Download link
|
# Add each media enclosure as a Download link
|
||||||
for media_content in chain(entry.get('media_content', [])[:15], entry.get('links', [])[:15]):
|
for media_content in chain(entry.get('media_content', [])[:15], entry.get('links', [])[:15]):
|
||||||
media_url = media_content.get('url', '')
|
media_url = media_content.get('url', media_content.get('href', ''))
|
||||||
media_type = media_content.get('type', media_content.get('medium', ''))
|
media_type = media_content.get('type', media_content.get('medium', ''))
|
||||||
if media_url and media_type and entry['story_content'] and media_url not in entry['story_content']:
|
if media_url and media_type and media_url not in entry['story_content']:
|
||||||
media_type_name = media_type.split('/')[0]
|
media_type_name = media_type.split('/')[0]
|
||||||
if 'audio' in media_type and media_url:
|
if 'audio' in media_type and media_url:
|
||||||
entry['story_content'] += """<br><br>
|
entry['story_content'] += """<br><br>
|
||||||
|
|
Loading…
Add table
Reference in a new issue