tsk-45: Adding functionality for itdentifying Song
This commit is contained in:
15
src/detection/song.rs
Normal file
15
src/detection/song.rs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
pub fn file_type_from_filepath(filepath: &str) -> Result<String, std::io::Error> {
|
||||||
|
match infer::get_from_path(filepath) {
|
||||||
|
Ok(Some(kind)) => {
|
||||||
|
Ok(String::new())
|
||||||
|
}
|
||||||
|
Ok(None) => {
|
||||||
|
Err(std::io::Error::other("File type not determined"))
|
||||||
|
}
|
||||||
|
Err(err) => {
|
||||||
|
Err(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user