diff options
| author | Nathan | 2017-07-23 12:01:23 -0400 | 
|---|---|---|
| committer | Nathan | 2017-07-23 12:01:23 -0400 | 
| commit | d1c2572a0cb2882b2661dafac0631e5888144dce (patch) | |
| tree | 8604681935932062cd97b8b1672d694dafc80cc1 /src/utils.rs | |
| parent | efb6ef328ca159bf4d3b5f1b02d13e1c0aef0764 (diff) | |
| download | podcast-d1c2572a0cb2882b2661dafac0631e5888144dce.tar.bz2 | |
Improve RSS downloading
Diffstat (limited to 'src/utils.rs')
| -rw-r--r-- | src/utils.rs | 16 | 
1 files changed, 16 insertions, 0 deletions
| 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<usize> {      let input = String::from(e_search);      let mut ranges = Vec::<(usize, usize)>::new(); | 
