Session persistence rewritten completely

This commit is contained in:
Igor Katson 2024-08-15 10:40:48 +01:00
parent c4fc107c4e
commit 83592ca866
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
12 changed files with 431 additions and 299 deletions

View file

@ -114,16 +114,18 @@ impl Api {
Ok(Default::default())
}
pub fn api_torrent_action_forget(&self, idx: TorrentId) -> Result<EmptyJsonResponse> {
pub async fn api_torrent_action_forget(&self, idx: TorrentId) -> Result<EmptyJsonResponse> {
self.session
.delete(idx, false)
.await
.context("error forgetting torrent")?;
Ok(Default::default())
}
pub fn api_torrent_action_delete(&self, idx: TorrentId) -> Result<EmptyJsonResponse> {
pub async fn api_torrent_action_delete(&self, idx: TorrentId) -> Result<EmptyJsonResponse> {
self.session
.delete(idx, true)
.await
.context("error deleting torrent with files")?;
Ok(Default::default())
}