Other changes for Tauri
This commit is contained in:
parent
99db087cf1
commit
fe04e17d63
6 changed files with 16 additions and 23 deletions
|
|
@ -11,6 +11,14 @@ pub struct ApiError {
|
|||
}
|
||||
|
||||
impl ApiError {
|
||||
pub fn new_from_string(status: StatusCode, text: String) -> Self {
|
||||
Self {
|
||||
status: Some(status),
|
||||
kind: ApiErrorKind::Other(anyhow::anyhow!("{}", text)),
|
||||
plaintext: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub const fn torrent_not_found(torrent_id: usize) -> Self {
|
||||
Self {
|
||||
status: Some(StatusCode::NOT_FOUND),
|
||||
|
|
|
|||
|
|
@ -185,10 +185,13 @@ fn compute_only_files<ByteBuf: AsRef<[u8]>>(
|
|||
#[serde_as]
|
||||
#[derive(Default, Clone, Serialize, Deserialize)]
|
||||
pub struct AddTorrentOptions {
|
||||
#[serde(default)]
|
||||
pub paused: bool,
|
||||
pub only_files_regex: Option<String>,
|
||||
pub only_files: Option<Vec<usize>>,
|
||||
#[serde(default)]
|
||||
pub overwrite: bool,
|
||||
#[serde(default)]
|
||||
pub list_only: bool,
|
||||
pub output_folder: Option<String>,
|
||||
pub sub_folder: Option<String>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue