fix: keep MEDIA tokens with punctuation and log web media failures

This commit is contained in:
Peter Steinberger
2025-11-25 06:02:41 +01:00
parent 865abcf1f5
commit 8ea7f9b439
2 changed files with 53 additions and 12 deletions

View File

@@ -1,7 +1,8 @@
// Shared helpers for parsing MEDIA tokens from command/stdout text.
export const MEDIA_LINE_RE = /\bMEDIA:/i;
export const MEDIA_TOKEN_RE = /\bMEDIA:\s*([^\s]+)/i;
// Allow optional wrapping backticks and punctuation after the token; capture the core token.
export const MEDIA_TOKEN_RE = /\bMEDIA:\s*`?([^\s`]+)`?/i;
export function normalizeMediaSource(src: string) {
if (src.startsWith("file://")) return src.replace("file://", "");