Merge branch 'dev' into improve-dealer

# Conflicts:
#	connect/src/spirc.rs
This commit is contained in:
Felix Prillwitz 2024-12-17 21:14:39 +01:00
commit 1873e2c405
No known key found for this signature in database
GPG key ID: DE334B43606D1455
18 changed files with 171 additions and 112 deletions

View file

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
ARG alpine_version=alpine3.18 ARG alpine_version=alpine3.19
ARG rust_version=1.74.0 ARG rust_version=1.75.0
FROM rust:${rust_version}-${alpine_version} FROM rust:${rust_version}-${alpine_version}
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse" ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"

View file

@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [connect] Add `seek_to` field to `SpircLoadCommand` (breaking) - [connect] Add `seek_to` field to `SpircLoadCommand` (breaking)
- [connect] Add `repeat_track` field to `SpircLoadCommand` (breaking) - [connect] Add `repeat_track` field to `SpircLoadCommand` (breaking)
- [connect] Add `pause` parameter to `Spirc::disconnect` method (breaking)
- [playback] Add `track` field to `PlayerEvent::RepeatChanged` (breaking) - [playback] Add `track` field to `PlayerEvent::RepeatChanged` (breaking)
- [core] Add `request_with_options` and `request_with_protobuf_and_options` to `SpClient` - [core] Add `request_with_options` and `request_with_protobuf_and_options` to `SpClient`
@ -28,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
on Android platform. on Android platform.
- [core] Fix "Invalid Credentials" when using a Keymaster access token and - [core] Fix "Invalid Credentials" when using a Keymaster access token and
client ID on Android platform. client ID on Android platform.
= [connect] Fix "play" command not handled if missing "offset" property
### Removed ### Removed

184
Cargo.lock generated
View file

