Define a new Diesel Model for PodcastCover querries.
Define new Diesel Model and impl From<Podcast> trait, Change the signature of downloader::cache_image function, Change and merge hammond-gtk::utils::get_pixbuf_from_path functions.
This commit is contained in:
@@ -6,7 +6,7 @@ use hammond_data::dbqueries;
|
||||
use hammond_data::EpisodeWidgetQuery;
|
||||
|
||||
use widgets::episode::EpisodeWidget;
|
||||
use utils::get_pixbuf_from_path_64;
|
||||
use utils::get_pixbuf_from_path;
|
||||
|
||||
use std::rc::Rc;
|
||||
|
||||
@@ -216,8 +216,8 @@ impl EpisodesViewWidget {
|
||||
let image: gtk::Image = builder.get_object("cover").unwrap();
|
||||
|
||||
// FIXME:
|
||||
if let Ok(pd) = dbqueries::get_podcast_from_id(episode.podcast_id()) {
|
||||
let img = get_pixbuf_from_path_64(&pd);
|
||||
if let Ok(pd) = dbqueries::get_podcast_cover_from_id(episode.podcast_id()) {
|
||||
let img = get_pixbuf_from_path(&pd, 64);
|
||||
if let Some(i) = img {
|
||||
image.set_from_pixbuf(&i);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ impl ShowsChild {
|
||||
fn init(&self, pd: &Podcast) {
|
||||
self.container.set_tooltip_text(pd.title());
|
||||
|
||||
let cover = get_pixbuf_from_path(pd);
|
||||
let cover = get_pixbuf_from_path(&pd.clone().into(), 256);
|
||||
if let Some(img) = cover {
|
||||
self.cover.set_from_pixbuf(&img);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user