aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Jaremko2019-01-15 22:54:06 -0500
committerNathan Jaremko2019-01-15 22:54:06 -0500
commit5acf564072f7ec07040a4b383e64a915f37a2a09 (patch)
tree2d6d58ad94a8602e5e6517d5194c539faee20ec8
parent38e1b2396fbcbf810bd8eda77c53ef3339b8ea44 (diff)
downloadpodcast-5acf564072f7ec07040a4b383e64a915f37a2a09.tar.bz2
Ignore case when playing/downloading by name
-rw-r--r--Cargo.toml2
-rw-r--r--src/actions.rs6
-rw-r--r--src/main.rs2
-rw-r--r--src/structs.rs8
4 files changed, 10 insertions, 8 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 14385ec..32b04db 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "podcast"
edition = "2018"
-version = "0.7.0"
+version = "0.7.1"
authors = ["Nathan Jaremko <njaremko@gmail.com>"]
description = "A command line podcast manager"
license = "GPL-3.0"
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 {