Kaynağa Gözat

feat: add "Find on Soulseek" context menu to albums and tracks (chunk 4)

Right-click any album or track in the cloud browser to search Soulseek.
Navigates to UnifiedSearchResultsView with "Artist - Title" as query.
Only shown when slskd is configured.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
aldiss 2 ay önce
ebeveyn
işleme
b37509e1db
1 değiştirilmiş dosya ile 30 ekleme ve 0 silme
  1. 30 0
      Sources/Views/CloudBrowserView.swift

+ 30 - 0
Sources/Views/CloudBrowserView.swift

@@ -461,6 +461,16 @@ private struct FilteredAlbumsView: View {
                                 }
                             }
                         }
+
+                        if SlskdAPIClient.shared.isConfigured {
+                            Divider()
+                            Button {
+                                let query = [album.artist, album.title].compactMap { $0 }.joined(separator: " - ")
+                                navStack.append(.search(query: query))
+                            } label: {
+                                Label("Find on Soulseek", systemImage: "magnifyingglass")
+                            }
+                        }
                     }
                     .draggable(album)
                     }
@@ -586,6 +596,16 @@ private struct CategoryDetailView: View {
                                 }
                             }
                         }
+
+                        if SlskdAPIClient.shared.isConfigured {
+                            Divider()
+                            Button {
+                                let query = [album.artist, album.title].compactMap { $0 }.joined(separator: " - ")
+                                navStack.append(.search(query: query))
+                            } label: {
+                                Label("Find on Soulseek", systemImage: "magnifyingglass")
+                            }
+                        }
                     }
                     .draggable(album)
                 }
@@ -868,6 +888,16 @@ private struct AlbumDetailView: View {
                                     }
                                 }
                             }
+
+                            if SlskdAPIClient.shared.isConfigured {
+                                Divider()
+                                Button {
+                                    let query = [track.artist, track.title].compactMap { $0 }.joined(separator: " - ")
+                                    navStack.append(.search(query: query))
+                                } label: {
+                                    Label("Find on Soulseek", systemImage: "magnifyingglass")
+                                }
+                            }
                         }
                     }
                 }