Duration #40
@@ -275,9 +275,6 @@ pub mod metadata {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|
||||||
// use super::*;
|
|
||||||
|
|
||||||
mod get {
|
mod get {
|
||||||
use super::super::metadata::get_meta;
|
use super::super::metadata::get_meta;
|
||||||
use crate::test_util::util;
|
use crate::test_util::util;
|
||||||
|
@@ -1,10 +1,5 @@
|
|||||||
use lofty::file::AudioFile;
|
use lofty::file::AudioFile;
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone)]
|
|
||||||
pub struct Duration {
|
|
||||||
pub val: i32,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_duration(song_path: &String) -> Result<std::time::Duration, std::io::Error> {
|
pub fn get_duration(song_path: &String) -> Result<std::time::Duration, std::io::Error> {
|
||||||
match std::fs::File::open(song_path) {
|
match std::fs::File::open(song_path) {
|
||||||
Ok(mut content) => {
|
Ok(mut content) => {
|
||||||
|
@@ -32,11 +32,6 @@ impl MetadataType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub enum Properties {
|
|
||||||
Duration,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn all_metadata_types() -> Vec<Type> {
|
pub fn all_metadata_types() -> Vec<Type> {
|
||||||
vec![
|
vec![
|
||||||
Type::Album,
|
Type::Album,
|
||||||
|
Reference in New Issue
Block a user