From d1c2572a0cb2882b2661dafac0631e5888144dce Mon Sep 17 00:00:00 2001 From: Nathan Date: Sun, 23 Jul 2017 12:01:23 -0400 Subject: Improve RSS downloading --- src/utils.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/utils.rs') diff --git a/src/utils.rs b/src/utils.rs index 02c9983..5a6342b 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -46,6 +46,22 @@ pub fn get_podcast_dir() -> PathBuf { } } +pub fn get_sub_file() -> PathBuf { + match env::var_os("PODCAST") { + Some(val) => { + let mut path = PathBuf::from(val); + path.push(".subscriptions"); + path + } + None => { + let mut path = env::home_dir().unwrap(); + path.push("Podcasts"); + path.push(".subscriptions"); + path + } + } +} + pub fn parse_download_episodes(e_search: &str) -> Vec { let input = String::from(e_search); let mut ranges = Vec::<(usize, usize)>::new(); -- cgit v1.2.3