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J5GEHRNBSL6RTHFUGURG5HIVGLCG4FGUAC
let podcast = Podcast::from_url(&subscription.url).unwrap();
match parse_download_episodes(e_search) {
Ok(episodes_to_download) => podcast.download_specific(episodes_to_download),
Err(err) => eprintln!("{}", err),
match Podcast::from_title(&subscription.title) {
Ok(podcast) => {
match parse_download_episodes(e_search) {
Ok(episodes_to_download) => {
if let Err(err) = podcast.download_specific(episodes_to_download) {
eprintln!("Error: {}", err);
}
}
Err(err) => eprintln!("Error: {}", err),
}
}
Err(err) => eprintln!("Error: {}", err),
let podcast = Podcast::from_url(&subscription.url).unwrap();
let episodes = podcast.episodes();
if let Err(err) = episodes[episodes.len() - ep_num].download(podcast.title()) {
eprintln!("{}", err);
match Podcast::from_title(&subscription.title) {
Ok(podcast) => {
let episodes = podcast.episodes();
if let Err(err) = episodes[episodes.len() - ep_num].download(podcast.title()) {
eprintln!("{}", err);
}
}
Err(err) => eprintln!("Error: {}", err),
let podcast = Podcast::from_url(&subscription.url).unwrap();
podcast.download();
match Podcast::from_title(&subscription.title) {
Ok(podcast) => {
if let Err(err) = podcast.download() {
eprintln!("{}", err);
}
}
Err(err) => eprintln!("Error: {}", err),
}
}
}
pub fn from_title(title: &str) -> Result<Podcast, String> {
let mut path = get_xml_dir();
let mut filename = String::from(title);
filename.push_str(".xml");
path.push(filename);
match File::open(&path) {
Ok(file) => {
match Channel::read_from(BufReader::new(file)) {
Ok(podcast) => return Ok(Podcast::from(podcast)),
Err(err) => return Err(format!("Error: {}", err)),
}
}
Err(err) => return Err(format!("Error: {}", err)),
if let Ok(entries) = fs::read_dir(path) {
for entry in entries {
if let Ok(entry) = entry {
match entry.file_name().into_string() {
Ok(val) => {
let name = String::from(val);
let index = name.find('.').unwrap();
result.insert(String::from(&name[0..index]));
}
Err(_) => {
println!(
"OsString: {:?} couldn't be converted to String",
entry.file_name()
);
}
}
let entries = fs::read_dir(path)?;
for entry in entries {
let entry = entry?;
match entry.file_name().into_string() {
Ok(val) => {
let name = String::from(val);
let index = name.find('.').unwrap();
result.insert(String::from(&name[0..index]));
}
Err(_) => {
println!(
"OsString: {:?} couldn't be converted to String",
entry.file_name()
);
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
}
}
let mut path = get_podcast_dir();
path.push(".subscriptions");
path
}
pub fn get_xml_dir() -> PathBuf {
let mut path = get_podcast_dir();
path.push(".rss");
path