@ -161,9 +161,9 @@ dependencies = [
[[package]] [[package]]
name = "async-io" name = "async-io"
version = "2.3.4" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059"
dependencies = [ dependencies = [
"async-lock", "async-lock",
"cfg-if", "cfg-if",
@ -216,7 +216,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -251,7 +251,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -357,7 +357,7 @@ dependencies = [
"regex", "regex",
"rustc-hash", "rustc-hash",
"shlex", "shlex",
"syn 2.0.85", "syn 2.0.90",
"which", "which",
] ]
@ -376,7 +376,7 @@ dependencies = [
"regex", "regex",
"rustc-hash", "rustc-hash",
"shlex", "shlex",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -685,7 +685,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"strsim", "strsim",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -696,7 +696,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806"
dependencies = [ dependencies = [
"darling_core", "darling_core",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -749,7 +749,7 @@ dependencies = [
"darling", "darling",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -759,7 +759,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c"
dependencies = [ dependencies = [
"derive_builder_core", "derive_builder_core",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -829,7 +829,7 @@ checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -984,9 +984,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
[[package]] [[package]]
name = "futures-lite" name = "futures-lite"
version = "2.4.0" version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f1fa2f9765705486b33fd2acf1577f8ec449c2ba1f318ae5447697b7c08d210" checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"futures-core", "futures-core",
@ -1003,7 +1003,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -1124,7 +1124,7 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -1156,13 +1156,14 @@ dependencies = [
[[package]] [[package]]
name = "governor" name = "governor"
version = "0.6.3" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" checksum = "842dc78579ce01e6a1576ad896edc92fca002dd60c9c3746b7fc2bec6fb429d0"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"futures", "futures-sink",
"futures-timer", "futures-timer",
"futures-util",
"no-std-compat", "no-std-compat",
"nonzero_ext", "nonzero_ext",
"parking_lot", "parking_lot",
@ -1194,7 +1195,7 @@ dependencies = [
"paste", "paste",
"pin-project-lite", "pin-project-lite",
"smallvec", "smallvec",
"thiserror", "thiserror 1.0.65",
] ]
[[package]] [[package]]
@ -1771,7 +1772,7 @@ dependencies = [
"combine", "combine",
"jni-sys", "jni-sys",
"log", "log",
"thiserror", "thiserror 1.0.65",
"walkdir", "walkdir",
"windows-sys 0.45.0", "windows-sys 0.45.0",
] ]
@ -1817,9 +1818,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.161" version = "0.2.168"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d"
[[package]] [[package]]
name = "libloading" name = "libloading"
@ -1861,7 +1862,7 @@ dependencies = [
"multimap", "multimap",
"rand", "rand",
"socket2", "socket2",
"thiserror", "thiserror 1.0.65",
"tokio", "tokio",
] ]
@ -1932,7 +1933,7 @@ dependencies = [
"log", "log",
"sha1", "sha1",
"sysinfo", "sysinfo",
"thiserror", "thiserror 2.0.7",
"tokio", "tokio",
"url", "url",
] ]
@ -1952,7 +1953,7 @@ dependencies = [
"log", "log",
"parking_lot", "parking_lot",
"tempfile", "tempfile",
"thiserror", "thiserror 2.0.7",
"tokio", "tokio",
] ]
@ -1968,7 +1969,7 @@ dependencies = [
"protobuf", "protobuf",
"rand", "rand",
"serde_json", "serde_json",
"thiserror", "thiserror 2.0.7",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
"uuid", "uuid",
@ -2019,7 +2020,7 @@ dependencies = [
"sha1", "sha1",
"shannon", "shannon",
"sysinfo", "sysinfo",
"thiserror", "thiserror 2.0.7",
"time", "time",
"tokio", "tokio",
"tokio-stream", "tokio-stream",
@ -2056,7 +2057,7 @@ dependencies = [
"serde_json", "serde_json",
"serde_repr", "serde_repr",
"sha1", "sha1",
"thiserror", "thiserror 2.0.7",
"tokio", "tokio",
"zbus", "zbus",
] ]
@ -2073,7 +2074,7 @@ dependencies = [
"protobuf", "protobuf",
"serde", "serde",
"serde_json", "serde_json",
"thiserror", "thiserror 2.0.7",
"uuid", "uuid",
] ]
@ -2084,7 +2085,7 @@ dependencies = [
"env_logger", "env_logger",
"log", "log",
"oauth2", "oauth2",
"thiserror", "thiserror 2.0.7",
"url", "url",
] ]
@ -2115,9 +2116,9 @@ dependencies = [
"sdl2", "sdl2",
"shell-words", "shell-words",
"symphonia", "symphonia",
"thiserror", "thiserror 2.0.7",
"tokio", "tokio",
"zerocopy", "zerocopy 0.8.13",
] ]
[[package]] [[package]]
@ -2239,7 +2240,7 @@ dependencies = [
"log", "log",
"ndk-sys", "ndk-sys",
"num_enum", "num_enum",
"thiserror", "thiserror 1.0.65",
] ]
[[package]] [[package]]
@ -2354,7 +2355,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -2415,7 +2416,7 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -2443,7 +2444,7 @@ dependencies = [
"serde_json", "serde_json",
"serde_path_to_error", "serde_path_to_error",
"sha2", "sha2",
"thiserror", "thiserror 1.0.65",
"url", "url",
] ]
@ -2644,9 +2645,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2"
[[package]] [[package]]
name = "polling" name = "polling"
version = "3.7.3" version = "3.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"concurrent-queue", "concurrent-queue",
@ -2696,7 +2697,7 @@ version = "0.2.20"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
dependencies = [ dependencies = [
"zerocopy", "zerocopy 0.7.35",
] ]
[[package]] [[package]]
@ -2706,7 +2707,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -2731,9 +2732,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.89" version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -2746,7 +2747,7 @@ checksum = "a3a7c64d9bf75b1b8d981124c14c179074e8caa7dfe7b6a12e6222ddcd0c8f72"
dependencies = [ dependencies = [
"once_cell", "once_cell",
"protobuf-support", "protobuf-support",
"thiserror", "thiserror 1.0.65",
] ]
[[package]] [[package]]
@ -2761,7 +2762,7 @@ dependencies = [
"protobuf-parse", "protobuf-parse",
"regex", "regex",
"tempfile", "tempfile",
"thiserror", "thiserror 1.0.65",
] ]
[[package]] [[package]]
@ -2772,7 +2773,7 @@ checksum = "9b445cf83c9303695e6c423d269759e139b6182d2f1171e18afda7078a764336"
dependencies = [ dependencies = [
"protobuf", "protobuf",
"protobuf-support", "protobuf-support",
"thiserror", "thiserror 1.0.65",
] ]
[[package]] [[package]]
@ -2787,7 +2788,7 @@ dependencies = [
"protobuf", "protobuf",
"protobuf-support", "protobuf-support",
"tempfile", "tempfile",
"thiserror", "thiserror 1.0.65",
"which", "which",
] ]
@ -2797,14 +2798,14 @@ version = "3.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b088fd20b938a875ea00843b6faf48579462630015c3788d397ad6a786663252" checksum = "b088fd20b938a875ea00843b6faf48579462630015c3788d397ad6a786663252"
dependencies = [ dependencies = [
"thiserror", "thiserror 1.0.65",
] ]
[[package]] [[package]]
name = "quick-xml" name = "quick-xml"
version = "0.36.2" version = "0.37.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7649a7b4df05aed9ea7ec6f628c67c9953a43869b8bc50929569b2999d443fe" checksum = "f22f29bdff3987b4d8632ef95fd6424ec7e4e0a57e2f4fc63e489e75357f6a03"
dependencies = [ dependencies = [
"memchr", "memchr",
"serde", "serde",
@ -2955,12 +2956,11 @@ dependencies = [
[[package]] [[package]]
name = "rodio" name = "rodio"
version = "0.19.0" version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6006a627c1a38d37f3d3a85c6575418cfe34a5392d60a686d0071e1c8d427acb" checksum = "e7ceb6607dd738c99bc8cb28eff249b7cd5c8ec88b9db96c0608c1480d140fb1"
dependencies = [ dependencies = [
"cpal", "cpal",
"thiserror",
] ]
[[package]] [[package]]
@ -3230,7 +3230,7 @@ checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -3263,7 +3263,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -3514,9 +3514,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.85" version = "2.0.90"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -3531,9 +3531,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
[[package]] [[package]]
name = "sysinfo" name = "sysinfo"
version = "0.31.4" version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be" checksum = "948512566b1895f93b1592c7574baeb2de842f224f2aab158799ecadb8ebbb46"
dependencies = [ dependencies = [
"core-foundation-sys", "core-foundation-sys",
"libc", "libc",
@ -3601,7 +3601,16 @@ version = "1.0.65"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl 1.0.65",
]
[[package]]
name = "thiserror"
version = "2.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767"
dependencies = [
"thiserror-impl 2.0.7",
] ]
[[package]] [[package]]
@ -3612,7 +3621,18 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
]
[[package]]
name = "thiserror-impl"
version = "2.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.90",
] ]
[[package]] [[package]]
@ -3700,7 +3720,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -3835,7 +3855,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -3869,7 +3889,7 @@ dependencies = [
"rustls 0.23.16", "rustls 0.23.16",
"rustls-pki-types", "rustls-pki-types",
"sha1", "sha1",
"thiserror", "thiserror 1.0.65",
"utf-8", "utf-8",
] ]
@ -4060,7 +4080,7 @@ dependencies = [
"once_cell", "once_cell",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -4094,7 +4114,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@ -4252,7 +4272,7 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -4263,7 +4283,7 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]
[[package]] [[package]]
@ -4560,7 +4580,7 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
"zvariant_utils", "zvariant_utils",
] ]
@ -4582,7 +4602,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
dependencies = [ dependencies = [
"byteorder", "byteorder",
"zerocopy-derive", "zerocopy-derive 0.7.35",
]
[[package]]
name = "zerocopy"
version = "0.8.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67914ab451f3bfd2e69e5e9d2ef3858484e7074d63f204fd166ec391b54de21d"
dependencies = [
"zerocopy-derive 0.8.13",
] ]
[[package]] [[package]]
@ -4593,7 +4622,18 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
]
[[package]]
name = "zerocopy-derive"
version = "0.8.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7988d73a4303ca289df03316bc490e934accf371af6bc745393cf3c2c5c4f25d"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.90",
] ]
[[package]] [[package]]
@ -4624,7 +4664,7 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
"zvariant_utils", "zvariant_utils",
] ]
@ -4636,5 +4676,5 @@ checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.85", "syn 2.0.90",
] ]

