Commit graph

98 commits

Author SHA1 Message Date
Roderick van Domburg
e2eca65d11
chore: bump to v0.6.0-dev 2024-10-31 23:14:13 +01:00
Roderick van Domburg
797efeafaf
chore: prepare for 0.6.0 release 2024-10-30 21:11:04 +01:00
fivebanger
1d3771a83b
Get token with client (#1385)
Co-authored-by: fivebanger <fivebanger@gmx-topmail.de>
2024-10-30 20:24:01 +01:00
Roderick van Domburg
f96f36c064
Fix "source slice length does not match destination" panic on some tracks
Fixes #1188

Co-authored-by: thedtvn <duongtuan30306@gmail.com>
2024-10-27 15:59:25 +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
Felix Prillwitz
2e655e7f80
Easier mocking of platforms (#1378)
* core: move OS info into config.rs
2024-10-21 22:11:38 +02:00
Felix Prillwitz
4580dab73f
Get access token via login5 (#1344)
* core: Obtain spclient access token using login5 instead of keymaster (Fixes #1179)
* core: move solving hashcash into util
* login5: add login for mobile

---------

Co-authored-by: Nick Steel <nick@nsteel.co.uk>
2024-10-19 20:27:26 +02:00
Artur H.
d8e84238ab
Fix initial volume showing zero but playing full volume (#1373) 2024-10-17 17:02:56 +02:00
Roderick van Domburg
1d80a4075f
Create new changelog entry for next release 2024-10-15 21:32:50 +02:00
Roderick van Domburg
b629f61f67
Prepare for v0.5.0 release 2024-10-15 19:00:51 +02:00
Ernst
0ddb3b4cb6
Exposing service to both IPv4 and IPv6, addressing remaining issues from # (#1366)
* create dual stack socket on non-windows systems only

---------

Co-authored-by: Anders Ballegaard <giithub@anderstb.dk>
2024-10-06 22:11:57 +02:00
Nick Steel
118a9e1a51
core: AP connection attempts have 3 sec timeout. (#1350)
Some checks failed
test / cargo fmt (push) Failing after 21s
test / cargo +${{ matrix.toolchain }} clippy (${{ matrix.os }}) (ubuntu-latest, stable) (push) Has been skipped
test / cargo +${{ matrix.toolchain }} check (${{ matrix.os }}) (false, ubuntu-latest, 1.74) (push) Has been skipped
test / cargo +${{ matrix.toolchain }} check (${{ matrix.os }}) (false, ubuntu-latest, stable) (push) Has been skipped
test / cargo +${{ matrix.toolchain }} check (${{ matrix.os }}) (true, ubuntu-latest, beta) (push) Has been skipped
test / cargo +${{ matrix.toolchain }} check (${{ matrix.os }}) (windows-latest, 1.74) (push) Has been skipped
test / cargo +${{ matrix.toolchain }} check (${{ matrix.os }}) (windows-latest, stable) (push) Has been skipped
test / cross +${{ matrix.toolchain }} build ${{ matrix.target }} (ubuntu-latest, aarch64-unknown-linux-gnu, 1.74) (push) Has been skipped
test / cross +${{ matrix.toolchain }} build ${{ matrix.target }} (ubuntu-latest, aarch64-unknown-linux-gnu, stable) (push) Has been skipped
test / cross +${{ matrix.toolchain }} build ${{ matrix.target }} (ubuntu-latest, armv7-unknown-linux-gnueabihf, 1.74) (push) Has been skipped
test / cross +${{ matrix.toolchain }} build ${{ matrix.target }} (ubuntu-latest, armv7-unknown-linux-gnueabihf, stable) (push) Has been skipped
test / cross +${{ matrix.toolchain }} build ${{ matrix.target }} (ubuntu-latest, riscv64gc-unknown-linux-gnu, 1.74) (push) Has been skipped
test / cross +${{ matrix.toolchain }} build ${{ matrix.target }} (ubuntu-latest, riscv64gc-unknown-linux-gnu, stable) (push) Has been skipped
2024-09-25 21:34:59 +02:00
Nick Steel
e02e4ae224
core: retry Session access-point connection (#1345)
Tries multiple access-points with a retry for each one, unless there was a login failure.
2024-09-23 20:44:51 +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
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
d8e7f4f618
Update MSRV to 1.71.0
Signed-off-by: Christian König <ckoenig@posteo.de>
2024-02-24 13:23:17 +01:00
Christian König
dd28667178 Update MSRV to 1.70
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-23 21:54:17 +02:00
Christian König
1c214f7f0e Update MSRV to 1.67
Signed-off-by: Christian König <ckoenig@posteo.de>
2023-08-23 21:54:17 +02:00
Jarkko Lehtoranta
b1c6641723
Update changelog (#1176) 2023-07-19 14:57:44 +03: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
eladyn
4d402e690c
add session timeout handling (#1129) 2023-06-01 21:39:35 +02:00
yubiuser
c964102a34
Update dependencies sysinfo and RSA (#1164) 2023-05-14 21:27:17 +02:00
AeRo
31d18f7e30
Respect disabled normalisation with maximum volume (#1159) 2023-05-06 09:47:08 +02:00
George Hahn
e8f93c44fd Fix NamedSpotifyId::to_uri 2023-01-28 02:56:09 -07:00
Roderick van Domburg
7a01a3e442
Merge pull request #1089 from GeorgeHahn/microsecond-timestamps
Handle microsecond timestamps
2023-01-04 20:37:56 +01:00
Roderick van Domburg
61ae66b998
Merge pull request #1088 from GeorgeHahn/support-named-playlist-ids
Parse playlist URIs with named IDs
2023-01-04 20:36:16 +01:00
George Hahn
c2c31247b5 changelog 2023-01-03 22:28:36 -07:00
George Hahn
7a259ccc4b Parse named ID URIs 2023-01-02 16:27:40 -07:00
Guillaume Desmottes
f72048e5e1 metadata: add lyrics
Save users from doing all the parsing themselves.
2023-01-02 19:00:10 +01:00
Oliver Cooper
edf646d4bb
Add activate and load functions to Spirc (#1075) 2022-12-03 12:25:27 +01:00
ealasu
5cfdb8c9dd Parse local file IDs 2022-12-02 17:24:02 -07:00
setime
bf7cbbaadd
Add an option to specify IPs that zeroconf will bind to (#1071)
* added an option to specify ip addresses to which mDNS should bind (ignored by `DNS-SD`)
* changed command line option to `zeroconf-interface` to be consistent with `zeroconf-port`
use builder pattern to DRY up the code
used macro to print warning message
* fixing register error
* renamed `bind_ip` variables to match the option to `zeroconf_ip`, to be more consistent
* Changed user help
Modified comments
Added block for condition to clean the code
Added new modification to the change log

Co-authored-by: setime <timeframe1@gmx.de>
2022-11-25 09:57:14 +01:00
Roderick van Domburg
bfb7d5689c
Retrieve autoplay contexts over HTTPS and fix repeat/prev/next
Repeat, previous and next used to start playback regardless of
the actual playback state. They now start playback only if we
were already playing.
2022-09-30 21:36:20 +02:00
Roderick van Domburg
6dc7a11b09
Re-introduce autoplay command-line option as an override 2022-09-28 22:59:03 +02:00
Roderick van Domburg
cc1fb5a406
Update changelog 2022-09-28 22:17:43 +02:00
JasonLG1979
8545f361c4 Major Events Overhaul
Special thanks to @eladyn for all of their help and suggestions.

* Add all player events to `player_event_handler.rs`

* Move event handler code to `player_event_handler.rs`

* Add session events

* Clean up and de-noise events and event firing

* Added metadata support via a TrackChanged event

* Add `event_handler_example.py`

* Handle invalid track start positions by just starting the track from the beginning

* Add repeat support to `spirc.rs`

* Add `disconnect`, `set_position_ms` and `set_volume` to `spirc.rs`

* Set `PlayStatus` to the correct value when Player is loading to avoid blanking out the controls when `self.play_status` is `LoadingPlay` or `LoadingPause` in `spirc.rs`

* Handle attempts to play local files better by basically ignoring attempts to load them in `handle_remote_update` in `spirc.rs`

* Add an event worker thread that runs async to the main thread(s) but sync to itself to prevent potential data races for event consumers.

* Get rid of (probably harmless) `.unwrap()` in `main.rs`

* Ensure that events are emited in a logical order and at logical times

* Handle invalid and disappearing devices better

* Ignore SpircCommands unless we're active with the exception of ShutDown
2022-09-17 16:21:10 -05:00
Roderick van Domburg
e9f3b6d290
Catch-up changelog 2022-07-31 00:04:08 +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
38bebc242a
Prepare for 0.4.2 release 2022-07-29 21:34:01 +02:00
Roderick van Domburg
87ea69b457
Blacklist ap-gue1.spotify.com access point 2022-07-29 21:30:27 +02:00
Roderick van Domburg
7bd9186e94
Blacklist ap-gew4 access point (#1026) 2022-07-28 18:51:49 +02:00
JasonLG1979
582fdebadd Update Changelog
This should update the changelog for my last 3 PR's.
2022-07-20 20:27:45 -05:00
JasonLG1979
e4deb5ddcd Fix fixed volume with hardware mixer.
fixes https://github.com/librespot-org/librespot/issues/1008
2022-06-09 16:34:42 -05:00
Roderick van Domburg
fc1e74574a
Update changelog 2022-05-23 22:21:56 +02:00
JasonLG1979
79b92bbe7a Update changelog and such 2022-05-23 13:42:38 -05:00
Roderick van Domburg
5568c70cd1
Prepare for new developments 2022-05-21 22:52:39 +02:00
Roderick van Domburg
310b3cca81
Prepare for 0.4.0 release 2022-05-21 22:14:18 +02:00
Sean McNamara
3d298768b3
Backport #964 GStreamer backend cleanup (#979) 2022-05-21 20:55:55 +02:00
Louis Seubert
6c2491b9a3
adding callback for reusable credentials (#983)
This allows more control over how the credentials are saved to the cache
2022-05-20 12:53:44 +02:00