Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ disabled_rules:
- trailing_comma
- line_length
- opening_brace # Allow SwiftFormat's multi-line condition style
- no_dispatch_queue # NWListener and NWConnection require DispatchQueue for thread safety

opt_in_rules:
- closure_spacing
Expand Down
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 @@ -40,6 +40,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?
@State private var podcastsAvailabilityService = PodcastsAvailabilityService()

/// Triggers search field focus when set to true.
Expand Down Expand Up @@ -104,6 +105,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 @@ -146,6 +149,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 @@ -171,6 +179,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