Add a new Diesel Model for the EpisodeWidget.

This commit is contained in:
Jordan Petridis
2017-12-14 12:01:35 +02:00
parent ebbebf7735
commit 8fe6b526a5
5 changed files with 157 additions and 10 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ use std::io::{BufWriter, Read, Write};
use std::path::Path;
use errors::*;
use hammond_data::{Episode, Podcast};
use hammond_data::{Episode, EpisodeWidgetQuery, Podcast};
use hammond_data::xdg_dirs::{DL_DIR, HAMMOND_CACHE};
// TODO: Replace path that are of type &str with std::path.
@@ -106,7 +106,7 @@ pub fn get_download_folder(pd_title: &str) -> Result<String> {
}
// TODO: Refactor
pub fn get_episode(ep: &mut Episode, download_folder: &str) -> Result<()> {
pub fn get_episode(ep: &mut EpisodeWidgetQuery, download_folder: &str) -> Result<()> {
// Check if its alrdy downloaded
if ep.local_uri().is_some() {
if Path::new(ep.local_uri().unwrap()).exists() {