Update docs, cleanup for 4.0.0 release

This commit is contained in:
Igor Katson 2023-12-03 12:14:50 +00:00
parent 3160f06f65
commit 006d83d6a7
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
29 changed files with 206 additions and 116 deletions

View file

@ -1856,7 +1856,7 @@ dependencies = [
[[package]]
name = "librqbit"
version = "4.0.0-beta.3"
version = "4.0.0"
dependencies = [
"anyhow",
"axum",
@ -1920,7 +1920,7 @@ version = "2.2.1"
[[package]]
name = "librqbit-core"
version = "3.2.0"
version = "3.2.1"
dependencies = [
"anyhow",
"directories",
@ -1939,7 +1939,7 @@ dependencies = [
[[package]]
name = "librqbit-dht"
version = "4.0.0-beta.3"
version = "4.0.0"
dependencies = [
"anyhow",
"backoff",
@ -1963,7 +1963,7 @@ dependencies = [
[[package]]
name = "librqbit-peer-protocol"
version = "3.2.0"
version = "3.2.1"
dependencies = [
"anyhow",
"bincode",

View file

@ -5,11 +5,10 @@ use anyhow::Context;
use http::StatusCode;
use librqbit::{
api::{
Api, ApiAddTorrentResponse, EmptyJsonResponse, TorrentDetailsResponse, TorrentListResponse,
ApiAddTorrentResponse, EmptyJsonResponse, TorrentDetailsResponse, TorrentListResponse,
TorrentStats,
},
api_error::ApiError,
session::AddTorrentOptions,
torrent_state::stats::TorrentStats,
AddTorrent, AddTorrentOptions, Api, ApiError, Session, SessionOptions,
};
struct State {
@ -29,7 +28,7 @@ async fn torrent_create_from_url(
) -> Result<ApiAddTorrentResponse, ApiError> {
state
.api
.api_add_torrent(librqbit::session::AddTorrent::Url(url.into()), opts)
.api_add_torrent(AddTorrent::Url(url.into()), opts)
.await
}
@ -46,10 +45,7 @@ async fn torrent_create_from_base64_file(
.map_err(|e| ApiError::new_from_anyhow(StatusCode::BAD_REQUEST, e))?;
state
.api
.api_add_torrent(
librqbit::session::AddTorrent::TorrentFileBytes(bytes.into()),
opts,
)
.api_add_torrent(AddTorrent::TorrentFileBytes(bytes.into()), opts)
.await
}
@ -110,10 +106,9 @@ async fn start_session() {
.expect("download_dir()")
.to_path_buf();
let s = librqbit::session::Session::new_with_opts(
let session = Session::new_with_opts(
download_folder,
Default::default(),
librqbit::session::SessionOptions {
SessionOptions {
disable_dht: false,
disable_dht_persistence: false,
persistence: true,
@ -123,7 +118,7 @@ async fn start_session() {
.await
.expect("couldn't set up librqbit session");
let api = Api::new(s, None);
let api = Api::new(session, None);
tauri::Builder::default()
.manage(State { api })

View file

@ -6,7 +6,7 @@ import { API } from "./api";
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<StrictMode>
<APIContext.Provider value={API}>
<RqbitWebUI title="Rqbit Desktop v4.0.0-beta.3" />
<RqbitWebUI title="Rqbit Desktop v4.0.0" />
</APIContext.Provider>
</StrictMode>
);