aboutsummaryrefslogtreecommitdiff
path: root/stream/src/jhls.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-12-22 15:16:58 +0100
committermetamuffin <metamuffin@disroot.org>2023-12-22 15:17:23 +0100
commit80e545d06c4a0f0841d4b40e3aff479ef8d864f9 (patch)
tree9a555ea9404f45fb7ebf617ebdfb1f8248332e05 /stream/src/jhls.rs
parentc644f3b2f7b93cba2c903fa2a5e30ea80d86ef13 (diff)
downloadjellything-80e545d06c4a0f0841d4b40e3aff479ef8d864f9.tar
jellything-80e545d06c4a0f0841d4b40e3aff479ef8d864f9.tar.bz2
jellything-80e545d06c4a0f0841d4b40e3aff479ef8d864f9.tar.zst
rework import system pt. 5: local import and playback working again
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(),