fix: Markdown & Text files as default support.

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2025-07-07 22:55:51 -07:00
parent a1742f26de
commit 21fb231683
2 changed files with 4 additions and 5 deletions

View file

@ -138,8 +138,8 @@ async def process_file_in_background(
session: AsyncSession session: AsyncSession
): ):
try: try:
# Check if the file is a markdown file # Check if the file is a markdown or text file
if filename.lower().endswith(('.md', '.markdown')): if filename.lower().endswith(('.md', '.markdown', '.txt')):
# For markdown files, read the content directly # For markdown files, read the content directly
with open(file_path, 'r', encoding='utf-8') as f: with open(file_path, 'r', encoding='utf-8') as f:
markdown_content = f.read() markdown_content = f.read()

View file

@ -48,6 +48,8 @@ export default function FileUploader() {
'audio/mp4': ['.mp4', '.m4a'], 'audio/mp4': ['.mp4', '.m4a'],
'audio/wav': ['.wav'], 'audio/wav': ['.wav'],
'audio/webm': ['.webm'], 'audio/webm': ['.webm'],
'text/markdown': ['.md', '.markdown'],
'text/plain': ['.txt'],
}; };
// Conditionally set accepted file types based on ETL service // Conditionally set accepted file types based on ETL service
@ -82,7 +84,6 @@ export default function FileUploader() {
'application/vnd.oasis.opendocument.graphics': ['.odg'], 'application/vnd.oasis.opendocument.graphics': ['.odg'],
'application/vnd.oasis.opendocument.spreadsheet': ['.ods'], 'application/vnd.oasis.opendocument.spreadsheet': ['.ods'],
'application/vnd.oasis.opendocument.formula': ['.fods'], 'application/vnd.oasis.opendocument.formula': ['.fods'],
'text/plain': ['.txt'],
'text/csv': ['.csv'], 'text/csv': ['.csv'],
'text/tab-separated-values': ['.tsv'], 'text/tab-separated-values': ['.tsv'],
'text/html': ['.html', '.htm', '.web'], 'text/html': ['.html', '.htm', '.web'],
@ -112,7 +113,6 @@ export default function FileUploader() {
'text/html': ['.html'], 'text/html': ['.html'],
'image/jpeg': ['.jpeg', '.jpg'], 'image/jpeg': ['.jpeg', '.jpg'],
'image/png': ['.png'], 'image/png': ['.png'],
'text/markdown': ['.md', '.markdown'],
'application/vnd.ms-outlook': ['.msg'], 'application/vnd.ms-outlook': ['.msg'],
'application/vnd.oasis.opendocument.text': ['.odt'], 'application/vnd.oasis.opendocument.text': ['.odt'],
'text/x-org': ['.org'], 'text/x-org': ['.org'],
@ -123,7 +123,6 @@ export default function FileUploader() {
'text/x-rst': ['.rst'], 'text/x-rst': ['.rst'],
'application/rtf': ['.rtf'], 'application/rtf': ['.rtf'],
'image/tiff': ['.tiff'], 'image/tiff': ['.tiff'],
'text/plain': ['.txt'],
'text/tab-separated-values': ['.tsv'], 'text/tab-separated-values': ['.tsv'],
'application/vnd.ms-excel': ['.xls'], 'application/vnd.ms-excel': ['.xls'],
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['.xlsx'], 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['.xlsx'],