Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Kaset.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
Comment thread
BierDav marked this conversation as resolved.
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.files.bookmarks.app-scope</key>
Expand Down
17 changes: 17 additions & 0 deletions Sources/Kaset/KasetApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct KasetApp: App {
@State private var syncedLyricsService: SyncedLyricsService
@State private var equalizerService = EqualizerService.shared
@State private var settings = SettingsManager.shared
@State private var boringNotchBridge: BoringNotchBridgeService?

/// Triggers search field focus when set to true.
@State private var searchFocusTrigger = false
Expand Down Expand Up @@ -102,6 +103,8 @@ struct KasetApp: App {
scrobblingCoordinator.restoreAuthState()
scrobblingCoordinator.startMonitoring()
_scrobblingCoordinator = State(initialValue: scrobblingCoordinator)
let boringNotchBridge = BoringNotchBridgeService(playerService: player)
_boringNotchBridge = State(initialValue: boringNotchBridge)

// Wire up PlayerService to AppDelegate immediately (not in onAppear)
// This ensures playerService is available for lifecycle events like queue restoration
Expand Down Expand Up @@ -142,6 +145,11 @@ struct KasetApp: App {
self.appDelegate.playerService = self.playerService
// Reference notificationService to keep SwiftUI from deallocating it
_ = self.notificationService
// Start boring.notch bridge if enabled
if self.settings.boringNotchBridgeEnabled {
DiagnosticsLogger.network.info("boring.notch integration enabled at launch; starting bridge")
self.boringNotchBridge?.start()
}
}
.task {
DiagnosticsLogger.app.info("KasetApp: Root task started")
Expand All @@ -167,6 +175,15 @@ struct KasetApp: App {
self.equalizerService.retryStartIfEnabled()
}
}
.onChange(of: self.settings.boringNotchBridgeEnabled) { _, enabled in
if enabled {
DiagnosticsLogger.network.info("boring.notch integration enabled from settings; starting bridge")
self.boringNotchBridge?.start()
} else {
DiagnosticsLogger.network.info("boring.notch integration disabled from settings; stopping bridge")
self.boringNotchBridge?.stop()
}
}
}
}

Expand Down
Loading
Loading