Skip to content

Commit

Permalink
moq-dir: s/group/subgroup/g
Browse files Browse the repository at this point in the history
This may not be what we really want yet, but it seems to match what was
done on the moq-pub side and it builds, so that's a start...
  • Loading branch information
englishm committed Oct 29, 2024
1 parent ec03a79 commit 8cba2a6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions moq-dir/src/listing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use bytes::BytesMut;
use std::collections::{HashSet, VecDeque};

use moq_transport::serve::{
GroupReader, GroupWriter, GroupsReader, GroupsWriter, ServeError, TrackReader, TrackReaderMode, TrackWriter,
SubgroupReader, SubgroupWriter, SubgroupsReader, SubgroupsWriter, ServeError, TrackReader, TrackReaderMode, TrackWriter,
};

pub struct ListingWriter {
track: Option<TrackWriter>,
groups: Option<GroupsWriter>,
group: Option<GroupWriter>,
groups: Option<SubgroupsWriter>,
group: Option<SubgroupWriter>,

current: HashSet<String>,
}
Expand Down Expand Up @@ -60,7 +60,7 @@ impl ListingWriter {
Ok(())
}

fn snapshot(&mut self) -> Result<GroupWriter, ServeError> {
fn snapshot(&mut self) -> Result<SubgroupWriter, ServeError> {
let mut groups = match self.groups.take() {
Some(groups) => groups,
None => self.track.take().unwrap().groups()?,
Expand Down Expand Up @@ -101,8 +101,8 @@ pub struct ListingReader {
track: TrackReader,

// Keep track of the current group.
groups: Option<GroupsReader>,
group: Option<GroupReader>,
groups: Option<SubgroupsReader>,
group: Option<SubgroupReader>,

// The current state of the listing.
current: HashSet<String>,
Expand Down Expand Up @@ -130,7 +130,7 @@ impl ListingReader {

if self.groups.is_none() {
self.groups = match self.track.mode().await? {
TrackReaderMode::Groups(groups) => Some(groups),
TrackReaderMode::Subgroups(groups) => Some(groups),
_ => anyhow::bail!("expected groups mode"),
};
};
Expand Down

0 comments on commit 8cba2a6

Please sign in to comment.