mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-30 06:49:24 +01:00
RSS: Remove use of deprecated property. Closes GH-807.
This commit is contained in:
parent
599f20588c
commit
ab1ac2aa8e
@ -111,10 +111,10 @@ def sort_feed_items(items, order):
|
|||||||
if order == 'newestFirst':
|
if order == 'newestFirst':
|
||||||
reverse = True
|
reverse = True
|
||||||
try:
|
try:
|
||||||
sitems = sorted(items, key=lambda i: i['updated'], reverse=reverse)
|
sitems = sorted(items, key=lambda i: i['published'], reverse=reverse)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# feedparser normalizes required timestamp fields in ATOM and RSS
|
# feedparser normalizes required timestamp fields in ATOM and RSS
|
||||||
# to the "updated" field. Feeds missing it are unsortable by date.
|
# to the "published" field. Feeds missing it are unsortable by date.
|
||||||
return items
|
return items
|
||||||
return sitems
|
return sitems
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ class RSS(callbacks.Plugin):
|
|||||||
self.registryValue(key_name, channel)
|
self.registryValue(key_name, channel)
|
||||||
else:
|
else:
|
||||||
template = self.registryValue(key_name, channel)
|
template = self.registryValue(key_name, channel)
|
||||||
date = entry.get('published_parsed', entry.get('updated_parsed'))
|
date = entry.get('published_parsed')
|
||||||
date = utils.str.timestamp(date)
|
date = utils.str.timestamp(date)
|
||||||
return string.Template(template).safe_substitute(template,
|
return string.Template(template).safe_substitute(template,
|
||||||
feed_name=feed.name,
|
feed_name=feed.name,
|
||||||
|
Loading…
Reference in New Issue
Block a user