Fix: Timeline Slider for NowPlaying

This commit is contained in:
Hariharan Mudaliar 2025-08-03 22:10:22 +05:30
commit 022fa187e3
2 changed files with 39 additions and 3 deletions

View file

@ -134,14 +134,16 @@ final class NowPlayingController: ObservableObject, MediaControllerProtocol {
private func setupNowPlayingObserver() {
let process = Process()
guard
let scriptURL = Bundle.main.url(forResource: "mediaremote-adapter", withExtension: "pl"),
let frameworkPath = Bundle.main.privateFrameworksPath?.appending("/MediaRemoteAdapter.framework")
let scriptURL = Bundle.main.url(forResource: "mediaremote-adapter", withExtension: "pl")
else {
print("⚠️ Could not find mediaremote-adapter.pl script or framework path - NowPlaying controller disabled")
print("⚠️ Could not find mediaremote-adapter.pl script - NowPlaying controller disabled")
isResourcesAvailable = false
return
}
let bundlePath = Bundle.main.bundlePath
let frameworkPath = bundlePath + "/Contents/Frameworks/MediaRemoteAdapter.framework"
isResourcesAvailable = true
process.executableURL = URL(fileURLWithPath: "/usr/bin/perl")
process.arguments = [scriptURL.path, frameworkPath, "stream"]