ipod syncing; updated readme; rust 2024; version bump
This commit is contained in:
@@ -8,8 +8,6 @@ use std::{
|
||||
},
|
||||
};
|
||||
|
||||
use anyhow::Context;
|
||||
|
||||
#[derive(Debug, Default, serde::Serialize, serde::Deserialize)]
|
||||
pub(crate) struct Specification<'a> {
|
||||
files: HashMap<Cow<'a, str>, Cow<'a, path::Path>>,
|
||||
@@ -74,13 +72,11 @@ impl<'a> Specification<'a> {
|
||||
&mut self,
|
||||
id: impl Into<Cow<'a, str>>,
|
||||
path: impl Into<Cow<'a, path::Path>>,
|
||||
) -> anyhow::Result<()> {
|
||||
) -> Option<Cow<'a, path::Path>> {
|
||||
self.files.insert(
|
||||
id.into(),
|
||||
path.into()
|
||||
)
|
||||
.context("insertion of episode with duplicate id")
|
||||
.map(|_| ())
|
||||
}
|
||||
|
||||
pub(crate) fn insert_into_feed(
|
||||
@@ -100,6 +96,15 @@ impl<'a> Specification<'a> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn files_and_feed_mut(
|
||||
&mut self,
|
||||
) -> (
|
||||
&mut BTreeMap<chrono::NaiveDateTime, Vec<Episode<'a>>>,
|
||||
&HashMap<Cow<'a, str>, Cow<'a, path::Path>>,
|
||||
) {
|
||||
(&mut self.feed, &self.files)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize, serde::Deserialize)]
|
||||
|
||||
Reference in New Issue
Block a user