Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async rewrite #86

Draft
wants to merge 55 commits into
base: total-rewrite
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f7975e8
Bump zbus version
Kanjirito Sep 25, 2024
54b2f03
Implement basic properties and methods
Kanjirito Sep 28, 2024
2cc1b18
Implement basic error handling, verify TrackID
Kanjirito Oct 2, 2024
95f4adb
Mark properties that don't emit signals on change
Kanjirito Oct 2, 2024
f3ae025
Remove lifetime from Player
Kanjirito Oct 4, 2024
f9c2996
Implement Metadata::is_empty()
Kanjirito Oct 6, 2024
6204af4
Add finder methods
Kanjirito Oct 6, 2024
ed3803d
Player improvements
Kanjirito Oct 7, 2024
0575ae2
Move all errors to separate file
Kanjirito Oct 7, 2024
e4a18da
Fix `Mpris::find_by_name()` being case sensitive
Kanjirito Oct 9, 2024
21b084a
Implement Stream over Players
Kanjirito Oct 10, 2024
63cc58f
Make Player::new() actually use async
Kanjirito Oct 10, 2024
c075f12
Make finder methods use PlayerStream
Kanjirito Oct 10, 2024
0b71005
Move DbusProxy into the Mpris struct
Kanjirito Oct 10, 2024
2473fff
Make slight changes to Player
Kanjirito Oct 14, 2024
d282ebc
Implement Display for the errors
Kanjirito Oct 15, 2024
9aa7ebd
Replace Duration and DurationExt
Kanjirito Oct 15, 2024
5bb67f0
Fix clippy complaints
Kanjirito Oct 16, 2024
134b28d
Implement conversion traits for MetadataValue
Kanjirito Oct 16, 2024
9b0f940
Implement From String for errors
Kanjirito Oct 16, 2024
9668542
Use raw_medatada instead of the struct
Kanjirito Oct 18, 2024
0a8db93
Improve MetadataValue conversions
Kanjirito Oct 18, 2024
29d8ee4
Rewrite the Metadata struct
Kanjirito Oct 19, 2024
60a4d3e
Remove unneeded MprisValue methods
Kanjirito Oct 19, 2024
939e85f
More TrackID tests and make method public
Kanjirito Oct 19, 2024
91d5d4e
Implement Playlists interface
Kanjirito Oct 23, 2024
6470e95
Update TrackID
Kanjirito Oct 24, 2024
7e6465a
Add small improvements
Kanjirito Oct 25, 2024
b38f6eb
Implement TrackList interface
Kanjirito Oct 25, 2024
d2bb214
Add check for TrackID.is_no_track() in go_to() and remove_track()
Kanjirito Oct 25, 2024
47f302d
Improve Metadata serde
Kanjirito Oct 25, 2024
bca17ed
Add lint rules
Kanjirito Oct 25, 2024
30cbe08
Change PlayerStream
Kanjirito Oct 25, 2024
9a43c1a
Add more implementations to MprisDuration
Kanjirito Oct 27, 2024
a842d35
Improve errors mod
Kanjirito Oct 27, 2024
28309d5
Prevent formatting
Kanjirito Oct 27, 2024
89f591a
Make small changes
Kanjirito Oct 28, 2024
1732618
Fix unfinished code in errors
Kanjirito Oct 28, 2024
6944039
Small clean-ups
Kanjirito Oct 29, 2024
ce1abbb
Add documentation
Kanjirito Oct 30, 2024
9312e61
Add case sensitivity argument to `find_by_name()`
Kanjirito Oct 30, 2024
a3f25c0
Make `TrackID` less restrictive
Kanjirito Oct 30, 2024
8f1b25b
Add unique name for Player and other small changes
Kanjirito Nov 2, 2024
11020f4
Warn about unwrap
Kanjirito Nov 2, 2024
6b66793
Rework Playlists interface
Kanjirito Nov 3, 2024
2e85aca
Bump MSRV to 1.75 to match zbus
Kanjirito Nov 3, 2024
0238efe
Make disabling the internal executor easier
Kanjirito Nov 4, 2024
f3e8e47
Improve serde
Kanjirito Nov 10, 2024
bf0e2a2
Rework RawMetadata
Kanjirito Nov 10, 2024
a500dcc
Switch to owned values
Kanjirito Nov 10, 2024
e45c2f4
Move serde related functions to a separate module
Kanjirito Nov 11, 2024
bc671dc
Add MetadataValue::TrackID
Kanjirito Nov 11, 2024
9abb8f8
Add conversions from small ints for MprisDuration
Kanjirito Nov 16, 2024
68c89fa
Add helper function for errors
Kanjirito Nov 16, 2024
e858f1c
Use custom types with zbus
Kanjirito Nov 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description = "Idiomatic MPRIS D-Bus interface library"
version = "3.0.0-alpha1"
license = "Apache-2.0"
edition = "2021"
rust-version = "1.56"
rust-version = "1.75"
authors = ["Magnus Bergmark <magnus.bergmark@gmail.com>"]
repository = "https://github.com/Mange/mpris-rs"
readme = "README.md"
Expand All @@ -18,12 +18,11 @@ maintenance = { status = "actively-developed" }
# Enable zbus' tight tokio integration; in case you want to use this crate in a
# Tokio-based app.
tokio = ["zbus/tokio"]
# Enable serde support for metadata
serde = ["dep:serde"]

[dependencies]
zbus = "3.4.0"
serde = { version = "1.0.164", optional = true }
zbus = "4.4.0"
serde ="1.0.164"
futures-util = "0.3.31"

# Example dependencies
[dev-dependencies]
Expand Down
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
allow-private-module-inception = true
allow-unwrap-in-tests = true
7 changes: 3 additions & 4 deletions examples/list_players.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
use mpris::Mpris;
use std::error::Error;
use mpris::{Mpris, MprisError};

#[async_std::main]
async fn main() -> Result<(), Box<dyn Error>> {
async fn main() -> Result<(), MprisError> {
let mpris = Mpris::new().await?;
for player in mpris.players().await? {
for player in mpris.all_players().await? {
println!("{:?}", player);
}
Ok(())
Expand Down
9 changes: 4 additions & 5 deletions examples/metadata.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use mpris::{Mpris, Player};
use std::error::Error;
use mpris::{Mpris, MprisError, Player};

#[async_std::main]
async fn main() -> Result<(), Box<dyn Error>> {
async fn main() -> Result<(), MprisError> {
let mpris = Mpris::new().await?;
let mut total = 0;

for player in mpris.players().await? {
for player in mpris.all_players().await? {
print_metadata(player).await?;
total += 1;
}
Expand All @@ -18,7 +17,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
Ok(())
}

async fn print_metadata(player: Player<'_>) -> Result<(), Box<dyn Error>> {
async fn print_metadata(player: Player) -> Result<(), MprisError> {
println!(
"Player: {} ({})",
player.identity().await?,
Expand Down
Loading