New Entry page improvements on link detection
This commit is contained in:
@@ -123,6 +123,19 @@ def find_owned_link_by_title_url(user_id: str, title: str, url: str) -> dict | N
|
||||
return record
|
||||
|
||||
|
||||
def find_owned_link_by_title(user_id: str, title: str) -> dict | None:
|
||||
with get_connection() as conn:
|
||||
row = conn.execute(
|
||||
'SELECT * FROM links WHERE user_id = ? AND title = ? ORDER BY created_at DESC LIMIT 1',
|
||||
(user_id, title),
|
||||
).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(
|
||||
|
||||
Reference in New Issue
Block a user