feeds/update.py: fix sources which have null
description
This commit is contained in:
@@ -36,7 +36,7 @@ def clean_item(item: dict) -> dict:
|
||||
"url", # used by <hosts/common/feeds.nix> (and many others)
|
||||
"velocity", # used by <hosts/common/feeds.nix>
|
||||
# "version",
|
||||
]
|
||||
] and item[k] is not None
|
||||
}
|
||||
# clean up characters for better printability
|
||||
for k in "title", "site_name", "description":
|
||||
@@ -89,13 +89,13 @@ def main():
|
||||
serialized = [item.serialize() for item in items]
|
||||
serialized = [clean_item(s) for s in serialized]
|
||||
for item in serialized:
|
||||
print(json.dumps(item, sort_keys=True, indent=2))
|
||||
print(json.dumps(item, sort_keys=True, indent=2))
|
||||
|
||||
# save the best feed to disk
|
||||
keep = select_feed(serialized, prefer_podcast=prefer_podcast)
|
||||
results = json.dumps(keep, sort_keys=True, indent=2)
|
||||
with open(json_path, "w") as out:
|
||||
out.write(results)
|
||||
out.write(results)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
Reference in New Issue
Block a user