kopia lustrzana https://github.com/jointakahe/takahe
Ignore featured posts that aren't dicts
I've seen featured collections that either have URLs to posts, or even a mix of embedded posts and URLs. Whenever I follow one of those post URLs, they don't seem to exist anymore.pull/580/head
rodzic
7b2512bbd3
commit
918cde81ec
|
@ -761,9 +761,13 @@ class Identity(StatorModel):
|
|||
try:
|
||||
data = canonicalise(response.json(), include_security=True)
|
||||
if "orderedItems" in data:
|
||||
return [item["id"] for item in reversed(data["orderedItems"])]
|
||||
return [
|
||||
item["id"]
|
||||
for item in reversed(data["orderedItems"])
|
||||
if isinstance(item, dict)
|
||||
]
|
||||
elif "items" in data:
|
||||
return [item["id"] for item in data["items"]]
|
||||
return [item["id"] for item in data["items"] if isinstance(item, dict)]
|
||||
return []
|
||||
except ValueError:
|
||||
# Some servers return these with a 200 status code!
|
||||
|
|
Ładowanie…
Reference in New Issue