Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
feat(rocketseat): add course search functionality with session validation
Tonhod0daa6f07c97
diff --git a/src-tauri/src/commands/rocketseat.rs b/src-tauri/src/commands/rocketseat.rsindex fb965b46..8c3c4df6 100644--- a/src-tauri/src/commands/rocketseat.rs+++ b/src-tauri/src/commands/rocketseat.rs@@ -169,6 +169,29 @@ pub async fn rocketseat_list_courses(fetch_rocketseat_courses(&state).await}+#[tauri::command]+pub async fn rocketseat_search_courses(+ state: tauri::State<'_, AppState>,+ query: String,+) -> Result<Vec<RocketseatCourse>, String> {+ let guard = state.rocketseat_session.lock().await;+ let session = guard+ .as_ref()+ .ok_or_else(|| "Not authenticated. Please log in first.".to_string())?;++ let courses = api::search_courses(session, &query)+ .await+ .map_err(|e| e.to_string())?;++ let mut cache = state.rocketseat_courses_cache.lock().await;+ *cache = Some(crate::RocketseatCoursesCache {+ courses: courses.clone(),+ fetched_at: Instant::now(),+ });++ Ok(courses)+}+#[tauri::command]pub async fn rocketseat_refresh_courses(state: tauri::State<'_, AppState>,