Fix for Google Reader Shared Feeds:
http://lists.planetplanet.org/archives/devel/2011-February/002196.html
This commit is contained in:
parent
fe126bf3ea
commit
70810fff6a
@ -70,6 +70,7 @@ def id(xentry, entry):
|
|||||||
|
|
||||||
if entry.has_key("id") and entry.id:
|
if entry.has_key("id") and entry.id:
|
||||||
entry_id = entry.id
|
entry_id = entry.id
|
||||||
|
if hasattr(entry_id, 'values'): entry_id = entry_id.values()[0]
|
||||||
elif entry.has_key("link") and entry.link:
|
elif entry.has_key("link") and entry.link:
|
||||||
entry_id = entry.link
|
entry_id = entry.link
|
||||||
elif entry.has_key("title") and entry.title:
|
elif entry.has_key("title") and entry.title:
|
||||||
|
@ -176,6 +176,8 @@ def writeCache(feed_uri, feed_info, data):
|
|||||||
# generate an id, if none is present
|
# generate an id, if none is present
|
||||||
if not entry.has_key('id') or not entry.id:
|
if not entry.has_key('id') or not entry.id:
|
||||||
entry['id'] = reconstitute.id(None, entry)
|
entry['id'] = reconstitute.id(None, entry)
|
||||||
|
elif hasattr(entry['id'], 'values'):
|
||||||
|
entry['id'] = entry['id'].values()[0]
|
||||||
if not entry['id']: continue
|
if not entry['id']: continue
|
||||||
|
|
||||||
# determine updated date for purposes of selection
|
# determine updated date for purposes of selection
|
||||||
|
11
tests/data/reconstitute/gr_id.xml
Normal file
11
tests/data/reconstitute/gr_id.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<!--
|
||||||
|
Description: id
|
||||||
|
Expect: id == 'http://example.com/2'
|
||||||
|
-->
|
||||||
|
|
||||||
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||||
|
<entry xmlns:gr="http://www.google.com/schemas/reader/atom/">
|
||||||
|
<id gr:original-id="http://example.com/2">http://example.com/1</id>
|
||||||
|
</entry>
|
||||||
|
</feed>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user