Skip to content

Commit

Permalink
πŸ’„ Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario-SO authored Jan 29, 2025
2 parents eb99958 + be84b14 commit 26dcd95
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const TrimmControls = ({
blocked: boolean;
}) => {
const { startTime, endTime, handleMouseDown } = useTrimmControlsContext();
const { videoDuration, timelineWidth, pixelsPerSecond } =
const { videoDuration, timelineWidth, pixelsPerSecond, isPreviewMode } =
useTimelineContext();
const { calculatePositionOnTimeline } = useTimeline();

Expand All @@ -39,7 +39,7 @@ const TrimmControls = ({
: 'rounded-l-xl'
} `}
style={{
background: 'rgba(200, 75, 80, 1)',
background: isPreviewMode ? 'rgba(255, 191, 0, 1)' : 'rgba(200, 75, 80, 1)',
}}
/>
</div>
Expand All @@ -49,7 +49,7 @@ const TrimmControls = ({

export const TrimmOverlay = () => {
const { startTime, endTime } = useTrimmControlsContext();
const { videoDuration, timelineWidth } = useTimelineContext();
const { videoDuration, timelineWidth, isPreviewMode } = useTimelineContext();
const { calculatePositionOnTimeline } = useTimeline();

const startPosition = calculatePositionOnTimeline(
Expand All @@ -67,7 +67,7 @@ export const TrimmOverlay = () => {
<div
className="absolute flex rounded-xl h-[calc(100%-20px)] top-6"
style={{
background: 'rgba(200, 75, 80, 0.4)',
background: isPreviewMode ? 'rgba(255, 191, 0, 0.35)' : 'rgba(200, 75, 80, 0.4)',
left: `${startPosition}px`,
width: `${endPosition - startPosition}px`,
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Transcripts = ({
console.log('transcribe', transcribe, transcribeStatus);
if (transcribe?.length === 0) {
return (
<div className="flex flex-col h-full overflow-y-scroll">
<div className="flex flex-col h-full">
<div className="flex flex-col space-y-4 text-center items-center justify-center h-full">
<p className="text-lg font-semibold">No transcript available</p>
<p className="text-md text-muted-foreground">
Expand All @@ -40,7 +40,7 @@ const Transcripts = ({
}

return (
<div className="flex flex-col h-full overflow-y-scroll">
<div className="flex flex-col h-full">
<TranscriptText transcribe={transcribe} />
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default function Sidebar({
</TabsContent>
<TabsContent
value="transcribe"
className="flex-grow overflow-hidden h-full p-4"
className="flex-grow overflow-y-auto h-full p-4"
>
<Transcripts
transcribe={transcribe}
Expand Down
52 changes: 27 additions & 25 deletions packages/app/app/studio/[organization]/(root)/team/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Settings = async ({

return (
<div className="p-4 flex h-full w-full max-w-4xl">
<Card className="w-full h-full rounded-r-xl border bg-white shadow-none md:p-0">
<Card className="w-full h-full rounded-r-xl border bg-white shadow-none md:p-0 flex flex-col">
<CardHeader className="flex flex-row justify-between">
<div className="flex flex-col gap-2">
<CardTitle>Team members</CardTitle>
Expand All @@ -55,31 +55,33 @@ const Settings = async ({
<AddTeamMembers organizationId={organization._id} />
</div>
</CardHeader>
<CardContent className="p-0 md:p-0 lg:p-0">
<Table className="w-full">
<TableHeader className="sticky top-0 z-10 border-separate bg-gray-100">
<TableRow className="hover:bg-whiterounded-t-xl border-b">
<TableHead>Email</TableHead>
<TableHead>Role</TableHead>
<TableHead>Actions</TableHead>
</TableRow>
</TableHeader>
<TableBody>
{members?.map(({ _id, email, role }) => (
<TableRow key={_id}>
<TableCell>{email}</TableCell>
<TableCell>{role}</TableCell>

<TableCell>
<DeleteTeamMember
memberEmail={email as string}
organizationId={organization._id}
/>
</TableCell>
<CardContent className="p-0 md:p-0 lg:p-0 flex-1 overflow-auto">
<div className="h-full overflow-auto">
<Table className="w-full">
<TableHeader className="sticky top-0 z-10 border-separate bg-gray-100">
<TableRow className="hover:bg-whiterounded-t-xl border-b">
<TableHead>Email</TableHead>
<TableHead>Role</TableHead>
<TableHead>Actions</TableHead>
</TableRow>
))}
</TableBody>
</Table>
</TableHeader>
<TableBody>
{members?.map(({ _id, email, role }) => (
<TableRow key={_id}>
<TableCell>{email}</TableCell>
<TableCell>{role}</TableCell>

<TableCell>
<DeleteTeamMember
memberEmail={email as string}
organizationId={organization._id}
/>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</div>
</CardContent>
</Card>
</div>
Expand Down
14 changes: 12 additions & 2 deletions packages/server/src/controllers/index.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,21 @@ export class IndexController extends Controller {
break;

case LivepeerEvent.streamStarted:
console.log('πŸŽ₯ Stream started event received:', {
streamId: payload.stream?.id,
status: payload.stream?.status,
isActive: payload.stream?.isActive,
isHealthy: payload.stream?.isHealthy
});
await this.stageService.findStreamAndUpdate(payload.stream.id);
break;

case LivepeerEvent.streamIdle:
console.log('πŸŽ₯ Stream event received:', {
event: payload.event,
console.log('πŸŽ₯ Stream idle event received:', {
streamId: payload.stream?.id,
status: payload.stream?.status,
isActive: payload.stream?.isActive,
isHealthy: payload.stream?.isHealthy,
});
await this.stageService.findStreamAndUpdate(payload.stream.id);
break;
Expand Down
15 changes: 9 additions & 6 deletions packages/server/src/services/stage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,17 @@ export default class StageService {
const stream = await getStreamInfo(id);
let stage = await Stage.findOne({ 'streamSettings.streamId': id });
if (!stage) throw new HttpException(400, 'stage not found');
// send message to redis
const queue = await stageTranscriptionsQueue();
await queue.add({
stageId: stage._id,
});

if (!stream.isActive) {
const queue = await stageTranscriptionsQueue();
await queue.add({
stageId: stage._id,
});
}

await stage.updateOne(
{
'stageSettings.transcripts.status': 'in-queue',
'stageSettings.transcripts.status': !stream.isActive ? 'in-queue' : undefined,
'streamSettings.isActive': stream.isActive,
'streamSettings.isHealthy': stream.isHealthy ?? false,
},
Expand Down

0 comments on commit 26dcd95

Please sign in to comment.