minor refactor, doc fixing
This commit is contained in:
parent
37d7c0eba9
commit
27b339c185
|
|
@ -13,23 +13,8 @@ from pathlib import Path
|
||||||
from typing import Optional, Tuple
|
from typing import Optional, Tuple
|
||||||
import mimetypes
|
import mimetypes
|
||||||
|
|
||||||
|
# Import shared media type definitions from utils to avoid duplication
|
||||||
# Media type detection
|
from backend.utils import MEDIA_EXTENSIONS, get_media_type
|
||||||
MEDIA_EXTENSIONS = {
|
|
||||||
'image': {'.jpg', '.jpeg', '.png', '.gif', '.webp'},
|
|
||||||
'audio': {'.mp3', '.wav', '.ogg', '.m4a'},
|
|
||||||
'video': {'.mp4', '.webm'},
|
|
||||||
'document': {'.pdf'}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def get_media_type(filename: str) -> Optional[str]:
|
|
||||||
"""Determine media type based on file extension."""
|
|
||||||
ext = Path(filename).suffix.lower()
|
|
||||||
for media_type, extensions in MEDIA_EXTENSIONS.items():
|
|
||||||
if ext in extensions:
|
|
||||||
return media_type
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
def get_media_as_base64(media_path: Path) -> Optional[Tuple[str, str]]:
|
def get_media_as_base64(media_path: Path) -> Optional[Tuple[str, str]]:
|
||||||
|
|
|
||||||
|
|
@ -114,8 +114,8 @@ Upload a media file to the `_attachments` directory. Files are automatically org
|
||||||
| Type | Formats | Max Size |
|
| Type | Formats | Max Size |
|
||||||
|------|---------|----------|
|
|------|---------|----------|
|
||||||
| Images | JPG, PNG, GIF, WebP | 10 MB |
|
| Images | JPG, PNG, GIF, WebP | 10 MB |
|
||||||
| Audio | MP3, WAV, OGG | 50 MB |
|
| Audio | MP3, WAV, OGG, M4A | 50 MB |
|
||||||
| Video | MP4, WebM | 100 MB |
|
| Video | MP4, WebM, MOV, AVI | 100 MB |
|
||||||
| Documents | PDF | 20 MB |
|
| Documents | PDF | 20 MB |
|
||||||
|
|
||||||
**Response:**
|
**Response:**
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,11 @@
|
||||||
- **Drag & drop upload** - Drop files from your file system directly into the editor
|
- **Drag & drop upload** - Drop files from your file system directly into the editor
|
||||||
- **Clipboard paste** - Paste images from clipboard with Ctrl+V
|
- **Clipboard paste** - Paste images from clipboard with Ctrl+V
|
||||||
- **Images** - JPG, PNG, GIF, WebP (max 10MB)
|
- **Images** - JPG, PNG, GIF, WebP (max 10MB)
|
||||||
- **Audio** - MP3, WAV, OGG (max 50MB)
|
- **Audio** - MP3, WAV, OGG, M4A (max 50MB)
|
||||||
- **Video** - MP4, WebM (max 100MB)
|
- **Video** - MP4, WebM, MOV, AVI (max 100MB)
|
||||||
- **Documents** - PDF (max 20MB)
|
- **Documents** - PDF (max 20MB)
|
||||||
- **In-app viewing** - View all media types directly in the sidebar
|
- **In-app viewing** - View all media types directly in the sidebar
|
||||||
|
- **Inline preview** - Audio/video players and PDF viewer embedded in notes
|
||||||
|
|
||||||
### Organization
|
### Organization
|
||||||
- **Folder hierarchy** - Organize notes in nested folders
|
- **Folder hierarchy** - Organize notes in nested folders
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue