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
refactor(backend): rename telegram archiver folder to LibreGram and clean test fixtures
IGECT66c0e62a3497
diff --git a/src-tauri/libreget-core/src/core/tools/ctf/xor.rs b/src-tauri/libreget-core/src/core/tools/ctf/xor.rsindex f9767d56..80edb3e7 100644--- a/src-tauri/libreget-core/src/core/tools/ctf/xor.rs+++ b/src-tauri/libreget-core/src/core/tools/ctf/xor.rs@@ -211,9 +211,9 @@ mod tests {fn repeating_key_is_recovered() {let plain = "the quick brown fox jumps over the lazy dog while the cat sleeps \under the warm sun and nothing else happens in this small town today";- let enc = xor(plain.as_bytes(), b"omni");+ let enc = xor(plain.as_bytes(), b"rust");let best = break_repeating(&enc, 12).unwrap();- assert_eq!(best.key, "omni", "chave achada: {:?}", best.key);+ assert_eq!(best.key, "rust", "chave achada: {:?}", best.key);assert_eq!(best.text, plain);}diff --git a/src-tauri/libreget-core/src/core/tools/exif.rs b/src-tauri/libreget-core/src/core/tools/exif.rsindex e48c636d..fdf8402f 100644--- a/src-tauri/libreget-core/src/core/tools/exif.rs+++ b/src-tauri/libreget-core/src/core/tools/exif.rs@@ -527,7 +527,7 @@ mod tests {entry(&mut t, 0x8825, 4, 1, GPS_IFD_AT.to_le_bytes());t.extend_from_slice(&0u32.to_le_bytes());assert_eq!(t.len(), MAKE_AT as usize);- t.extend_from_slice(b"OmniG\0");+ t.extend_from_slice(b"LibrG\0");t.extend_from_slice(b"Test\0");while t.len() < GPS_IFD_AT as usize {t.push(0);@@ -571,7 +571,7 @@ mod tests {let r = read(&p);assert!(r.error.is_none(), "erro na leitura: {:?}", r.error);assert!(r.has_exif);- assert_eq!(r.camera.as_deref(), Some("OmniG Test"));+ assert_eq!(r.camera.as_deref(), Some("LibrG Test"));let (lat, lon) = r.gps.expect("não achou o GPS");assert!((lat + 23.55).abs() < 1e-6, "latitude: {}", lat);assert!((lon + 46.6333333).abs() < 1e-5, "longitude: {}", lon);diff --git a/src-tauri/libreget-core/src/platforms/bilibili/legacy.rs b/src-tauri/libreget-core/src/platforms/bilibili/legacy.rsindex 2d7f2e62..bfe86695 100644--- a/src-tauri/libreget-core/src/platforms/bilibili/legacy.rs+++ b/src-tauri/libreget-core/src/platforms/bilibili/legacy.rs@@ -374,7 +374,7 @@ mod tests {));}- // Issue #311: the collection page listed its videos in the omnibox but the+ // Issue #311: the collection page listed its videos in the librebox but the// download went down the single-video path and failed on the listing page.#[test]fn modern_collection_link_is_playlist() {diff --git a/src-tauri/plugins/telegram/src/commands/telegram.rs b/src-tauri/plugins/telegram/src/commands/telegram.rsindex a9b40a93..8701a6a9 100644--- a/src-tauri/plugins/telegram/src/commands/telegram.rs+++ b/src-tauri/plugins/telegram/src/commands/telegram.rs@@ -208,24 +208,24 @@ pub fn resolve_telegram_download_dir(chat_title: Option<&str>,) -> std::path::PathBuf {let base = std::path::PathBuf::from(base_dir);- let is_already_omnigram = base+ let is_already_folder = base.file_name().and_then(|n| n.to_str())- .map(|n| n.eq_ignore_ascii_case("OmniGram"))+ .map(|n| n.eq_ignore_ascii_case("LibreGram") || n.eq_ignore_ascii_case("OmniGram")).unwrap_or(false);- let omnigram_root = if is_already_omnigram {+ let libregram_root = if is_already_folder {base} else {- base.join("OmniGram")+ base.join("LibreGram")};match chat_title {Some(title) if !title.trim().is_empty() => {let clean = sanitize_folder_name(title);- omnigram_root.join(clean)+ libregram_root.join(clean)}- _ => omnigram_root,+ _ => libregram_root,}}@@ -1311,13 +1311,13 @@ mod tests {}#[test]- fn test_resolve_telegram_download_dir_creates_omnigram_and_channel_folder() {+ fn test_resolve_telegram_download_dir_creates_libregram_and_channel_folder() {let base = "C:/Users/mint/Downloads";let dir = resolve_telegram_download_dir(base, Some("Evelina Ava"));assert_eq!(dir,PathBuf::from("C:/Users/mint/Downloads")- .join("OmniGram")+ .join("LibreGram").join("Evelina Ava"));@@ -1325,17 +1325,24 @@ mod tests {assert_eq!(dir2,PathBuf::from("C:/Users/mint/Downloads")- .join("OmniGram")+ .join("LibreGram").join("Ivana"));}#[test]- fn test_resolve_telegram_download_dir_when_base_already_omnigram() {- let base = "C:/Users/mint/Downloads/OmniGram";+ fn test_resolve_telegram_download_dir_when_base_already_libregram_or_legacy() {+ let base = "C:/Users/mint/Downloads/LibreGram";let dir = resolve_telegram_download_dir(base, Some("Evelina Ava"));assert_eq!(dir,+ PathBuf::from("C:/Users/mint/Downloads/LibreGram").join("Evelina Ava")+ );++ let legacy_base = "C:/Users/mint/Downloads/OmniGram";+ let dir_legacy = resolve_telegram_download_dir(legacy_base, Some("Evelina Ava"));+ assert_eq!(+ dir_legacy,PathBuf::from("C:/Users/mint/Downloads/OmniGram").join("Evelina Ava"));}@@ -1346,13 +1353,13 @@ mod tests {let dir = resolve_telegram_download_dir(base, None);assert_eq!(dir,- PathBuf::from("C:/Users/mint/Downloads").join("OmniGram")+ PathBuf::from("C:/Users/mint/Downloads").join("LibreGram"));let dir2 = resolve_telegram_download_dir(base, Some(" "));assert_eq!(dir2,- PathBuf::from("C:/Users/mint/Downloads").join("OmniGram")+ PathBuf::from("C:/Users/mint/Downloads").join("LibreGram"));}}diff --git a/src-tauri/src/core/queue.rs b/src-tauri/src/core/queue.rsindex 2eb6fec3..ae62c34f 100644--- a/src-tauri/src/core/queue.rs+++ b/src-tauri/src/core/queue.rs@@ -286,7 +286,7 @@ pub struct DownloadQueue {pub stagger_delay_ms: u64,pub default_max_retries: u32,/// Ultimo id entregue por `next_available_id`. Sem ele, dois `download_from_url`- /// simultaneos (um lote colado na omnibox dispara todos de uma vez) pegam o+ /// simultaneos (um lote colado na librebox dispara todos de uma vez) pegam o/// mesmo timestamp em ms, soltam o lock para resolver o downloader e so depois/// enfileiram — os dois entram com o mesmo id. Como todo o resto da fila acha/// o item por `find(|i| i.id == id)`, o segundo item some: baixa o primeiro