fix: additional podcast service updates

This commit is contained in:
ajaysi
2026-04-03 07:00:14 +05:30
parent 63bb937796
commit 92ac410707
3 changed files with 15 additions and 1 deletions

View File

@@ -61,6 +61,17 @@ class PodcastService:
)
).first()
def get_project_by_idea(self, user_id: str, idea: str) -> Optional[PodcastProject]:
"""Find a project by matching idea (case-insensitive, partial match)."""
# Normalize idea for comparison
normalized_idea = idea.strip().lower()
return self.db.query(PodcastProject).filter(
and_(
PodcastProject.user_id == user_id,
PodcastProject.idea.ilike(f"%{normalized_idea}%")
)
).order_by(desc(PodcastProject.updated_at)).first()
def update_project(
self,
user_id: str,