Skip to content

Commit 704f7b5

Browse files
committed
feat: QBittorrentClient::qbittorrent_version method
1 parent 243227e commit 704f7b5

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## UNRELEASED (YYYY-MM-DD)
99

10+
### Added
11+
12+
- `QBittorrentClient::qbittorrent_version` returns the qbittorrent daemon version
13+
1014
## Version 0.2.1 (2025-08-28)
1115

1216
This is a minor release only updating the docs, to specify the qBittorrent API versions supported.

src/qbittorrent/api.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ pub struct QBittorrentClient {
2626
}
2727

2828
impl QBittorrentClient {
29+
/// Returns the qBittorrent version, in a `vX.Y.Z` format.
30+
pub async fn qbittorrent_version(&self) -> Result<String, Error> {
31+
let res = self._get(self._endpoint("app/version")).await?;
32+
let bytes = res.bytes().await.boxed().context(HttpError)?;
33+
Ok(String::from_utf8_lossy(&bytes).to_string())
34+
}
35+
2936
/// Returns the URL to an endpoint without params
3037
pub fn _endpoint(&self, path: &str) -> Url {
3138
Url::parse(&format!("{}/api/v2/{}", self.host, path))

0 commit comments

Comments
 (0)