diff options
| author | njaremko | 2017-07-17 21:50:26 -0400 | 
|---|---|---|
| committer | njaremko | 2017-07-17 21:50:26 -0400 | 
| commit | cd83d6ecaf7d9025c3db452268cf246ae4c4aaa0 (patch) | |
| tree | 77be33df40e823b08d234b8a7d09245049b35553 /src/structs.rs | |
| parent | c981cf824f5d75423f88437361d915cb1233eb3a (diff) | |
| download | podcast-cd83d6ecaf7d9025c3db452268cf246ae4c4aaa0.tar.bz2 | |
Fix play functionality
Diffstat (limited to 'src/structs.rs')
| -rw-r--r-- | src/structs.rs | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/src/structs.rs b/src/structs.rs index ac1de96..51f4fc1 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -60,8 +60,10 @@ impl State {      }  } +#[derive(Clone)]  pub struct Podcast(Channel); +#[derive(Clone)]  pub struct Episode(Item);  impl From<Channel> for Podcast { @@ -126,14 +128,14 @@ impl Episode {          self.0.title()      } -    pub fn download_url(&self) -> Option<&str> { +    pub fn url(&self) -> Option<&str> {          match self.0.enclosure() {              Some(val) => Some(val.url()),              None => None,          }      } -    fn download_extension(&self) -> Option<&str> { +    pub fn download_extension(&self) -> Option<&str> {          match self.0.enclosure() {              Some(enclosure) => {                  match enclosure.mime_type() { @@ -152,7 +154,7 @@ impl Episode {          path.push(podcast_name);          DirBuilder::new().recursive(true).create(&path).unwrap(); -        if let Some(url) = self.download_url() { +        if let Some(url) = self.url() {              if let Some(title) = self.title() {                  println!("Downloading: {}", title);                  let mut filename = String::from(title); | 
