Minor Arc changes.
This commit is contained in:
parent
67af85e347
commit
31bd75ae45
@ -23,7 +23,7 @@ pub enum Action {
|
|||||||
RefreshShowsView,
|
RefreshShowsView,
|
||||||
RefreshWidget,
|
RefreshWidget,
|
||||||
RefreshWidgetIfVis,
|
RefreshWidgetIfVis,
|
||||||
ReplaceWidget(Podcast),
|
ReplaceWidget(Arc<Podcast>),
|
||||||
RefreshWidgetIfSame(i32),
|
RefreshWidgetIfSame(i32),
|
||||||
ShowWidgetAnimated,
|
ShowWidgetAnimated,
|
||||||
ShowShowsAnimated,
|
ShowShowsAnimated,
|
||||||
@ -136,7 +136,7 @@ impl App {
|
|||||||
Ok(Action::RefreshEpisodesView) => content.update_episode_view(),
|
Ok(Action::RefreshEpisodesView) => content.update_episode_view(),
|
||||||
Ok(Action::RefreshEpisodesViewBGR) => content.update_episode_view_if_baground(),
|
Ok(Action::RefreshEpisodesViewBGR) => content.update_episode_view_if_baground(),
|
||||||
Ok(Action::ReplaceWidget(pd)) => {
|
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!("Something went wrong while trying to update the ShowWidget.");
|
||||||
error!("Error: {}", err);
|
error!("Error: {}", err);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,11 +77,11 @@ impl Default for EpisodesView {
|
|||||||
impl EpisodesView {
|
impl EpisodesView {
|
||||||
pub fn new(sender: Sender<Action>) -> Result<EpisodesView, Error> {
|
pub fn new(sender: Sender<Action>) -> Result<EpisodesView, Error> {
|
||||||
let view = EpisodesView::default();
|
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();
|
let now_utc = Utc::now();
|
||||||
|
|
||||||
episodes.into_iter().for_each(|mut ep| {
|
episodes.iter_mut().for_each(|ep| {
|
||||||
let viewep = EpisodesViewWidget::new(&mut ep, sender.clone());
|
let viewep = EpisodesViewWidget::new(ep, sender.clone());
|
||||||
|
|
||||||
let t = split(&now_utc, i64::from(ep.epoch()));
|
let t = split(&now_utc, i64::from(ep.epoch()));
|
||||||
match t {
|
match t {
|
||||||
|
|||||||
@ -84,7 +84,7 @@ fn on_child_activate(child: >k::FlowBoxChild, sender: Sender<Action>) -> Resul
|
|||||||
let id = WidgetExt::get_name(child)
|
let id = WidgetExt::get_name(child)
|
||||||
.ok_or_else(|| format_err!("Faild to get \"episodes\" child from the stack."))?
|
.ok_or_else(|| format_err!("Faild to get \"episodes\" child from the stack."))?
|
||||||
.parse::<i32>()?;
|
.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::HeaderBarShowTile(pd.title().into()))?;
|
||||||
sender.send(Action::ReplaceWidget(pd))?;
|
sender.send(Action::ReplaceWidget(pd))?;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user