mirror of
https://github.com/johrpan/musicus.git
synced 2025-10-26 19:57:25 +01:00
Initialize work and recording editors
This commit is contained in:
parent
3339945380
commit
e2d36a88b8
5 changed files with 43 additions and 4 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use super::generate_id;
|
||||
use super::schema::{ensembles, performances, persons, recordings};
|
||||
use super::{Database, Ensemble, Instrument, Person, Work};
|
||||
use anyhow::{anyhow, Error, Result};
|
||||
|
|
@ -93,6 +94,16 @@ pub struct Recording {
|
|||
}
|
||||
|
||||
impl Recording {
|
||||
/// Initialize a new recording with a work.
|
||||
pub fn new(work: Work) -> Self {
|
||||
Self {
|
||||
id: generate_id(),
|
||||
work,
|
||||
comment: String::new(),
|
||||
performances: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a string representation of the performances in this recording.
|
||||
// TODO: Maybe replace with impl Display?
|
||||
pub fn get_performers(&self) -> String {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue