diff options
author | metamuffin <metamuffin@disroot.org> | 2023-12-22 23:57:03 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-12-22 23:57:03 +0100 |
commit | 75949cebdd61dd8f0d06f2e47081c460e2a442f0 (patch) | |
tree | ea0fc2ff003b7694ee06555d731bce1f08199136 /client/src | |
parent | c4682c231cbfa2bd4b44e14548800a64cc9cdbb8 (diff) | |
download | jellything-75949cebdd61dd8f0d06f2e47081c460e2a442f0.tar jellything-75949cebdd61dd8f0d06f2e47081c460e2a442f0.tar.bz2 jellything-75949cebdd61dd8f0d06f2e47081c460e2a442f0.tar.zst |
rework import system pt. 8: federated streams & change jhls
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/lib.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/client/src/lib.rs b/client/src/lib.rs index 96349ed..f88ecc5 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -4,14 +4,12 @@ Copyright (C) 2023 metamuffin <metamuffin.org> */ use anyhow::Result; -use jellycommon::user::UserPermission; +use jellycommon::user::CreateSessionParams; use log::{debug, info}; use reqwest::{ header::{HeaderMap, HeaderValue}, Client, }; -use serde::Serialize; -use std::collections::HashSet; use stream::StreamSpec; use tokio::io::AsyncWriteExt; @@ -23,14 +21,6 @@ pub struct Instance { pub tls: bool, } -#[derive(Serialize)] -pub struct LoginDetails { - pub username: String, - pub password: String, - pub expire: Option<i64>, - pub drop_permissions: Option<HashSet<UserPermission>>, -} - impl Instance { pub fn new(host: String, tls: bool) -> Self { Self { host, tls } @@ -42,7 +32,7 @@ impl Instance { self.host ) } - pub async fn login(self, data: LoginDetails) -> anyhow::Result<Session> { + pub async fn login(self, data: CreateSessionParams) -> anyhow::Result<Session> { let session_token = Client::builder() .build()? .post(format!("{}/api/create_session", self.base())) |