chore: refactor to support multi search

This commit is contained in:
Michel de Graaf
2025-11-13 10:28:16 +01:00
parent 4a34583f9c
commit cafa40a09d
7 changed files with 70 additions and 33 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ fn search_and_download(config: SearchConfig) -> Result<()> {
cancel_flag.store(true, std::sync::atomic::Ordering::Relaxed);
// Get final results
let results = client.get_search_results();
let results = client.get_search_results(&config.query);
if selected_indices.is_empty() {
ratatui::restore();
+4 -2
View File
@@ -91,7 +91,8 @@ impl FileSelector {
// Poll for new search results if active
if self.search_active {
if let Some(ref client) = self.client {
let current_count = client.get_search_results_count();
let current_count =
client.get_search_results_count(&self.soulseek_query);
if current_count != self.last_result_count {
self.update_results_from_client();
self.last_result_count = current_count;
@@ -124,7 +125,8 @@ impl FileSelector {
fn update_results_from_client(&mut self) {
if let Some(ref client) = self.client {
let search_results = client.get_search_results();
let search_results =
client.get_search_results(&self.soulseek_query);
// Convert search results to FileDisplayData
let mut new_items = Vec::new();