aboutsummaryrefslogtreecommitdiff
path: root/stream/src/jhls.rs
diff options
context:
space:
mode:
Diffstat (limited to 'stream/src/jhls.rs')
-rw-r--r--stream/src/jhls.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/stream/src/jhls.rs b/stream/src/jhls.rs
index 5fe2cab..600d945 100644
--- a/stream/src/jhls.rs
+++ b/stream/src/jhls.rs
@@ -3,23 +3,24 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2023 metamuffin <metamuffin.org>
*/
-use anyhow::Result;
+use anyhow::{anyhow, Result};
use jellybase::{permission::PermissionSetExt, CONF};
use jellycommon::{
jhls::{JhlsMetadata, JhlsTrack},
stream::StreamSpec,
user::{PermissionSet, UserPermission},
- LocalTrack, Node,
+ Node, TrackSource,
};
use tokio::io::{AsyncWriteExt, DuplexStream};
pub async fn jhls_stream(
node: Node,
- track_sources: Vec<LocalTrack>,
+ track_sources: &[TrackSource],
_spec: StreamSpec,
mut b: DuplexStream,
perms: &PermissionSet,
) -> Result<()> {
+ let track_sources = track_sources.to_vec();
let media = node.public.media.clone().unwrap();
let tracks = tokio::task::spawn_blocking(move || {
media
@@ -38,8 +39,10 @@ pub async fn jhls_stream(
match jellyremuxer::snippet::snippet_index(
&CONF.library_path,
&node.public,
- &track_sources,
- i,
+ match &track_sources[i] {
+ TrackSource::Local(x) => x,
+ TrackSource::Remote => return Some(Err(anyhow!("das geht nicht"))),
+ },
) {
Ok(segments) => Some(Ok::<_, anyhow::Error>(JhlsTrack {
info: t.to_owned(),