Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ backend/app/media/*
# LLM提供的问题解决方案
solutions/
tmp/
htmlcov #测试报告
.claude/
openai.json
scripts/dev.sh
Binary file modified backend/.coverage
Binary file not shown.
1 change: 1 addition & 0 deletions backend/app/api/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@

api_router.include_router(library.router, prefix="/library", tags=["library"])


Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace should be removed from this line to maintain code cleanliness and adhere to standard formatting practices.

Copilot uses AI. Check for mistakes.
2 changes: 2 additions & 0 deletions backend/app/api/v1/endpoints/papers.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ async def upload_paper(

original_display_name = normalize_original_filename(file.filename)
storage_candidate = sanitize_storage_filename(original_display_name)
# Ensure the upload directory exists even if MEDIA_ROOT is cleaned between tests.
UPLOAD_DIR.mkdir(parents=True, exist_ok=True)
Comment on lines +176 to +177
Copy link

Copilot AI Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While creating the upload directory is necessary for tests, this change adds runtime overhead to every upload operation. The directory should already exist in production environments, so this check is only needed for test scenarios. Consider moving this directory creation to the test setup (conftest.py) or application startup code rather than executing it on every upload request. This would improve performance and separate test-specific concerns from production code.

Copilot uses AI. Check for mistakes.
stored_filename, destination = ensure_unique_storage_name(UPLOAD_DIR, storage_candidate)

await asyncio.to_thread(destination.write_bytes, cleaned_bytes)
Expand Down
Loading
Loading