From ff7e3cd5a6fbf8f89efb7fb013159ab16ed63eed Mon Sep 17 00:00:00 2001 From: Narfinger Date: Wed, 19 Jul 2023 15:25:03 +0900 Subject: [PATCH] fixed dbus --- Cargo.lock | 134 ++++++++++++++----------------------- Cargo.toml | 30 ++++----- src/dbus_interface.rs | 16 ++--- src/loaded_playlist.rs | 2 +- web_gui_yew/src/sidebar.rs | 2 +- 5 files changed, 74 insertions(+), 110 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9608fa1f..b000d264 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,32 +143,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "async-executor" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" -dependencies = [ - "async-lock", - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "slab", -] - -[[package]] -name = "async-fs" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" -dependencies = [ - "async-lock", - "autocfg", - "blocking", - "futures-lite", -] - [[package]] name = "async-io" version = "1.13.0" @@ -224,7 +198,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -241,7 +215,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -376,9 +350,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.12" +version = "4.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eab9e8ceb9afdade1ab3f0fd8dbce5b1b2f468ad653baf10e771781b2b67b73" +checksum = "74bb1b4028935821b2d6b439bba2e970bdcf740832732437ead910c632e30d7d" dependencies = [ "clap_builder", "clap_derive", @@ -387,9 +361,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.12" +version = "4.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2763db829349bf00cfc06251268865ed4363b93a943174f638daf3ecdba2cd" +checksum = "5ae467cbb0111869b765e13882a1dbbd6cb52f58203d8b80c44f667d4dd19843" dependencies = [ "anstream", "anstyle", @@ -407,7 +381,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -547,7 +521,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -567,7 +541,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -646,7 +620,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -806,7 +780,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -1066,7 +1040,7 @@ checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", - "itoa 1.0.8", + "itoa 1.0.9", ] [[package]] @@ -1113,7 +1087,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.8", + "itoa 1.0.9", "pin-project-lite", "socket2", "tokio", @@ -1233,9 +1207,9 @@ checksum = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "lazy_static" @@ -1556,9 +1530,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pathdiff" @@ -1599,7 +1573,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -1638,9 +1612,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d220334a184db82b31b83f5ff093e3315280fb2b6bbc032022b2304a509aab7a" +checksum = "edc55135a600d700580e406b4de0d59cb9ad25e344a3a091a97ded2622ec4ec6" [[package]] name = "ppv-lite86" @@ -1701,18 +1675,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" dependencies = [ "proc-macro2", ] @@ -1823,9 +1797,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d3daa6976cffb758ec878f108ba0e062a45b2d6ca3a2cca965338855476caf" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ "aho-corasick", "memchr", @@ -1882,9 +1856,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -1912,9 +1886,9 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" @@ -1939,7 +1913,7 @@ checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -1960,7 +1934,7 @@ version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ - "itoa 1.0.8", + "itoa 1.0.9", "ryu", "serde 1.0.171", ] @@ -1973,7 +1947,7 @@ checksum = "1d89a8107374290037607734c0b73a85db7ed80cae314b3c5791f192a496e731" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -1992,7 +1966,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa 1.0.8", + "itoa 1.0.9", "ryu", "serde 1.0.171", ] @@ -2020,9 +1994,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", @@ -2093,9 +2067,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" dependencies = [ "proc-macro2", "quote", @@ -2136,9 +2110,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.9" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8e77cb757a61f51b947ec4a7e3646efd825b73561db1c232a8ccb639e611a0" +checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" [[package]] name = "tempfile" @@ -2180,7 +2154,7 @@ checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -2200,7 +2174,7 @@ version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ - "itoa 1.0.8", + "itoa 1.0.9", "serde 1.0.171", "time-core", "time-macros", @@ -2253,6 +2227,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", + "tracing", "windows-sys 0.48.0", ] @@ -2264,7 +2239,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -2327,9 +2302,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.12" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "serde 1.0.171", @@ -2365,7 +2340,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -2435,9 +2410,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -2777,9 +2752,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.9" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a2094c43cc94775293eaa0e499fbc30048a6d824ac82c0351a8c0bf9112529" +checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" dependencies = [ "memchr", ] @@ -2810,15 +2785,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" dependencies = [ "async-broadcast", - "async-executor", - "async-fs", - "async-io", - "async-lock", "async-process", "async-recursion", - "async-task", "async-trait", - "blocking", "byteorder", "derivative", "enumflags2", @@ -2835,6 +2804,7 @@ dependencies = [ "serde_repr", "sha1", "static_assertions", + "tokio", "tracing", "uds_windows", "winapi 0.3.9", diff --git a/Cargo.toml b/Cargo.toml index e98402ac..0149dbcd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,30 +6,30 @@ authors = ["Narfinger "] edition = "2018" [dependencies] +anyhow = "1.0.72" clap = { version = "4.3.12", features = ["cargo", "derive"] } +directories = "5.0.1" diesel = { version = "2.1.0", features = ["sqlite", "r2d2"] } diesel_migrations = { version = "2.1.0", features = ["sqlite"] } -futures = "0.3.28" -log = { version = "0.4.19", features = ["max_level_debug", "release_max_level_warn"] } env_logger = "0.10.0" -indicatif = { version = "0.17.5", features = ["rayon"] } -humantime = "2.1.0" -taglib = "1.0.0" +futures = "0.3.28" gstreamer = "0.20.7" +humantime = "2.1.0" +indicatif = { version = "0.17.5", features = ["rayon"] } +itertools = "0.11.0" +log = { version = "0.4.19", features = ["max_level_debug", "release_max_level_warn"] } +open = "5.0.0" +parking_lot = { version = "0.12.1", features = ["serde", "deadlock_detection"] } percent-encoding = "2.3.0" preferences = "1.1.0" +rand = "0.8.5" rayon = "1.7.0" -serde_json = "1.0.103" +taglib = "1.0.0" serde = { version = "1.0.171", features = ["derive"] } -open = "5.0.0" -rand = "0.8.5" +serde_json = "1.0.103" toml = "0.7.6" -walkdir = "2.3.3" +tokio = { version = "1.29.1", features = ["full"] } viola_common = {path ="viola_common", features =["backend"]} -itertools = "0.11.0" -zbus = "3.14.1" -parking_lot = { version = "0.12.1", features = ["serde", "deadlock_detection"] } +walkdir = "2.3.3" warp = { version = "0.3.5", features = ["compression"] } -tokio = { version = "1.29.1", features = ["full"] } -directories = "5.0.1" -anyhow = "1.0.72" +zbus = { version = "3.14.1", default-features = false, features = ["tokio"]} diff --git a/src/dbus_interface.rs b/src/dbus_interface.rs index a105e04c..b88281ab 100644 --- a/src/dbus_interface.rs +++ b/src/dbus_interface.rs @@ -1,4 +1,5 @@ use parking_lot::RwLock; +use std::future::pending; use std::{collections::HashMap, sync::Arc}; use crate::{gstreamer_wrapper::GStreamer, loaded_playlist::LoadedPlaylistExt, types::*}; @@ -222,7 +223,7 @@ pub(crate) async fn main( gstreamer, playlisttabs, }; - let conn = ConnectionBuilder::session() + let _conn = ConnectionBuilder::session() .expect("Could not connect to session bus") .name("org.mpris.MediaPlayer2.Viola") .expect("Could not use name") @@ -234,18 +235,10 @@ pub(crate) async fn main( .build() .await .expect("Error in creating connection"); - { - let conn = conn.clone(); - tokio::task::spawn(async move { - loop { - conn.executor().tick().await; - } - }); - } + pending::<()>().await; + /* { - //let conn = conn.clone(); - //let mut bus = bus.clone(); tokio::task::spawn(async move { println!("doing signal"); let iface_ref = conn @@ -280,6 +273,7 @@ pub(crate) async fn main( } }); } + */ Ok(()) } diff --git a/src/loaded_playlist.rs b/src/loaded_playlist.rs index d8c0bfd2..8ad824cd 100644 --- a/src/loaded_playlist.rs +++ b/src/loaded_playlist.rs @@ -91,7 +91,7 @@ impl LoadedPlaylistExt for LoadedPlaylistPtr { fn update_current_playcount(&self) { let index = self.current_position(); let mut s = self.write(); - let mut item = s.items.get_mut(index).unwrap(); + let item = s.items.get_mut(index).unwrap(); item.playcount = Some(item.playcount.unwrap_or(0) + 1); } } diff --git a/web_gui_yew/src/sidebar.rs b/web_gui_yew/src/sidebar.rs index c7568635..446bcd13 100644 --- a/web_gui_yew/src/sidebar.rs +++ b/web_gui_yew/src/sidebar.rs @@ -78,7 +78,7 @@ impl Component for Sidebar { match msg { SidebarMsg::Close => { self.smartplaylist_visible = false; - for mut i in self.treeviews.iter_mut() { + for i in self.treeviews.iter_mut() { i.visible = false; } ctx.props().close_callback.emit(());