From a0b6fcb73ccd407218b4b677f212566db6fafeec Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Fri, 24 Feb 2023 14:38:05 -0700 Subject: [PATCH] Clean up output for vainfo and ffprobe --- web/src/routes/System.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/src/routes/System.jsx b/web/src/routes/System.jsx index e6b383114..8d7d71c52 100644 --- a/web/src/routes/System.jsx +++ b/web/src/routes/System.jsx @@ -56,7 +56,7 @@ export default function System() { }; const onCopyFfprobe = async () => { - copy(JSON.stringify(state.ffprobe, null, 2)); + copy(JSON.stringify(state.ffprobe, jsonCleaner, 2)); setState({ ...state, ffprobe: '', showFfprobe: false }); }; @@ -75,7 +75,7 @@ export default function System() { }; const onCopyVainfo = async () => { - copy(JSON.stringify(state.vainfo, null, 2)); + copy(JSON.stringify(state.vainfo, jsonCleaner, 2)); setState({ ...state, vainfo: '', showVainfo: false }); }; @@ -298,3 +298,7 @@ export default function System() { ); } + +function jsonCleaner(key, value) { + return value.replace(/[\\n]+/gi, ''); +}