HotFix: Now Playing

This commit is contained in:
Hariharan Mudaliar 2026-03-07 20:19:18 +05:30
commit 07c0a7f0ae
No known key found for this signature in database
GPG key ID: 025583EB0BE5640E
2 changed files with 36 additions and 1 deletions

View file

@ -166,6 +166,19 @@ final class NowPlayingController: ObservableObject, MediaControllerProtocol {
let pipeHandler = JSONLinesPipeHandler()
process.standardOutput = await pipeHandler.getPipe()
// Capture stderr so framework/script errors are logged
let stderrPipe = Pipe()
process.standardError = stderrPipe
stderrPipe.fileHandleForReading.readabilityHandler = { handle in
let data = handle.availableData
guard !data.isEmpty,
let message = String(data: data, encoding: .utf8)?
.trimmingCharacters(in: .whitespacesAndNewlines),
!message.isEmpty
else { return }
print("NowPlayingController [stderr]: \(message)")
}
self.process = process
self.pipeHandler = pipeHandler