Commit graph

1209 commits

Author SHA1 Message Date
johannesd3
317e586472 Improve CI
Run the tests and add build for Windows.
2021-04-10 12:59:26 +02:00
johannesd3
ff499825e0 Add missing feature flag to tokio 2021-04-10 12:50:30 +02:00
johannesd3
690e0d2e10 Add simple tests to librespot-core
The first test checks whether apresolve works. A second test tries
to create a Spotify sessions with fake credentials and asserts that
an error is returned.
2021-04-10 12:50:30 +02:00
johannesd3
5435ab3270 Fix compile errors in backends
fe37186 added the restriction that `Sink`s must be `Send`. It turned
out later that this restrictions was unnecessary, and since some
`Sink`s aren't `Send` yet, this restriction is lifted again.

librespot-org/librespot#601 refactored the `RodioSink` in order to make
it `Send`. These changes are partly reverted in favour of the initial
simpler design.

Furthermore, there were some compile errors in the gstreamer backend
which are hereby fixed.
2021-04-10 12:50:30 +02:00
johannesd3
9a3a666856 Bump MSRV to 1.45 2021-04-10 12:50:30 +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
e688e7e886 Almost eliminate util module 2021-04-10 12:50:30 +02:00
johannesd3
9378ae5b6f Bump num-bigint dependency 2021-04-09 22:39:51 +02:00
johannesd3
7ddb1a20bb Reuse librespot-core's Diffie Hellman in discovery 2021-04-09 22:39:47 +02:00
johannesd3
11ce29077e Fix formatting 2021-04-09 10:45:48 +02:00
johannesd3
7c3d89112d Fix clippy warnings 2021-04-09 10:45:43 +02:00
johannesd3
f5274f5ada Merge branch 'dev' into tokio_migration 2021-04-09 10:39:06 +02:00
Sasha Hilton
6df977907e
Merge pull request #664 from philippe44/passthrough-update
separated stream for each seek
2021-04-09 01:40:12 +01:00
Ash
d4dfd4890f
Merge pull request #674 from Johannesd3/proxy-support
[Tokio migration] Add back hyper-proxy
2021-03-29 21:00:18 +02:00
johannesd3
95fedf5357 Add back hyper-proxy 2021-03-27 15:36:33 +01:00
Ash
1051f983ed
Merge pull request #663 from ThouCheese/tokio_migration
Update examples
2021-03-24 19:56:16 +01:00
ThouCheese
ec1ec59b8a update examples
Re-add default impl to SessionConfig and make Credentials::with_password generic over Into<String>

add docs for Credential

reintroduce old Default impl for SessionConfig

use the third argument for the track-to-play rather than a testing id
2021-03-24 01:14:44 +01:00
philippe44
86dbaa8ed5
true/false don't need to be explicit
Co-authored-by: Johannesd3 <51954457+Johannesd3@users.noreply.github.com>
2021-03-20 12:11:49 -07:00
Sasha Hilton
963d50e725
Merge pull request #658 from Johannesd3/refactor-audio-file-fetch
[Tokio migration] Refactor AudioFileFetch
2021-03-17 01:24:49 +00:00
johannesd3
ca255c17f0 Split file fetch.rs 2021-03-11 18:09:51 +01:00
johannesd3
e71a004e93 Refactor AudioFileFetch using async/await
Previously, polling `AudioFileFetch` consisted of three parts: Handling
stream loader commands, handling received data, and triggering preloading
in stream mode when the number of open requests is sufficiently small. The
first steps use channels which are polled, and if something's available,
it's handled. The third step is executed on every call of `poll`.

The first two could easily be refactored using a `tokio::select!`-loop.
Therefore, counting the number of open requests was also refactored to fit
into this scheme. They were previously counted using a shared
`AtomicUsize`. Now, the number of open requests is stored exclusively in
`AudioFileFetch`, increased on starting a request, and decreased by an
oneshot channel that is fired when a request is finished.

