This commit is contained in:
parent
533cf96dce
commit
f50bac65ad
1 changed files with 8 additions and 2 deletions
10
handlers.py
10
handlers.py
|
|
@ -364,7 +364,8 @@ def handle_add_form(msg="", action_type="index"):
|
|||
f'{_csrf_field()}'
|
||||
f'<input name="url" placeholder="https://example.com" size="50"><br><br>'
|
||||
f'<input name="note" placeholder="why are you saving this? (optional)" size="50"><br><br>'
|
||||
f'<input name="tags" placeholder="tags (comma-separated, e.g. solarpunk, mesh)" size="50"><br><br>'
|
||||
f'<input name="tags" placeholder="tags (comma-separated, e.g. solarpunk, mesh)" size="50"><br>'
|
||||
f'<small>tag: private to exclude from sharing</small><br><br>'
|
||||
f'<button type="submit">index</button>'
|
||||
f"</form>"
|
||||
f"<p>{msg}</p>"
|
||||
|
|
@ -974,6 +975,8 @@ def handle_api_sites(query=None):
|
|||
sites = []
|
||||
for r in rows:
|
||||
tags = _get_page_tags(r["id"], db)
|
||||
if "private" in tags:
|
||||
continue # Skip pages tagged private from sharing
|
||||
sites.append({
|
||||
"url": r["url"], "title": r["title"], "note": r["note"],
|
||||
"tags": tags, "last_modified": r["last_modified"] or "",
|
||||
|
|
@ -981,7 +984,10 @@ def handle_api_sites(query=None):
|
|||
# Include list of all current URLs so subscriber can detect deletions (limited)
|
||||
all_urls = None
|
||||
if not since:
|
||||
all_urls = [r["url"] for r in db.execute("SELECT url FROM pages LIMIT ?", (MAX_API_SITES,)).fetchall()]
|
||||
all_url_rows = db.execute(
|
||||
"SELECT p.id, p.url FROM pages ORDER BY id DESC LIMIT ?", (MAX_API_SITES,)
|
||||
).fetchall()
|
||||
all_urls = [r["url"] for r in all_url_rows if "private" not in _get_page_tags(r["id"], db)]
|
||||
finally:
|
||||
return_db(db)
|
||||
data = {"name": get_site_name(), "sites": sites}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue