use id3::Timestamp;
use id3::{Tag as ID3Tag, TagLike};
use std::str::FromStr;
use fs_metadata::file_created;
pub fn make_date_recorded_from_audio_file(path_str: &str) -> Option<Timestamp> {
let formatted_date = file_created(path_str).unwrap();
let id3_timestamp = Timestamp::from_str(&formatted_date).expect("could not write timestamp");
let mut tag = ID3Tag::new();
tag.set_date_recorded(id3_timestamp);
tag.write_to_path(path_str, id3::Version::Id3v24)
.expect("could not write tag");
Some(id3_timestamp)
}