This allows us to `select` that channel in the loop too, and since
loading ahead makes only sense if the number of open requests decreases,
the third step is only executed in this case.

`AudioFileFetch` does not implement `Future` anymore, but is rather used
as helper struct in an async fn `audio_file_fetch`.
2021-03-11 18:08:00 +01:00
Ash
173a36332f
Merge pull request #667 from Johannesd3/small-fixes
Fix remaining clippy warnings
2021-03-11 15:19:09 +01:00
johannesd3
059b9029de Remove redundant field names 2021-03-10 22:41:46 +01:00
johannesd3
5616004dbe Fix many clippy lints
...and other small improvements
2021-03-10 22:41:44 +01:00
Ash
38761395d3
Merge pull request #652 from leshow/cleanup
clean up imports & clippy lints
2021-03-09 22:29:02 +01:00
Evan Cameron
3388508141
use current_thread 2021-02-28 22:09:46 -05:00
Evan Cameron
6a33eb4efa
minor cleanup 2021-02-28 21:54:19 -05:00
Philippe G
8dc1e80633 separated stream for each seek 2021-02-27 14:59:53 -08:00
Ash
9d77fef008
Merge pull request #649 from Johannesd3/tokio-migration-refactor-deps
[Tokio migration] Merge dev and refactor
2021-02-26 10:49:10 +01:00
Ash
56f1fb6dae
Merge pull request #595 from Johannesd3/const_versions
Replace version functions by constants
2021-02-26 10:47:44 +01:00
johannesd3
f22b41956f Update url crate to 2.1 2021-02-23 22:22:53 +01:00
johannesd3
b606d8c661 Replace "extern crate"s 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
59c556635e Clean up librespot-connect dependencies 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
f9c0e26f6d Simplify code 2021-02-23 22:22:52 +01:00
johannesd3
27f308b82f Replace error_chain by thiserror 2021-02-23 22:22:52 +01:00
johannesd3
45f42acb82 Refactor 'find_available_alternatives' 2021-02-23 22:22:52 +01:00
johannesd3
5aeb733ad9 Clean up dependencies in librespot-playback
* Use futures-util instead of futures
* Use tokio channels instead of futures channels
* Removed "extern crate"s
2021-02-23 22:22:52 +01:00
johannesd3
5c42d2e879 Clean up dependencies in librespot-audio
* Remove unused deps
* Use futures-util instead of futures
* Replace futures channels by tokio channels
* Remove unnecessary pin_project
* Reordered "use" statements
2021-02-23 22:22:52 +01:00
johannesd3
b83976a8ec Remove "extern crate"s from librespot-audio 2021-02-23 22:22:52 +01:00
johannesd3
746e6c863e Put lewton behind feature flag 2021-02-23 22:22:52 +01:00
johannesd3
a6ed6857d2 Clean up dependencies in librespot-metadata
* Replaced LinearMap by HashMap
* Removed unnecessary dependencies
* Removed "extern crate"s
2021-02-23 22:22:52 +01:00
johannesd3
10827bd6a8 Clean up dependencies of librespot-core
* Use sub-crates of future
* Remove unnecessary pin-project
* Removed unused crates and features
* Replace futures channels by tokio channels
* Use serde's "derive" feature flag instead of serde_derive
2021-02-23 22:22:51 +01:00
johannesd3
8cff10e983 Put apresolve behind feature flag 2021-02-23 22:22:51 +01:00
johannesd3
9253be7bc9 Small refactor of librespot-core
* Remove default impl for `SessionConfig`
* Move util mod to single file
* Restore privacy of mods
* Move `fn get_credentials` to application
* Remove `extern crate` statements
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
johannesd3
678d1777fd Merge branch 'dev' into tokio_migration 2021-02-23 22:22:49 +01:00
johannesd3
1fc5267a71 Revert "Merge pull request #548 from Lcchy/rodiojack-backend"
This reverts commit f483075b2c, reversing
changes made to ea8ece36d9.
2021-02-23 22:20:58 +01:00