aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.rs
diff options
context:
space:
mode:
authornjaremko2017-07-20 22:10:19 -0400
committernjaremko2017-07-20 22:10:19 -0400
commit79254251d52b62ea5b20ba5eb042ea7c31963de8 (patch)
treeb23279424c319b3a8a7d5584cd36b2f898b08368 /src/utils.rs
parent2623981fb2ca5b35d04d37f82102eb214d24e839 (diff)
downloadpodcast-79254251d52b62ea5b20ba5eb042ea7c31963de8.tar.bz2
Fix handling of missing mpv executable
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/utils.rs b/src/utils.rs
index ffe691e..e602932 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -28,7 +28,12 @@ pub fn already_downloaded(dir: &str) -> BTreeSet<String> {
}
pub fn get_podcast_dir() -> PathBuf {
- let mut path = env::home_dir().unwrap();
- path.push("Podcasts");
- path
+ match env::var_os("PODCAST") {
+ Some(val) => PathBuf::from(val),
+ None => {
+ let mut path = env::home_dir().unwrap();
+ path.push("Podcasts");
+ path
+ }
+ }
}