EpisodesView: Use show cover image.

This commit is contained in:
Jordan Petridis
2017-12-19 13:19:38 +02:00
parent ad9a932143
commit 895591f628
4 changed files with 32 additions and 7 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ pub(crate) mod models;
mod parser;
mod schema;
pub use models::queryables::{Episode, EpisodeWidgetQuery, Podcast, Source};
pub use models::queryables::{Episode, EpisodeViewWidgetQuery, EpisodeWidgetQuery, Podcast, Source};
/// [XDG Base Direcotory](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) Paths.
#[allow(missing_debug_implementations)]
+8
View File
@@ -354,9 +354,17 @@ pub struct EpisodeViewWidgetQuery {
}
impl EpisodeViewWidgetQuery {
/// Get the `image_uri`.
///
/// Represents the uri(url usually) that the Feed cover image is located at.
pub fn image_uri(&self) -> Option<&str> {
self.image_uri.as_ref().map(|s| s.as_str())
}
/// `Podcast` table foreign key.
pub fn podcast_id(&self) -> i32 {
self.podcast_id
}
}
#[derive(Queryable, Identifiable, AsChangeset, Associations, PartialEq)]