fix: project cli commands and case sensitivity when switching projects (#130)

Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
Paul Hernandez
2025-06-11 16:09:53 -05:00
committed by GitHub
parent ac401ea254
commit 3ee30e1f36
6 changed files with 28 additions and 39 deletions
+4 -4
View File
@@ -207,7 +207,7 @@ class ProjectService:
# Get all projects from database
db_projects = await self.repository.get_active_projects()
db_projects_by_name = {p.name: p for p in db_projects}
db_projects_by_permalink = {p.permalink: p for p in db_projects}
# Get all projects from configuration and normalize names if needed
config_projects = config_manager.projects.copy()
@@ -235,7 +235,7 @@ class ProjectService:
# Add projects that exist in config but not in DB
for name, path in config_projects.items():
if name not in db_projects_by_name:
if name not in db_projects_by_permalink:
logger.info(f"Adding project '{name}' to database")
project_data = {
"name": name,
@@ -247,7 +247,7 @@ class ProjectService:
await self.repository.create(project_data)
# Add projects that exist in DB but not in config to config
for name, project in db_projects_by_name.items():
for name, project in db_projects_by_permalink.items():
if name not in config_projects:
logger.info(f"Adding project '{name}' to configuration")
config_manager.add_project(name, project.path)
@@ -668,4 +668,4 @@ class ProjectService:
database_size=db_size_readable,
watch_status=watch_status,
timestamp=datetime.now(),
)
)