Minor Arc changes.

This commit is contained in:
Jordan Petridis 2018-02-07 07:02:24 +02:00
parent 67af85e347
commit 31bd75ae45
No known key found for this signature in database
GPG Key ID: CEABAD9F5683B9A6
3 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ pub enum Action {
RefreshShowsView,
RefreshWidget,
RefreshWidgetIfVis,
ReplaceWidget(Podcast),
ReplaceWidget(Arc<Podcast>),
RefreshWidgetIfSame(i32),
ShowWidgetAnimated,
ShowShowsAnimated,
@ -136,7 +136,7 @@ impl App {
Ok(Action::RefreshEpisodesView) => content.update_episode_view(),
Ok(Action::RefreshEpisodesViewBGR) => content.update_episode_view_if_baground(),
Ok(Action::ReplaceWidget(pd)) => {
if let Err(err) = content.get_shows().replace_widget(Arc::new(pd)) {
if let Err(err) = content.get_shows().replace_widget(pd) {
error!("Something went wrong while trying to update the ShowWidget.");
error!("Error: {}", err);
}

View File

@ -77,11 +77,11 @@ impl Default for EpisodesView {
impl EpisodesView {
pub fn new(sender: Sender<Action>) -> Result<EpisodesView, Error> {
let view = EpisodesView::default();
let episodes = dbqueries::get_episodes_widgets_with_limit(50)?;
let mut episodes = dbqueries::get_episodes_widgets_with_limit(50)?;
let now_utc = Utc::now();
episodes.into_iter().for_each(|mut ep| {
let viewep = EpisodesViewWidget::new(&mut ep, sender.clone());
episodes.iter_mut().for_each(|ep| {
let viewep = EpisodesViewWidget::new(ep, sender.clone());
let t = split(&now_utc, i64::from(ep.epoch()));
match t {

View File

@ -84,7 +84,7 @@ fn on_child_activate(child: &gtk::FlowBoxChild, sender: Sender<Action>) -> Resul
let id = WidgetExt::get_name(child)
.ok_or_else(|| format_err!("Faild to get \"episodes\" child from the stack."))?
.parse::<i32>()?;
let pd = dbqueries::get_podcast_from_id(id)?;
let pd = Arc::new(dbqueries::get_podcast_from_id(id)?);
sender.send(Action::HeaderBarShowTile(pd.title().into()))?;
sender.send(Action::ReplaceWidget(pd))?;