From cd49bc9362c0fef2534948d368c8c52460558a77 Mon Sep 17 00:00:00 2001 From: Naz Date: Tue, 29 Jul 2025 16:26:28 +0100 Subject: =?UTF-8?q?=F0=9F=94=A7refactor:=20move=20the=20path=20preparing?= =?UTF-8?q?=20logic=20to=20Downloader?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/downloader.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/downloader.rs b/src/downloader.rs index c40b0b4..2196e25 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -11,6 +11,15 @@ impl Downloader { pub fn new() -> Self { Self {} } + pub fn prepare_path(&self, url: &str, executable: &str) -> PathBuf { + // Try to extract filename from URL or use default + let filename = match url.split('/').next_back() { + Some(name) => name.to_string(), + None => format!("{executable}.AppImage"), + }; + + appimages_dir().join(filename) + } pub async fn download_with_progress( &self, url: &str, -- cgit v1.2.3