diff options
| author | Nathan Jaremko | 2019-01-15 22:54:06 -0500 | 
|---|---|---|
| committer | Nathan Jaremko | 2019-01-15 22:54:06 -0500 | 
| commit | 5acf564072f7ec07040a4b383e64a915f37a2a09 (patch) | |
| tree | 2d6d58ad94a8602e5e6517d5194c539faee20ec8 /src | |
| parent | 38e1b2396fbcbf810bd8eda77c53ef3339b8ea44 (diff) | |
| download | podcast-5acf564072f7ec07040a4b383e64a915f37a2a09.tar.bz2 | |
Ignore case when playing/downloading by name
Diffstat (limited to 'src')
| -rw-r--r-- | src/actions.rs | 6 | ||||
| -rw-r--r-- | src/main.rs | 2 | ||||
| -rw-r--r-- | src/structs.rs | 8 | 
3 files changed, 9 insertions, 7 deletions
| diff --git a/src/actions.rs b/src/actions.rs index 58cda4f..ce7eb2b 100644 --- a/src/actions.rs +++ b/src/actions.rs @@ -202,7 +202,8 @@ pub fn download_episode_by_name(                      .filter(|ep| {                          ep.title()                              .unwrap_or_else(|| "".to_string()) -                            .contains(e_search) +                            .to_lowercase() +                            .contains(&e_search.to_lowercase())                      })                      .collect(); @@ -362,7 +363,8 @@ pub fn play_episode_by_name(state: &State, p_search: &str, ep_string: &str) -> R                  .filter(|ep| {                      ep.title()                          .unwrap_or_else(|| "".to_string()) -                        .contains(ep_string) +                        .to_lowercase() +                        .contains(&ep_string.to_lowercase())                  })                  .collect();              if let Some(episode) = filtered_episodes.first() { diff --git a/src/main.rs b/src/main.rs index 4eba999..798e0e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,7 +32,7 @@ use self::utils::*;  use clap::{App, Arg, SubCommand}; -const VERSION: &str = "0.6.1"; +const VERSION: &str = "0.7.1";  fn main() -> Result<()> {      create_directories().chain_err(|| "unable to create directories")?; diff --git a/src/structs.rs b/src/structs.rs index a0d9bd7..4e9ef43 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -59,14 +59,14 @@ impl Config {      }  } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, Debug)]  pub struct Subscription {      pub title: String,      pub url: String,      pub num_episodes: usize,  } -#[derive(Serialize, Deserialize, Clone)] +#[derive(Serialize, Deserialize, Clone, Debug)]  pub struct State {      pub version: String,      pub last_run_time: DateTime<Utc>, @@ -157,10 +157,10 @@ impl State {      }  } -#[derive(Clone)] +#[derive(Clone, Debug)]  pub struct Podcast(Channel); -#[derive(Clone)] +#[derive(Clone, Debug)]  pub struct Episode(Item);  impl From<Channel> for Podcast { | 
