From c62eb3a2fdaa80f472be6ecbfc2cbf2479d8d914 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 29 Sep 2023 20:56:36 +0200 Subject: move stream generation to new crate --- client/src/lib.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'client/src') diff --git a/client/src/lib.rs b/client/src/lib.rs index a3c61aa..bd9882c 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -4,6 +4,7 @@ Copyright (C) 2023 metamuffin */ use anyhow::Result; +use jc::stream::StreamSpec; use jellycommon::NodePublic; use log::debug; use reqwest::{ @@ -102,17 +103,12 @@ impl Session { Ok(()) } - pub fn stream(&self, id: &str, tracks: &[usize], webm: bool) -> String { + pub fn stream(&self, id: &str, stream_spec: &StreamSpec) -> String { format!( - "{}/n/{}/stream?tracks={}&webm={}&{}", + "{}/n/{}/stream?{}&{}", self.instance.base(), id, - tracks - .iter() - .map(|v| format!("{v}")) - .collect::>() - .join(","), - if webm { "1" } else { "0" }, + todo!(), self.session_param() ) } -- cgit v1.2.3-70-g09d2