don't use a string error on ffprobe handler, pass the proper error
This commit is contained in:
parent
f10506be0b
commit
abe16ae53b
|
@ -7,6 +7,8 @@ pub enum AnalyzeError {
|
||||||
ParseError(serde_json::Error),
|
ParseError(serde_json::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::error::Error for AnalyzeError {}
|
||||||
|
|
||||||
impl fmt::Display for AnalyzeError {
|
impl fmt::Display for AnalyzeError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
|
|
@ -3,8 +3,6 @@ use std::{
|
||||||
process::Command,
|
process::Command,
|
||||||
};
|
};
|
||||||
|
|
||||||
use string_error::into_err;
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
meta,
|
meta,
|
||||||
types::{AudioFileInfo, Tags},
|
types::{AudioFileInfo, Tags},
|
||||||
|
@ -41,7 +39,7 @@ impl GenericFFMpegAudioFormat {
|
||||||
let output = ffprobe::analyze(&self.path, Some(meta::FFPROBE));
|
let output = ffprobe::analyze(&self.path, Some(meta::FFPROBE));
|
||||||
|
|
||||||
if let Err(err) = output {
|
if let Err(err) = output {
|
||||||
return Err(into_err(format!("{}", err)));
|
return Err(Box::from(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
let output = output.unwrap();
|
let output = output.unwrap();
|
||||||
|
|
|
@ -5,4 +5,4 @@ pub mod formats;
|
||||||
mod music_scanner;
|
mod music_scanner;
|
||||||
|
|
||||||
pub use formats::is_supported_file;
|
pub use formats::is_supported_file;
|
||||||
pub use music_scanner::scan_for_music;
|
pub use music_scanner::scan_for_music;
|
Loading…
Reference in a new issue