'How hard could it be'

This commit is contained in:
Jordan Petridis
2018-01-02 07:23:53 +02:00
parent b32f448957
commit 37e9b6fbf0
7 changed files with 144 additions and 4 deletions
+2 -1
View File
@@ -35,7 +35,8 @@ lazy_static! {
static ref DB_PATH: PathBuf = TEMPDIR.path().join("hammond.db");
}
pub(crate) fn connection() -> Pool {
// FIXME: this should not be public
pub fn connection() -> Pool {
POOL.clone()
}
+3 -1
View File
@@ -56,7 +56,9 @@ pub mod utils;
pub mod feed;
#[allow(missing_docs)]
pub mod errors;
pub(crate) mod database;
// FIXME: this should not be public
#[allow(missing_docs)]
pub mod database;
pub(crate) mod models;
mod parser;
mod schema;
+16
View File
@@ -215,6 +215,22 @@ pub struct EpisodeWidgetQuery {
podcast_id: i32,
}
impl From<Episode> for EpisodeWidgetQuery {
fn from(e: Episode) -> EpisodeWidgetQuery {
EpisodeWidgetQuery {
rowid: e.rowid,
title: e.title,
uri: e.uri,
local_uri: e.local_uri,
epoch: e.epoch,
length: e.length,
duration: e.duration,
played: e.played,
podcast_id: e.podcast_id,
}
}
}
impl EpisodeWidgetQuery {
/// Get the value of the sqlite's `ROW_ID`
pub fn rowid(&self) -> i32 {