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XKUOUCFFAOXS7YR67E3AARPPPIA5YPDAC
5JMYBRF3UYX4LFH7JK6S4BEDKRVKDFIL4YKTCWKMKP4TMNNGQFKQC
let mut podcast_rss_path = get_xml_dir()?;
podcast_rss_path.push(podcast.title());
podcast_rss_path.set_extension("xml");
let mut podcast_rss_path = utils::get_xml_dir()?;
let title = utils::append_extension(podcast.title(), "xml");
podcast_rss_path.push(title);
}
}
Ok(())
}
pub fn search(state: &mut State, config: Config, matches: &ArgMatches) -> Result<()> {
let matches = matches.subcommand_matches("search").unwrap();
let podcast = matches.value_of("PODCAST").unwrap();
let resp = search::search_for_podcast(podcast)?;
if resp.found().is_empty() {
println!("No Results");
return Ok(());
}
{
let stdout = io::stdout();
let mut lock = stdout.lock();
for (i, r) in resp.found().iter().enumerate() {
writeln!(&mut lock, "({}) {}", i, r)?;
}
print!("Would you like to subscribe to any of these? (y/n): ");
io::stdout().flush().ok();
let mut input = String::new();
io::stdin().read_line(&mut input)?;
if input.to_lowercase().trim() != "y" {
return Ok(());
}
print!("Which one? (#): ");
io::stdout().flush().ok();
let mut num_input = String::new();
io::stdin().read_line(&mut num_input)?;
let n: usize = num_input.trim().parse()?;
if n > resp.found().len() {
eprintln!("Invalid!");
return Ok(());