Don't persist source information inside items
This commit is contained in:
parent
535f982c2a
commit
31e63611a4
@ -62,7 +62,6 @@ All encoding is done with UTF-8. If an item cannot be parsed or the exit code of
|
||||
An item has the following top-level fields:
|
||||
|
||||
* `id`: **Required**. A unique identifier within the scope of the feed source.
|
||||
* `source`: **Automatic**. The source that generated the item. This attribute is automatically populated.
|
||||
* `created`: **Automatic**. The Unix timestamp at which the item was generated. This attribute is automatically populated.
|
||||
* `active`: **Automatic**. Whether the item is active. Inactive items are not displayed in channels.
|
||||
* `title`: The title of the item. If an item has no title, `is` is used as a fallback title.
|
||||
|
@ -124,7 +124,7 @@ def _sources_feed(name: str, sources: List[LocalSource], show_hidden: bool):
|
||||
items=paged_items,
|
||||
now=int(time.time()),
|
||||
mdeac=[
|
||||
{"source": item["source"], "itemid": item["id"]}
|
||||
{"source": item.source.source_name, "itemid": item["id"]}
|
||||
for item in paged_items
|
||||
if "id" in item
|
||||
],
|
||||
|
@ -256,7 +256,7 @@ def cmd_feed(cmd_args):
|
||||
created_dt = datetime.fromtimestamp(item["created"])
|
||||
created = created_dt.strftime("%Y-%m-%d %H:%M:%S")
|
||||
info2 = "{0} {1} {2}".format(
|
||||
item.get("source", ""), item.get("id", ""), created
|
||||
item.source.source_name, item.get("id", ""), created
|
||||
)
|
||||
print("| {0:<{1}} |".format(info2, width - 4))
|
||||
print("+" + (width - 2) * "-" + "+")
|
||||
|
@ -42,7 +42,6 @@ class Item:
|
||||
raise KeyError("id")
|
||||
item = {
|
||||
"id": fields["id"],
|
||||
"source": source.source_name,
|
||||
"created": int(current_time()),
|
||||
"active": True,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user