fix podcast re-generation

This commit is contained in:
thierryverse 2025-10-29 22:44:48 +02:00
parent 06f541d600
commit 678d8fbbcd
2 changed files with 22 additions and 22 deletions

View file

@ -141,9 +141,7 @@ async def generate_chat_podcast(
# check if podcast already exists for this chat with the same title (re-generation) # check if podcast already exists for this chat with the same title (re-generation)
existing_podcast = await session.execute( existing_podcast = await session.execute(
select(Podcast).filter( select(Podcast).filter(Podcast.chat_id == chat_id)
Podcast.chat_id == chat_id, Podcast.title == podcast_title
)
) )
existing_podcast = existing_podcast.scalars().first() existing_podcast = existing_podcast.scalars().first()

View file

@ -113,25 +113,27 @@ export function ChatPanelView(props: ChatPanelViewProps) {
</button> </button>
)} )}
</div> </div>
<div {podcast ? (
className={cn( <div
"w-full h-full border-b", className={cn(
!isChatPannelOpen && "flex items-center justify-center p-4" "w-full h-full border-b",
)} !isChatPannelOpen && "flex items-center justify-center p-4"
> )}
{isChatPannelOpen ? ( >
<PodcastPlayer compact podcast={podcast} /> {isChatPannelOpen ? (
) : podcast ? ( <PodcastPlayer compact podcast={podcast} />
<button ) : podcast ? (
title="Play Podcast" <button
type="button" title="Play Podcast"
onClick={() => setIsChatPannelOpen(true)} type="button"
className="p-2 rounded-full hover:bg-muted transition-colors text-green-600 dark:text-green-500" onClick={() => setIsChatPannelOpen(true)}
> className="p-2 rounded-full hover:bg-muted transition-colors text-green-600 dark:text-green-500"
<Play strokeWidth={1} className="h-5 w-5" /> >
</button> <Play strokeWidth={1} className="h-5 w-5" />
) : null} </button>
</div> ) : null}
</div>
) : null}
</div> </div>
); );
} }