From 0eaa095baeeb511bf8781532b6ecb1c1c39ce313 Mon Sep 17 00:00:00 2001 From: Laurent Date: Tue, 26 May 2026 19:48:07 +0200 Subject: [PATCH] feat: add Search MP3 action to Shazam identification alert Opens freemp3music.org and copies "title artist" to clipboard for quick paste-and-search. --- Music/ContentView.swift | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Music/ContentView.swift b/Music/ContentView.swift index 02e6bdc..215fdaa 100644 --- a/Music/ContentView.swift +++ b/Music/ContentView.swift @@ -257,7 +257,18 @@ struct ContentView: View { get: { shazam.matchedTitle != nil }, set: { if !$0 { shazam.clearResult() } } )) { - Button("OK") { shazam.clearResult() } + Button("Search MP3") { + let query = [shazam.matchedTitle, shazam.matchedArtist] + .compactMap { $0 } + .joined(separator: " ") + NSPasteboard.general.clearContents() + NSPasteboard.general.setString(query, forType: .string) + if let url = URL(string: "https://freemp3music.org/") { + NSWorkspace.shared.open(url) + } + shazam.clearResult() + } + Button("Close", role: .cancel) { shazam.clearResult() } } message: { if let title = shazam.matchedTitle { Text("\(title) — \(shazam.matchedArtist ?? "Unknown Artist")")