From 850fad62f12b4e764f5e64036db35259237994cb Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 19 Aug 2026 02:45:49 +0200 Subject: fix: Various cron fixes Not saving full URL Not using autocompletion content, just label --- src/copyparty/mod.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/copyparty/mod.rs') diff --git a/src/copyparty/mod.rs b/src/copyparty/mod.rs index 164c9f8..a9f7d01 100644 --- a/src/copyparty/mod.rs +++ b/src/copyparty/mod.rs @@ -158,11 +158,7 @@ impl CopypartyClient { /// if a password is configured. Path can be absolute (e.g. `/music/foo.mp3`) /// or relative (`music/foo.mp3`). pub fn build_url(&self, path: &str) -> String { - let prefixed = if path.starts_with('/') { - format!("{}{}", self.base_url, path) - } else { - format!("{}/{}", self.base_url, path) - }; + let prefixed = self.build_url_no_pw(path); if let Some(pw) = &self.password { format!("{prefixed}?pw={pw}") } else { @@ -170,6 +166,15 @@ impl CopypartyClient { } } + /// Build full URL without the password parameter. + pub fn build_url_no_pw(&self, path: &str) -> String { + if path.starts_with('/') { + format!("{}{}", self.base_url, path) + } else { + format!("{}/{}", self.base_url, path) + } + } + /// Search copyparty via the jPOST `/?srch` endpoint. /// /// Uses `serde_json::Value` for flexible response parsing (mirroring the Python -- cgit v1.2.3