Skip to content

Commit 54d41f6

Browse files
committed
fix(window-recognition): classifyContent 接入 processName 信号(连接 contentClassifier 进程名兜底)
1 parent b7c02b0 commit 54d41f6

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎client/src/features/classroom/hooks/useClassroomCapture.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ export function useClassroomCapture() {
147147
onNotify: notify,
148148
streamingAsrActive,
149149
windowTitle: selectedWindow?.title,
150+
windowProcessName: selectedWindow?.processName,
150151
courseName: courseMeta.courseName,
151152
});
152153

‎client/src/features/classroom/hooks/useClassroomEvents.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ interface UseClassroomEventsOptions {
7171
streamingAsrActive: boolean;
7272
/** P1-6:目标窗口标题(内容类型分类的标题信号) */
7373
windowTitle?: string;
74+
/** P1-6:目标窗口进程名(内容类型分类的进程信号,Windows) */
75+
windowProcessName?: string;
7476
/** P1-3:当前课程名(修正回写词库的 courseId 绑定) */
7577
courseName?: string;
7678
}
@@ -86,7 +88,7 @@ const MISSED_CAPTURE_CHECK_MS = 3000;
8688

8789
export function useClassroomEvents({
8890
captureManager, status, capturePath, language, aiDetectEnabled, setCourseMeta, onNotify,
89-
streamingAsrActive, windowTitle, courseName,
91+
streamingAsrActive, windowTitle, windowProcessName, courseName,
9092
}: UseClassroomEventsOptions) {
9193
const [segments, setSegments] = useState<ExtractedSegment[]>([]);
9294
const [stats, setStats] = useState({ frames: 0, extracted: 0 });
@@ -153,7 +155,7 @@ export function useClassroomEvents({
153155
// 内容分类:未确定时尝试
154156
if (contentKind === 'unknown' && classifyAttemptsRef.current < MAX_CLASSIFY_ATTEMPTS) {
155157
classifyAttemptsRef.current++;
156-
const result = classifyContent(windowTitle ?? '', transcriptSampleRef.current);
158+
const result = classifyContent(windowTitle ?? '', transcriptSampleRef.current, windowProcessName);
157159
if (result.kind !== 'unknown') {
158160
setContentKind(result.kind);
159161
captureManager.applyContentKind(result.kind);

0 commit comments

Comments
 (0)