mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 01:26:43 +01:00
start defining update tasks
This commit is contained in:
parent
a38d103d7d
commit
b2ed389edd
2 changed files with 24 additions and 0 deletions
|
|
@ -3,7 +3,9 @@ use crate::*;
|
|||
mod column; pub use self::column::*;
|
||||
mod entry; pub use self::entry::*;
|
||||
mod metadata; pub use self::metadata::*;
|
||||
mod task; pub use self::task::*;
|
||||
|
||||
/// The application state.
|
||||
pub struct Taggart {
|
||||
pub _root: PathBuf,
|
||||
pub entries: Vec<Entry>,
|
||||
|
|
@ -13,6 +15,7 @@ pub struct Taggart {
|
|||
pub columns: Columns<Entry, fn(&Entry)->Option<Arc<str>>, fn(&mut [Entry], usize, &str)>,
|
||||
pub display: Measure<TuiOut>,
|
||||
pub editing: Option<(usize, String)>,
|
||||
pub tasks: Vec<Task>,
|
||||
}
|
||||
|
||||
impl Taggart {
|
||||
|
|
@ -25,6 +28,7 @@ impl Taggart {
|
|||
display: Measure::new(),
|
||||
editing: None,
|
||||
columns: Columns::default(),
|
||||
tasks: vec![],
|
||||
entries,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
20
src/model/task.rs
Normal file
20
src/model/task.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use crate::*;
|
||||
use lofty::tag::TagItem;
|
||||
|
||||
/// An update to a file's metadata to be performed.
|
||||
pub struct Task {
|
||||
pub path: PathBuf,
|
||||
pub item: TagItem
|
||||
}
|
||||
|
||||
impl Task {
|
||||
fn new (path: &impl AsRef<Path>, item: TagItem) -> Self {
|
||||
Self {
|
||||
path: path.as_ref().into(),
|
||||
item
|
||||
}
|
||||
}
|
||||
fn apply (&self) -> Usually<()> {
|
||||
todo!("apply {:?} to {:?}", self.item, self.path)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue