Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat(api): add description field to KirvanoLesson and extract from API response

Tonho3551a3200e80
diff --git a/src-tauri/src/platforms/kirvano/api.rs b/src-tauri/src/platforms/kirvano/api.rs
index 076b5d4a..b1edfabc 100644
--- a/src-tauri/src/platforms/kirvano/api.rs
+++ b/src-tauri/src/platforms/kirvano/api.rs
@@ -45,6 +45,7 @@ pub struct KirvanoLesson {
pub order: i64,
pub available: bool,
pub video_url: Option<String>,
+ pub description: Option<String>,
}
fn build_client(token: &str) -> anyhow::Result<reqwest::Client> {
@@ -425,12 +426,20 @@ async fn get_module_lessons(
.and_then(|v| v.as_str())
.map(String::from);
+ let description = item
+ .get("description")
+ .or_else(|| item.get("content"))
+ .and_then(|v| v.as_str())
+ .filter(|s| !s.trim().is_empty())
+ .map(String::from);
+
all_lessons.push(KirvanoLesson {
id: lesson_uuid,
name: lesson_name,
order: lesson_order,
available,
video_url,
+ description,
});
}