mirror of
https://codeberg.org/diginaut/digimarks.git
synced 2026-09-19 18:39:07 +02:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e822c1311 | ||
|
|
ec47066d41 | ||
|
|
39f4b43b7f |
@@ -69,6 +69,17 @@ my-script = "digimarks:app"
|
||||
[tool.black]
|
||||
line-length = 120
|
||||
|
||||
[tool.pyrefly]
|
||||
# The directory Pyrefly will search for files to type check
|
||||
project-includes = [
|
||||
"src", "tests"
|
||||
]
|
||||
# The directory/directories where Pyrefly looks for imports
|
||||
search-path = [
|
||||
"."
|
||||
]
|
||||
preset = "default"
|
||||
|
||||
[tool.ruff]
|
||||
exclude = [
|
||||
".git",
|
||||
|
||||
@@ -49,7 +49,8 @@ async def set_information_from_source(bookmark: Bookmark, request: Request) -> B
|
||||
if bookmark.http_status == 200 or bookmark.http_status == 202:
|
||||
html_content = bs4.BeautifulSoup(result.text, 'html.parser')
|
||||
try:
|
||||
bookmark.title = html_content.title.text.strip()
|
||||
if html_content.title:
|
||||
bookmark.title = html_content.title.text.strip()
|
||||
except AttributeError as exc:
|
||||
logger.error('Error while trying to extract title from URL %s: %s', str(bookmark.url), str(exc))
|
||||
raise HTTPException(status_code=400, detail='Error while trying to extract title')
|
||||
|
||||
@@ -4,6 +4,7 @@ import logging
|
||||
from collections.abc import Sequence
|
||||
from contextlib import asynccontextmanager
|
||||
from datetime import UTC, datetime
|
||||
from pathlib import Path
|
||||
from typing import Annotated, AsyncGenerator, cast
|
||||
|
||||
import httpx
|
||||
@@ -36,8 +37,8 @@ class Settings(BaseSettings):
|
||||
# inside the codebase
|
||||
# static_dir: DirectoryPath = Path('digimarks/static')
|
||||
# template_dir: DirectoryPath = Path('digimarks/templates')
|
||||
static_dir: DirectoryPath = DirectoryPath('digimarks/static')
|
||||
template_dir: DirectoryPath = DirectoryPath('digimarks/templates')
|
||||
static_dir: DirectoryPath = Path('digimarks/static')
|
||||
template_dir: DirectoryPath = Path('digimarks/templates')
|
||||
|
||||
media_url: str = '/static/'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user