aboutsummaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-09-29 21:15:07 +0200
committermetamuffin <metamuffin@disroot.org>2023-09-29 21:15:07 +0200
commit795438f691657c2fdcfe113f933950b63df84271 (patch)
treefba3d1e6d34bb92709282a4826bbbbbd9215ef1e /client
parentc62eb3a2fdaa80f472be6ecbfc2cbf2479d8d914 (diff)
downloadjellything-795438f691657c2fdcfe113f933950b63df84271.tar
jellything-795438f691657c2fdcfe113f933950b63df84271.tar.bz2
jellything-795438f691657c2fdcfe113f933950b63df84271.tar.zst
stream wrapper for remux mkv/webm
Diffstat (limited to 'client')
-rw-r--r--client/src/lib.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/client/src/lib.rs b/client/src/lib.rs
index bd9882c..200c869 100644
--- a/client/src/lib.rs
+++ b/client/src/lib.rs
@@ -4,17 +4,16 @@
Copyright (C) 2023 metamuffin <metamuffin.org>
*/
use anyhow::Result;
-use jc::stream::StreamSpec;
-use jellycommon::NodePublic;
use log::debug;
use reqwest::{
header::{HeaderMap, HeaderValue},
Client,
};
use serde_json::json;
-use std::{io::Write, time::Duration};
+use std::time::Duration;
+use stream::StreamSpec;
-pub use jellycommon as jc;
+pub use jellycommon::*;
#[derive(Debug, Clone)]
pub struct Instance {
@@ -90,7 +89,12 @@ impl Session {
}
// TODO use AssetRole instead of str
- pub async fn node_asset(&self, id: &str, role: &str, mut writer: impl Write) -> Result<()> {
+ pub async fn node_asset(
+ &self,
+ id: &str,
+ role: &str,
+ mut writer: impl std::io::Write,
+ ) -> Result<()> {
debug!("downloading asset {role:?} for {id:?}");
let mut r = self
.client
@@ -108,7 +112,7 @@ impl Session {
"{}/n/{}/stream?{}&{}",
self.instance.base(),
id,
- todo!(),
+ stream_spec.to_query(),
self.session_param()
)
}