Compare commits
3 Commits
f02793e9bd
...
1000d52556
Author | SHA1 | Date | |
---|---|---|---|
1000d52556
|
|||
17e46f04f7
|
|||
d5e0f7c64e
|
@@ -39,7 +39,20 @@ impl CoverArt {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add method to remove from filesystem
|
/// Removes the coverart from the filesystem
|
||||||
|
pub fn remove_from_filesystem(&self) -> Result<(), std::io::Error> {
|
||||||
|
let p = std::path::Path::new(&self.path);
|
||||||
|
if p.exists() {
|
||||||
|
match std::fs::remove_file(p) {
|
||||||
|
Ok(_) => Ok(()),
|
||||||
|
Err(err) => Err(err),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Err(std::io::Error::other(
|
||||||
|
"Cannot delete file that does not exist",
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub mod io {
|
pub mod io {
|
||||||
|
@@ -118,7 +118,9 @@ impl Song {
|
|||||||
Err(err) => Err(err),
|
Err(err) => Err(err),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ok(())
|
Err(std::io::Error::other(
|
||||||
|
"Cannot delete file that does not exist",
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(err) => Err(err),
|
Err(err) => Err(err),
|
||||||
|
Reference in New Issue
Block a user