View file

@ -61,8 +61,8 @@ futures-util = { version = "0.3", default-features = false }
getopts = "0.2" getopts = "0.2"
log = "0.4" log = "0.4"
sha1 = "0.10" sha1 = "0.10"
sysinfo = { version = "0.31.3", default-features = false, features = ["system"] } sysinfo = { version = "0.33.0", default-features = false, features = ["system"] }
thiserror = "1.0" thiserror = "2.0"
tokio = { version = "1.40", features = ["rt", "macros", "signal", "sync", "parking_lot", "process"] } tokio = { version = "1.40", features = ["rt", "macros", "signal", "sync", "parking_lot", "process"] }
url = "2.2" url = "2.2"

View file

@ -23,5 +23,5 @@ http-body-util = "0.1.1"
log = "0.4" log = "0.4"
parking_lot = { version = "0.12", features = ["deadlock_detection"] } parking_lot = { version = "0.12", features = ["deadlock_detection"] }
tempfile = "3" tempfile = "3"
thiserror = "1.0" thiserror = "2.0"
tokio = { version = "1", features = ["macros", "parking_lot", "sync"] } tokio = { version = "1", features = ["macros", "parking_lot", "sync"] }

View file

@ -14,7 +14,7 @@ log = "0.4"
protobuf = "3.5" protobuf = "3.5"
rand = "0.8" rand = "0.8"
serde_json = "1.0" serde_json = "1.0"
thiserror = "1.0" thiserror = "2.0"
tokio = { version = "1", features = ["macros", "parking_lot", "sync"] } tokio = { version = "1", features = ["macros", "parking_lot", "sync"] }
tokio-stream = "0.1" tokio-stream = "0.1"
uuid = { version = "1.11.0", features = ["v4"] } uuid = { version = "1.11.0", features = ["v4"] }

