Commit graph

199 commits

Author SHA1 Message Date
Roderick van Domburg
383a6f6969
Update Cargo.lock 2024-10-30 21:11:33 +01:00
Benedikt
94d174c33d
Discovery: Refactor and add Avahi DBus backend (#1347)
* discovery: use opaque error type for DnsSdError

This helps to decouple discovery and core by not leaking implementation
details of the zeroconf backend into Error conversion impls in core.

* discovery: map all MDNS/DNS-SD errors to DiscoveryError::DnsSdError

previously, libmdns errors would use a generic conversion
from std::io::Error to core::Error

* discovery: use an opaque type for the handle to the DNS-SD service

* discovery: make features additive

i.e. add with-libmdns instead of using not(with-dns-sd).

The logic is such that enabling with-dns-sd in addition to the default
with-libmdns will still end up using dns-sd, as before.
If only with-libmdns is enabled, that will be the default.
If none of the features is enabled, attempting to build a `Discovery`
will yield an error.

* discovery: add --zeroconf-backend CLI flag

* discovery: Add minimal Avahi zeroconf backend

* bump MSRV to 1.75

required by zbus >= 4

* discovery: ensure that server and dns-sd backend shutdown gracefully

Previously, on drop the the shutdown_tx/close_tx, it wasn't guaranteed
the corresponding tasks would continue to be polled until they actually
completed their shutdown.

Since dns_sd::Service is not Send and non-async, and because libmdns is
non-async, put them on their own threads.

* discovery: use a shared channel for server and zeroconf status messages

* discovery: add Avahi reconnection logic

This deals gracefully with the case where the Avahi daemon is restarted
or not running initially.

* discovery: allow running when compiled without zeroconf backend...

...but exit with an error if there's no way to authenticate

* better error messages for invalid options with no short flag
2024-10-26 16:45:02 +02:00
Guillaume Desmottes
1912065248
Cargo: use rust-version from workspace (#1375)
Make it easier to check and update.
2024-10-17 17:01:56 +02:00
Roderick van Domburg
84d28e887b
Update Cargo.lock 2024-10-15 20:34:15 +02:00
Nick Steel
b1180fb674
Remove unused deps (#1352) 2024-09-30 21:31:26 +02:00
Nick Steel
4f9151c642
Credentials with access token (oauth) (#1309)
* core: Create credentials from access token via OAuth2

* core: Credentials.username is optional: not required for token auth.

* core: store auth data within session. We might need this later if need to re-auth and original creds are no longer valid/available.

* bin: New --token arg for using Spotify access token. Specify 0 to manually enter the auth code (headless).

* bin: Added --enable-oauth / -j option. Using --password / -p option will error and exit.

* core: reconnect session if using token authentication

Token authenticated sessions cannot use keymaster. So reconnect using the reusable credentials we just obtained. Can perhaps remove this
workaround once keymaster is replaced with login5.

* examples: replace password login with token login
2024-09-13 07:35:55 +02:00
yubiuser
dcd592bafb
Update MSRV to 1.74.0 and sysinfo to 0.31.3
Signed-off-by: yubiuser <github@yubiuser.dev>
2024-08-27 23:16:48 +02:00
Will Stott
2c871bbc96 Bump libmdns from 0.8.0 to 0.9.1 2024-08-24 17:31:34 +01:00
Christian König
b0170d142b
Bump MSRV to 1.73
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-06-10 18:50:38 +00:00
Christian König
ca035c9d17
Set MSRV in Cargo.toml files to 1.71
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-05-11 19:03:06 +00:00
Christian König
979d9d0aa0
Update sysinfo to 0.30.5
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-02-23 23:24:18 +01:00
Christian König
6532264b81
Update env_logger to 11.2
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-02-23 23:05:41 +01:00
David Sheets
ba314b63e4 Replace the apparently unmaintained hex crate with data-encoding
data-encoding was already a transitive dependency via tungstenite
2023-12-06 20:42:24 +00:00
Christian König
6f496334d2
Add webkpi 0.22.4 to dependencies
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-11-15 11:59:47 +01:00
Jason Gray
4d6de15a97
Discovery retry (#1178)
When started at boot as a service discovery may fail due to it
trying to bind to interfaces before the network is actually up.
This could be prevented in systemd by starting the service after
network-online.target but it requires that a wait-online.service is
also enabled which is not always the case since a wait-online.service
can potentially hang the boot process until it times out in certain situations.
This allows for discovery to retry every 10 secs in the 1st 60 secs of uptime
before giving up thus papering over the issue and not holding up the boot process.
2023-06-30 09:30:14 +02:00
yubiuser
e14dac3ff3
Remove and update dependencies (#1140) 2023-04-11 20:33:45 +02:00
Roderick van Domburg
2a79af1f0a
Migrate to Rust 2021 2022-08-02 21:42:38 +02:00
sqozz
d09ee4206c Add minimum rust version 2022-08-01 15:14:17 +02:00
Roderick van Domburg
786f8832d1
Update version numbers to 0.5.0-dev 2022-07-30 22:28:12 +02:00
Roderick van Domburg
37794c5b78
Merge branch 'new-api' into dev 2022-07-29 23:39:06 +02:00
Roderick van Domburg
6537c441c3
Update Cargo.lock 2022-07-29 22:05:10 +02:00
Roderick van Domburg
05b9b13cf8
Merge branch 'dev' into new-api and update crates 2022-07-27 23:31:11 +02:00
Roderick van Domburg
88e64bd884
Update Cargo.lock 2022-05-23 21:43:16 +02:00
JasonLG1979
c03d3ad102 Bump deps
This bumps deps that don't need major code refactoring or MSRV bumps.
2022-05-23 10:19:54 -05:00
Roderick van Domburg
dff19377fa
Update version numbers to 0.4.0 2022-05-21 22:31:15 +02:00
Roderick van Domburg
552d9145f4
Feature-gate passthrough decoder 2022-01-25 20:46:10 +01:00
Roderick van Domburg
59d00787c9
Update player crates and transitive dependencies 2022-01-09 16:04:53 +01:00
Roderick van Domburg
e51f475a00
Further initial loading improvements
This should fix remaining cases of a client connecting, and failing
to start playback from *beyond* the beginning when `librespot` is
still loading that track.

This undoes the `suppress_loading_status` workaround from #430,
under the assumption that the race condition reported there has
since been fixed on Spotify's end.
2021-12-29 22:27:31 +01:00
Roderick van Domburg
95776de74a
Fix compilation for with-dns-sd 2021-12-27 00:21:42 +01:00
Roderick van Domburg
b4f7a9e35e
Change to parking_lot and remove remaining panics 2021-12-26 23:02:02 +01:00
Roderick van Domburg
0e6b1ba9dc
Update version numbers to 0.3.1 2021-10-24 20:12:33 +02:00
Sasha Hilton
6a3377402a Update version numbers to 0.3.0 2021-10-13 15:10:18 +01:00
Hugo Osvaldo Barrera
51a697201b
Include a systemd.service file to run as a user (#800)
Include a systemd.service file to run as a user

This new `systemd.service` file allows running and controlling the service as
an unpriviledged user (generally, as part of a user session).
2021-06-18 11:40:44 +02:00
Roderick van Domburg
7c975f8ed0
Remove feature gate around apresolve 2021-06-01 20:43:23 +02:00
Roderick van Domburg
11dfedea3b
Remove with-vorbis and with-tremor features (#750) 2021-05-26 21:43:20 +02:00
Johannesd3
ebea5397b9
Add librespot-discovery crate 2021-05-19 21:05:19 +02:00
johannesd3
555274b5af
Move decoder to playback crate 2021-05-11 20:36:53 +02:00
johannesd3
85aa4eed89
Bump url and update Cargo.lock 2021-05-09 09:53:20 +02:00
Sasha Hilton
2ef3928691 Update version numbers to 0.2.0 2021-05-04 13:05:13 +01:00
johannesd3
f6a328c6ec
Bump getopts 2021-05-01 16:17:05 +02:00
johannesd3
e355d4a4f1
Add cache-size-limit command line argument 2021-04-21 11:29:32 +02:00
johannesd3
b7350b71da Restore previous feature flags
Some of the feature flags librespot uses are not really additive but
rather mutual exclusive. A previous attempt to improve the situation
had other drawbacks, so it's better to postpone a decision and restore
the old behaviour.
2021-04-10 12:50:30 +02:00
johannesd3
cb8c9c2afa Enable apresolve always in binary
Librespot-connect uses hyper anyway, so no one needs to disable it
only to reduce the number of dependencies. Furthermore, when using
another backend, people will use --no-default-features and will forget
to enable the apresolve feature again.
2021-04-10 12:50:30 +02:00
johannesd3
95fedf5357 Add back hyper-proxy 2021-03-27 15:36:33 +01:00
johannesd3
f22b41956f Update url crate to 2.1 2021-02-23 22:22:53 +01:00
johannesd3
18179e73ec Remove unused dependencies and fix feature flags 2021-02-23 22:22:53 +01:00
johannesd3
d064ffc670 Use tokio channels and fix compilation errors 2021-02-23 22:22:53 +01:00
johannesd3
746e6c863e Put lewton behind feature flag 2021-02-23 22:22:52 +01:00
johannesd3
8cff10e983 Put apresolve behind feature flag 2021-02-23 22:22:51 +01:00
johannesd3
c0942f14e8 Restore rodiojack support
Probably more simple than the previous approach which
doubles the code: Instead of implementing the `Open` trait,
we simply use custom SinkBuilder, one for the default host,
and one for the "jack" host.
2021-02-23 22:22:51 +01:00