Update previous links

This commit is contained in:
2026-08-26 16:22:19 +02:00
parent 6772bf7107
commit 01a4ed42bd
12 changed files with 129 additions and 7 deletions
+14
View File
@@ -109,6 +109,20 @@ def create_link(
return record
def find_owned_link_by_title_url(user_id: str, title: str, url: str) -> dict | None:
cleaned_url = clean_url(url)
with get_connection() as conn:
row = conn.execute(
'SELECT * FROM links WHERE user_id = ? AND title = ? AND url = ? ORDER BY created_at DESC LIMIT 1',
(user_id, title, cleaned_url),
).fetchone()
if row is None:
return None
record = dict(row)
record['tags'] = get_link_tags(conn, record['id'])
return record
def list_public_links(username: str | None = None):
with get_connection() as conn:
rows = conn.execute(