Skip to content

Commit

Permalink
Add some error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Alireza Ghassemi committed Aug 1, 2023
1 parent d23e13e commit 33d11d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/controls/playbin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use gstreamer::glib::{Cast, ObjectExt};
use gstreamer::prelude::{ElementExt, ElementExtManual};
use gstreamer::State::*;
use gtk::{Label, ProgressBar, Scale};
use log::warn;
use once_cell::sync::Lazy;
use crate::body::collection::model::Collection;
use crate::common::util::format;
Expand All @@ -27,7 +28,9 @@ pub static PLAYBIN: Lazy<Pipeline> = Lazy::new(|| {
if let Ok((song, collection, _)) = songs.inner_join(collections).inner_join(config)
.get_result::<(Song, Collection, Config)>(&mut get_connection()) {
playbin.set_uri(&(&song, &collection).path());
playbin.set_state(Paused).unwrap();
if let Err(error) = playbin.set_state(Paused) {
warn!("error setting playbin state to Paused {}", error);
}
}
playbin.connect("about-to-finish", true, |_| {
go_delta_song(1, false);
Expand Down

0 comments on commit 33d11d1

Please sign in to comment.