aboutsummaryrefslogtreecommitdiff
path: root/stream/src/jhls.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-10-02 08:25:50 +0200
committermetamuffin <metamuffin@disroot.org>2023-10-02 08:25:50 +0200
commitc5a5c8694dd8bcb4fdedb783e8002cd235b4f041 (patch)
tree7262451a151eb3648427b5c16ed5f3532acbc8db /stream/src/jhls.rs
parentd42b49349d9bf7926a321db3ccd320944b3e7831 (diff)
downloadjellything-c5a5c8694dd8bcb4fdedb783e8002cd235b4f041.tar
jellything-c5a5c8694dd8bcb4fdedb783e8002cd235b4f041.tar.bz2
jellything-c5a5c8694dd8bcb4fdedb783e8002cd235b4f041.tar.zst
exclude subtitles in jhls because they break it
Diffstat (limited to 'stream/src/jhls.rs')
-rw-r--r--stream/src/jhls.rs19
1 files changed, 12 insertions, 7 deletions
diff --git a/stream/src/jhls.rs b/stream/src/jhls.rs
index 4488dac..d528c06 100644
--- a/stream/src/jhls.rs
+++ b/stream/src/jhls.rs
@@ -19,17 +19,22 @@ pub async fn jhls_stream(
.tracks
.iter()
.enumerate()
- .map(|(i, t)| {
- let segments = jellyremuxer::snippet::snippet_index(
+ .filter_map(|(i, t)| {
+ if matches!(t.kind, jellycommon::SourceTrackKind::Subtitles) {
+ return None;
+ }
+ match jellyremuxer::snippet::snippet_index(
&CONF.library_path,
&node.public,
&track_sources,
i,
- )?;
- Ok::<_, anyhow::Error>(JhlsTrack {
- info: t.to_owned(),
- segments,
- })
+ ) {
+ Ok(segments) => Some(Ok::<_, anyhow::Error>(JhlsTrack {
+ info: t.to_owned(),
+ segments,
+ })),
+ Err(e) => Some(Err(e)),
+ }
})
.try_collect::<Vec<_>>()
})