Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: address djpetti's review comments

LearningCircuit41eaa1197609
diff --git a/src/local_deep_research/research_library/utils/__init__.py b/src/local_deep_research/research_library/utils/__init__.py
index a6ba7d2279..62fe349ac2 100644
--- a/src/local_deep_research/research_library/utils/__init__.py
+++ b/src/local_deep_research/research_library/utils/__init__.py
@@ -25,6 +25,7 @@ def get_url_hash(url: str) -> str:
def get_library_storage_path(username: str) -> Path:
"""
Get the storage path for a user's library.
+ Uses settings for base path, but always includes username subdirectory for isolation.
Args:
username: The username
@@ -32,9 +33,19 @@ def get_library_storage_path(username: str) -> Path:
Returns:
Path to the user's library storage directory
"""
- base_dir = (
- Path.home() / "Documents" / "LocalDeepResearch" / "Library" / username
- )
+ from ...utilities.db_utils import get_settings_manager
+
+ settings = get_settings_manager()
+ base_path = Path(
+ settings.get_setting(
+ "research_library.storage_path",
+ str(Path.home() / "Documents" / "LocalDeepResearch" / "Library"),
+ )
+ ).expanduser()
+
+ # IMPORTANT: Add username subdirectory for user isolation
+ # This prevents users from accessing/overwriting each other's files
+ base_dir = base_path / username
base_dir.mkdir(parents=True, exist_ok=True)
return base_dir
@@ -54,9 +65,19 @@ def open_file_location(file_path: str) -> bool:
if sys.platform == "win32":
os.startfile(folder)
elif sys.platform == "darwin": # macOS
- subprocess.run(["open", folder])
+ result = subprocess.run(
+ ["open", folder], capture_output=True, text=True
+ )
+ if result.returncode != 0:
+ logger.error(f"Failed to open folder on macOS: {result.stderr}")
+ return False
else: # Linux
- subprocess.run(["xdg-open", folder])
+ result = subprocess.run(
+ ["xdg-open", folder], capture_output=True, text=True
+ )
+ if result.returncode != 0:
+ logger.error(f"Failed to open folder on Linux: {result.stderr}")
+ return False
return True
except Exception:
logger.exception("Failed to open file location")