separate playlist generation

This commit is contained in:
Aaron Manning
2025-09-01 09:42:15 +10:00
parent 07b43ba2dc
commit 2b55c5b0af
4 changed files with 98 additions and 12 deletions

View File

@@ -53,6 +53,14 @@ impl<'a> Specification<'a> {
pub(crate) fn path_from_id(&self, id: &str) -> Option<&path::Path> {
self.files.get(id).map(|v| &**v)
}
pub(crate) fn feed(&self) -> &BTreeMap<chrono::NaiveDateTime, Vec<Episode<'a>>> {
&self.feed
}
pub(crate) fn into_feed_and_files(self) -> (BTreeMap<chrono::NaiveDateTime, Vec<Episode<'a>>>, HashMap<Cow<'a, str>, Cow<'a, path::Path>>) {
(self.feed, self.files)
}
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]