Skip to content

Commit 294537f

Browse files
committed
✂️ Ignore final empty output
The last DataReceivedEvent emitted when the process exits contains null data. Ignore it to avoid printing empty log messages.
1 parent ec4ffe3 commit 294537f

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

YoutubeDl.Wpf/Models/BackendInstance.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,12 @@ public BackendInstance(ObservableSettings settings, BackendService backendServic
7070

7171
private void DlOutputHandler(object? sendingProcess, DataReceivedEventArgs outLine)
7272
{
73+
if (outLine.Data is null)
74+
return;
75+
7376
this.Log().Info(outLine.Data);
7477

75-
RxApp.MainThreadScheduler.Schedule(() =>
76-
{
77-
if (!string.IsNullOrEmpty(outLine.Data))
78-
{
79-
ParseDlOutput(outLine.Data);
80-
}
81-
});
78+
RxApp.MainThreadScheduler.Schedule(() => ParseDlOutput(outLine.Data));
8279
}
8380

8481
private void ParseDlOutput(string output)

0 commit comments

Comments
 (0)