View file

@ -125,7 +125,7 @@ enum SpircCommand {
Shuffle(bool), Shuffle(bool),
Repeat(bool), Repeat(bool),
RepeatTrack(bool), RepeatTrack(bool),
Disconnect, Disconnect { pause: bool },
SetPosition(u32), SetPosition(u32),
SetVolume(u16), SetVolume(u16),
Activate, Activate,
@ -306,8 +306,8 @@ impl Spirc {
pub fn set_position_ms(&self, position_ms: u32) -> Result<(), Error> { pub fn set_position_ms(&self, position_ms: u32) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::SetPosition(position_ms))?) Ok(self.commands.send(SpircCommand::SetPosition(position_ms))?)
} }
pub fn disconnect(&self) -> Result<(), Error> { pub fn disconnect(&self, pause: bool) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Disconnect)?) Ok(self.commands.send(SpircCommand::Disconnect { pause })?)
} }
pub fn activate(&self) -> Result<(), Error> { pub fn activate(&self) -> Result<(), Error> {
Ok(self.commands.send(SpircCommand::Activate)?) Ok(self.commands.send(SpircCommand::Activate)?)
@ -464,15 +464,12 @@ impl SpircTask {
} }
if !self.shutdown && self.connect_state.is_active() { if !self.shutdown && self.connect_state.is_active() {
if let Err(why) = self.notify().await { warn!("unexpected shutdown");
warn!("notify before unexpected shutdown couldn't be send: {why}") if let Err(why) = self.handle_disconnect().await {
error!("error during disconnecting: {why}")
} }
} }
// clears the session id, leaving an empty state
if let Err(why) = self.session.spclient().delete_connect_state_request().await {
warn!("deleting connect_state failed before unexpected shutdown: {why}")
}
self.session.dealer().close().await; self.session.dealer().close().await;
} }
@ -549,6 +546,12 @@ impl SpircTask {
_ if !self.connect_state.is_active() => { _ if !self.connect_state.is_active() => {
warn!("SpircCommand::{:?} will be ignored while Not Active", cmd) warn!("SpircCommand::{:?} will be ignored while Not Active", cmd)
} }
SpircCommand::Disconnect { pause } => {
if pause {
self.handle_pause()
}
return self.handle_disconnect().await;
}
SpircCommand::Play => self.handle_play(), SpircCommand::Play => self.handle_play(),
SpircCommand::PlayPause => self.handle_play_pause(), SpircCommand::PlayPause => self.handle_play_pause(),
SpircCommand::Pause => self.handle_pause(), SpircCommand::Pause => self.handle_pause(),
@ -556,7 +559,6 @@ impl SpircTask {
SpircCommand::Next => self.handle_next(None)?, SpircCommand::Next => self.handle_next(None)?,
SpircCommand::VolumeUp => self.handle_volume_up(), SpircCommand::VolumeUp => self.handle_volume_up(),
SpircCommand::VolumeDown => self.handle_volume_down(), SpircCommand::VolumeDown => self.handle_volume_down(),
SpircCommand::Disconnect => self.handle_disconnect().await?,
SpircCommand::Shuffle(shuffle) => self.connect_state.handle_shuffle(shuffle)?, SpircCommand::Shuffle(shuffle) => self.connect_state.handle_shuffle(shuffle)?,
SpircCommand::Repeat(repeat) => self.connect_state.set_repeat_context(repeat), SpircCommand::Repeat(repeat) => self.connect_state.set_repeat_context(repeat),
SpircCommand::RepeatTrack(repeat) => self.connect_state.set_repeat_track(repeat), SpircCommand::RepeatTrack(repeat) => self.connect_state.set_repeat_track(repeat),
@ -918,7 +920,7 @@ impl SpircTask {
context_uri: play.context.uri.clone(), context_uri: play.context.uri.clone(),
start_playing: true, start_playing: true,
seek_to: play.options.seek_to.unwrap_or_default(), seek_to: play.options.seek_to.unwrap_or_default(),
playing_track: play.options.skip_to.try_into().ok(), playing_track: play.options.skip_to.and_then(|s| s.try_into().ok()),
shuffle, shuffle,
repeat, repeat,
repeat_track, repeat_track,
@ -1039,7 +1041,6 @@ impl SpircTask {
async fn handle_disconnect(&mut self) -> Result<(), Error> { async fn handle_disconnect(&mut self) -> Result<(), Error> {
self.context_resolver.clear(); self.context_resolver.clear();
self.handle_pause();
self.play_status = SpircPlayStatus::Stopped {}; self.play_status = SpircPlayStatus::Stopped {};
self.connect_state self.connect_state
@ -1048,6 +1049,12 @@ impl SpircTask {
self.connect_state.became_inactive(&self.session).await?; self.connect_state.became_inactive(&self.session).await?;
// this should clear the active session id, leaving an empty state
self.session
.spclient()
.delete_connect_state_request()
.await?;
self.player self.player
.emit_session_disconnected_event(self.session.connection_id(), self.session.username()); .emit_session_disconnected_event(self.session.connection_id(), self.session.username());
@ -1454,7 +1461,7 @@ impl SpircTask {
); );
if self.session.session_id() != session.session_id { if self.session.session_id() != session.session_id {
self.session.set_session_id(session.session_id.clone()); self.session.set_session_id(&session.session_id);
self.connect_state.set_session_id(session.session_id); self.connect_state.set_session_id(session.session_id);
} }
} else { } else {

View file

@ -25,7 +25,7 @@ bytes = "1"
form_urlencoded = "1.0" form_urlencoded = "1.0"
futures-core = "0.3" futures-core = "0.3"
futures-util = { version = "0.3", features = ["alloc", "bilock", "sink", "unstable"] } futures-util = { version = "0.3", features = ["alloc", "bilock", "sink", "unstable"] }
governor = { version = "0.6", default-features = false, features = ["std", "jitter"] } governor = { version = "0.8", default-features = false, features = ["std", "jitter"] }
hmac = "0.12" hmac = "0.12"
httparse = "1.7" httparse = "1.7"
http = "1.0" http = "1.0"
@ -44,15 +44,15 @@ pbkdf2 = { version = "0.12", default-features = false, features = ["hmac"] }
pin-project-lite = "0.2" pin-project-lite = "0.2"
priority-queue = "2.0" priority-queue = "2.0"
protobuf = "3.5" protobuf = "3.5"
quick-xml = { version = "0.36.1", features = ["serialize"] } quick-xml = { version = "0.37.1", features = ["serialize"] }
rand = "0.8" rand = "0.8"
rsa = "0.9.2" rsa = "0.9.2"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
sha1 = { version = "0.10", features = ["oid"] } sha1 = { version = "0.10", features = ["oid"] }
shannon = "0.2" shannon = "0.2"
sysinfo = { version = "0.31.3", default-features = false, features = ["system"] } sysinfo = { version = "0.33.0", default-features = false, features = ["system"] }
thiserror = "1.0" thiserror = "2.0"
time = { version = "0.3", features = ["formatting", "parsing"] } time = { version = "0.3", features = ["formatting", "parsing"] }
tokio = { version = "1", features = ["io-util", "macros", "net", "parking_lot", "rt", "sync", "time"] } tokio = { version = "1", features = ["io-util", "macros", "net", "parking_lot", "rt", "sync", "time"] }
tokio-stream = "0.1" tokio-stream = "0.1"

View file

@ -170,7 +170,7 @@ pub struct TransferOptions {
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize)]
pub struct PlayOptions { pub struct PlayOptions {
pub skip_to: SkipTo, pub skip_to: Option<SkipTo>,
#[serde(default, deserialize_with = "option_json_proto")] #[serde(default, deserialize_with = "option_json_proto")]
pub player_options_override: Option<ContextPlayerOptionOverrides>, pub player_options_override: Option<ContextPlayerOptionOverrides>,
pub license: Option<String>, pub license: Option<String>,
@ -191,7 +191,7 @@ pub struct OptionsOptions {
system_initiated: bool, system_initiated: bool,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize, Default)]
pub struct SkipTo { pub struct SkipTo {
pub track_uid: Option<String>, pub track_uid: Option<String>,
pub track_uri: Option<String>, pub track_uri: Option<String>,

View file

@ -389,8 +389,8 @@ impl Session {
self.0.data.read().session_id.clone() self.0.data.read().session_id.clone()
} }
pub fn set_session_id(&self, session_id: String) { pub fn set_session_id(&self, session_id: &str) {
self.0.data.write().session_id = session_id.to_owned(); session_id.clone_into(&mut self.0.data.write().session_id);
} }
pub fn device_id(&self) -> &str { pub fn device_id(&self) -> &str {
@ -450,7 +450,7 @@ impl Session {
} }
pub fn set_auth_data(&self, auth_data: &[u8]) { pub fn set_auth_data(&self, auth_data: &[u8]) {
self.0.data.write().auth_data = auth_data.to_owned(); auth_data.clone_into(&mut self.0.data.write().auth_data);
} }
pub fn country(&self) -> String { pub fn country(&self) -> String {

View file

@ -28,9 +28,9 @@ serde = { version = "1", default-features = false, features = ["derive"], option
serde_repr = "0.1" serde_repr = "0.1"
serde_json = "1.0" serde_json = "1.0"
sha1 = "0.10" sha1 = "0.10"
thiserror = "1.0" thiserror = "2.0"
tokio = { version = "1", features = ["parking_lot", "sync", "rt"] } tokio = { version = "1", features = ["parking_lot", "sync", "rt"] }
zbus = { version = "4", default-features = false, features = ["tokio"], optional = true } zbus = { version = "4", default-features = false, features = ["tokio"], optional = true } # zbus > 4 requires a MSRV of 1.80
[dependencies.librespot-core] [dependencies.librespot-core]
path = "../core" path = "../core"

View file

@ -13,7 +13,7 @@ async-trait = "0.1"
bytes = "1" bytes = "1"
log = "0.4" log = "0.4"
protobuf = "3.5" protobuf = "3.5"
thiserror = "1" thiserror = "2.0"
uuid = { version = "1", default-features = false } uuid = { version = "1", default-features = false }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"

View file

@ -11,7 +11,7 @@ edition = "2021"
[dependencies] [dependencies]
log = "0.4" log = "0.4"
oauth2 = "4.4" oauth2 = "4.4"
thiserror = "1.0" thiserror = "2.0"
url = "2.2" url = "2.2"
[dev-dependencies] [dev-dependencies]

View file

@ -25,9 +25,9 @@ futures-util = "0.3"
log = "0.4" log = "0.4"
parking_lot = { version = "0.12", features = ["deadlock_detection"] } parking_lot = { version = "0.12", features = ["deadlock_detection"] }
shell-words = "1.1" shell-words = "1.1"
thiserror = "1" thiserror = "2.0"
tokio = { version = "1", features = ["parking_lot", "rt", "rt-multi-thread", "sync"] } tokio = { version = "1", features = ["parking_lot", "rt", "rt-multi-thread", "sync"] }
zerocopy = { version = "0.7.32", features = ["derive"] } zerocopy = { version = "0.8.13", features = ["derive"] }
# Backends # Backends
alsa = { version = "0.9.0", optional = true } alsa = { version = "0.9.0", optional = true }
@ -42,7 +42,7 @@ gstreamer-audio = { version = "0.23.0", optional = true }
glib = { version = "0.20.3", optional = true } glib = { version = "0.20.3", optional = true }
# Rodio dependencies # Rodio dependencies
rodio = { version = "0.19.0", optional = true, default-features = false } rodio = { version = "0.20.1", optional = true, default-features = false }
cpal = { version = "0.15.1", optional = true } cpal = { version = "0.15.1", optional = true }
# Container and audio decoder # Container and audio decoder

View file

@ -48,7 +48,7 @@ macro_rules! sink_as_bytes {
() => { () => {
fn write(&mut self, packet: AudioPacket, converter: &mut Converter) -> SinkResult<()> { fn write(&mut self, packet: AudioPacket, converter: &mut Converter) -> SinkResult<()> {
use crate::convert::i24; use crate::convert::i24;
use zerocopy::AsBytes; use zerocopy::IntoBytes;
match packet { match packet {
AudioPacket::Samples(samples) => match self.format { AudioPacket::Samples(samples) => match self.format {
AudioFormat::F64 => self.write_bytes(samples.as_bytes()), AudioFormat::F64 => self.write_bytes(samples.as_bytes()),

View file

@ -1,7 +1,7 @@
use crate::dither::{Ditherer, DithererBuilder}; use crate::dither::{Ditherer, DithererBuilder};
use zerocopy::AsBytes; use zerocopy::{Immutable, IntoBytes};
#[derive(AsBytes, Copy, Clone, Debug)] #[derive(Immutable, IntoBytes, Copy, Clone, Debug)]
#[allow(non_camel_case_types)] #[allow(non_camel_case_types)]
#[repr(transparent)] #[repr(transparent)]
pub struct i24([u8; 3]); pub struct i24([u8; 3]);

View file

@ -1872,7 +1872,7 @@ async fn main() {
{ {
Ok(d) => break Some(d), Ok(d) => break Some(d),
Err(e) => { Err(e) => {
sys.refresh_processes(ProcessesToUpdate::All); sys.refresh_processes(ProcessesToUpdate::All, true);
if System::uptime() <= 1 { if System::uptime() <= 1 {
debug!("Retrying to initialise discovery: {e}"); debug!("Retrying to initialise discovery: {e}");

12
test.sh
View file

@ -2,6 +2,16 @@
set -e set -e
clean() {
# some shells will call EXIT after the INT signal
# causing EXIT trap to be executed, so we trap EXIT after INT
trap '' EXIT
cargo clean
}
trap clean INT QUIT TERM EXIT
# this script runs the tests and checks that also run as part of the`test.yml` github action workflow # this script runs the tests and checks that also run as part of the`test.yml` github action workflow
cargo clean cargo clean
cargo fmt --all -- --check cargo fmt --all -- --check
@ -18,4 +28,4 @@ cargo check -p librespot-core --no-default-features
cargo check -p librespot-core cargo check -p librespot-core
cargo hack check --no-dev-deps --each-feature -p librespot-discovery cargo hack check --no-dev-deps --each-feature -p librespot-discovery
cargo hack check --no-dev-deps --each-feature -p librespot-playback cargo hack check --no-dev-deps --each-feature -p librespot-playback
cargo hack check --no-dev-deps --each-feature cargo hack check --no-dev-deps --each-feature