Split up librqbit http_api and tracing_subscriber into separate features (#188)

* fix lints that were under features

* Split up some features and fix desktop

* fix github script

* fix github script

* fix github script

* try caching check-desktop
This commit is contained in:
Igor Katson 2024-08-15 18:54:59 +01:00 committed by GitHub
parent 33554159bf
commit 37ee8b70ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 65 additions and 36 deletions

View file

@ -3031,7 +3031,7 @@ dependencies = [
[[package]]
name = "rqbit-desktop"
version = "7.0.0-beta.0"
version = "7.0.0"
dependencies = [
"anyhow",
"base64 0.21.7",
@ -3213,9 +3213,9 @@ dependencies = [
[[package]]
name = "serde"
version = "1.0.207"
version = "1.0.208"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2"
checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2"
dependencies = [
"serde_derive",
]
@ -3234,9 +3234,9 @@ dependencies = [
[[package]]
name = "serde_derive"
version = "1.0.207"
version = "1.0.208"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e"
checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf"
dependencies = [
"proc-macro2",
"quote",

View file

@ -16,7 +16,11 @@ tauri-build = { version = "1.5", features = [] }
tauri = { version = "1.6.7", features = ["shell-open"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
librqbit = { path = "../../crates/librqbit", features = ["webui"] }
librqbit = { path = "../../crates/librqbit", features = [
"tracing-subscriber-utils",
"http-api",
"webui",
] }
tokio = { version = "1.34.0", features = ["rt-multi-thread"] }
anyhow = "1.0.75"
base64 = "0.21.5"

View file

@ -15,8 +15,8 @@ use config::RqbitDesktopConfig;
use http::StatusCode;
use librqbit::{
api::{
ApiAddTorrentResponse, EmptyJsonResponse, TorrentDetailsResponse, TorrentListResponse,
TorrentStats,
ApiAddTorrentResponse, EmptyJsonResponse, TorrentDetailsResponse, TorrentIdOrHash,
TorrentListResponse, TorrentStats,
},
dht::PersistentDhtConfig,
tracing_subscriber_config_utils::{init_logging, InitLoggingOptions, InitLoggingResult},
@ -261,7 +261,7 @@ async fn torrent_create_from_base64_file(
#[tauri::command]
async fn torrent_details(
state: tauri::State<'_, State>,
id: usize,
id: TorrentIdOrHash,
) -> Result<TorrentDetailsResponse, ApiError> {
state.api()?.api_torrent_details(id)
}
@ -269,7 +269,7 @@ async fn torrent_details(
#[tauri::command]
async fn torrent_stats(
state: tauri::State<'_, State>,
id: usize,
id: TorrentIdOrHash,
) -> Result<TorrentStats, ApiError> {
state.api()?.api_stats_v1(id)
}
@ -277,7 +277,7 @@ async fn torrent_stats(
#[tauri::command]
async fn torrent_action_delete(
state: tauri::State<'_, State>,
id: usize,
id: TorrentIdOrHash,
) -> Result<EmptyJsonResponse, ApiError> {
state.api()?.api_torrent_action_delete(id).await
}
@ -285,7 +285,7 @@ async fn torrent_action_delete(
#[tauri::command]
async fn torrent_action_pause(
state: tauri::State<'_, State>,
id: usize,
id: TorrentIdOrHash,
) -> Result<EmptyJsonResponse, ApiError> {
state.api()?.api_torrent_action_pause(id).await
}
@ -293,7 +293,7 @@ async fn torrent_action_pause(
#[tauri::command]
async fn torrent_action_forget(
state: tauri::State<'_, State>,
id: usize,
id: TorrentIdOrHash,
) -> Result<EmptyJsonResponse, ApiError> {
state.api()?.api_torrent_action_forget(id).await
}
@ -301,7 +301,7 @@ async fn torrent_action_forget(
#[tauri::command]
async fn torrent_action_start(
state: tauri::State<'_, State>,
id: usize,
id: TorrentIdOrHash,
) -> Result<EmptyJsonResponse, ApiError> {
state.api()?.api_torrent_action_start(id).await
}
@ -309,7 +309,7 @@ async fn torrent_action_start(
#[tauri::command]
async fn torrent_action_configure(
state: tauri::State<'_, State>,
id: usize,
id: TorrentIdOrHash,
only_files: Vec<usize>,
) -> Result<EmptyJsonResponse, ApiError> {
state