diff options
author | metamuffin <metamuffin@disroot.org> | 2024-01-29 15:03:18 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-01-29 15:03:18 +0100 |
commit | c0ba30314a06de10c9b98ac130676dcbc9f287fa (patch) | |
tree | e35631ed3181f89ae962e9125cc5073f12967924 /common | |
parent | 4ad7aa6042c64a6e7cfbe2693a4bbeda0514357b (diff) | |
download | jellything-c0ba30314a06de10c9b98ac130676dcbc9f287fa.tar jellything-c0ba30314a06de10c9b98ac130676dcbc9f287fa.tar.bz2 jellything-c0ba30314a06de10c9b98ac130676dcbc9f287fa.tar.zst |
rename stream spec param
Diffstat (limited to 'common')
-rw-r--r-- | common/src/stream.rs | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/common/src/stream.rs b/common/src/stream.rs index d0b1373..3314cb0 100644 --- a/common/src/stream.rs +++ b/common/src/stream.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "rocket", derive(FromForm, UriDisplayQuery))] pub struct StreamSpec { - pub tracks: Vec<usize>, + pub track: Vec<usize>, pub format: StreamFormat, pub webm: Option<bool>, pub profile: Option<usize>, @@ -36,7 +36,7 @@ pub enum StreamFormat { impl Default for StreamSpec { fn default() -> Self { Self { - tracks: Vec::new(), + track: Vec::new(), format: StreamFormat::Matroska, webm: Some(true), profile: None, @@ -50,18 +50,8 @@ impl StreamSpec { use std::fmt::Write; let mut u = String::new(); write!(u, "format={}", self.format.ident()).unwrap(); - - if !self.tracks.is_empty() { - write!( - u, - "&tracks={}", - self.tracks - .iter() - .map(|s| s.to_string()) - .collect::<Vec<_>>() - .join(",") - ) - .unwrap(); + for t in &self.track { + write!(u, "&track={}", t).unwrap(); } if let Some(profile) = self.profile { write!(u, "&profile={profile}").unwrap(); |