Update: CLI support

This commit is contained in:
Hariharan Mudaliar 2026-04-10 15:17:46 +05:30
commit f9fe2e363d
No known key found for this signature in database
GPG key ID: 025583EB0BE5640E
5 changed files with 29860 additions and 29801 deletions

View file

@ -154,6 +154,29 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidBecomeActive(_ notification: Notification) {
installTopMenuItemsIfNeeded()
}
func application(_ application: NSApplication, open urls: [URL]) {
_ = handleIncomingShelfURLs(urls)
}
func application(_ sender: NSApplication, openFile filename: String) -> Bool {
handleIncomingShelfURLs([URL(fileURLWithPath: filename)])
}
private func handleIncomingShelfURLs(_ urls: [URL]) -> Bool {
let fileURLs = urls.filter(\.isFileURL)
guard !fileURLs.isEmpty else { return false }
Task { @MainActor [weak self] in
let items = await ShelfDropService.items(from: fileURLs)
guard !items.isEmpty else { return }
ShelfStateViewModel.shared.add(items)
self?.coordinator.currentView = .shelf
}
return true
}
/// Setup observers for music player state changes to restart AudioTap capture
private func setupAudioTapMusicObservers() {