Commit graph

252 commits

Author SHA1 Message Date
johannesd3
ddf41a49f2
Update lower version bound for some deps 2021-05-01 10:40:52 +02:00
Sasha Hilton
9d5ac1b156
Merge pull request #699 from Johannesd3/ready-macro
Use `ready!` macro to reduce boilerplate
2021-05-01 01:25:14 +01:00
johannesd3
de6bc32dea
Add documentation, logging and tests 2021-04-21 11:29:32 +02:00
johannesd3
e9dc9cd839
Add size limit to cache 2021-04-21 11:29:08 +02:00
johannesd3
7d6267c0a2
Use ready macro to reduce boilerplate 2021-04-17 12:23:24 +02:00
johannesd3
4c2fc61d64 Better joining of session tasks 2021-04-12 22:54:32 +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
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
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
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
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
johannesd3
5616004dbe Fix many clippy lints
...and other small improvements
2021-03-10 22:41:44 +01:00
Evan Cameron
6a33eb4efa
minor cleanup 2021-02-28 21:54:19 -05: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
18179e73ec Remove unused dependencies and fix feature flags 2021-02-23 22:22:53 +01:00
johannesd3
27f308b82f Replace error_chain by thiserror 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
678d1777fd Merge branch 'dev' into tokio_migration 2021-02-23 22:22:49 +01:00
Sasha Hilton
d8c1b491c4 Merge branch 'master' into dev 2021-02-22 00:57:45 +00:00
Sasha Hilton
b7c3609c7b Update version numbers to 0.1.6 2021-02-22 00:37:28 +00:00
Sasha Hilton
4e1c24d98d
Merge pull request #602 from Johannesd3/bumb_crypto_crates
Bump crypto crates
2021-02-21 23:29:00 +00:00
johannesd3
007e653f3d Restore original blocking player behaviour 2021-02-21 17:04:44 +01:00
johannesd3
2c81aaaf4e Implement MercurySender not as sink 2021-02-21 14:10:00 +01:00
johannesd3
daf7ecd23a Migrate librespot-connect to tokio 1.0 2021-02-21 14:09:31 +01:00
Sasha Hilton
7f705ed148 Merge branch 'master' into dev 2021-02-20 23:31:04 +00:00
Sasha Hilton
2c110ca256 Update version numbers to 0.1.5 2021-02-20 23:05:56 +00:00
johannesd3
bce4858b9e Add semver constant, rename "build id" env var 2021-02-17 15:04:16 +01:00
johannesd3
34733baa75 Bump crypto crates 2021-02-13 19:10:57 +01:00
johannesd3
b77f0a18ce Fix formatting 2021-02-13 10:29:00 +01:00
johannesd3
85be0d075a Adjust documentation 2021-02-12 20:21:07 +01:00
johannesd3
872fab62d8 Merge branch 'dev' into tokio_migration 2021-02-10 21:51:33 +01:00
Sasha Hilton
ea8ece36d9
Merge pull request #597 from librespot-org/config-update
Update CI MSRV, remove Travis. Minor tweaks to device discovery.
2021-02-10 00:48:31 +00:00
johannesd3
09e506ed66 Replace version functions by constants 2021-02-09 19:42:56 +01:00
Sasha Hilton
b72485cf46
Merge pull request #593 from Johannesd3/fix-issue-591 2021-02-09 13:54:47 +00:00
Sasha Hilton
deabf1f915 Minor updates to discovery and device types 2021-02-09 03:16:40 +00:00
Sasha Hilton
84ba421818
Merge pull request #566 from xou816/fix/map-auth-errors
fix: map authentication errors to a custom error type
2021-02-06 02:54:11 +00:00
Alexandre Trendel
71e9295ee8 fix: map authentication errors to a custom error type 2021-02-05 14:26:32 +01:00
johannesd3
3446864838 Handle corrupt cache files (#591) 2021-02-02 02:18:58 +01:00
Sasha Hilton
a09845ee7d
Merge pull request #582 from Johannesd3/refactor_cache_remove_volume 2021-02-02 01:08:07 +00:00
johannesd3
efedc678d0 Handle cache full situation 2021-01-31 10:00:02 +01:00
johannesd3
bb44b99c92 Use proxytunnel in apresolve
Implementing the tower_service::Service trait for a newly created
ProxyTunnel struct, so it can be used as connector in hyper.
2021-01-30 14:45:31 +01:00
johannesd3
c1d62d72a7 Fixed ProxyTunnel 2021-01-30 14:03:34 +01:00
johannesd3
a45fe85c27 Enable logging in test 2021-01-30 13:53:44 +01:00
johannesd3
e582f0a3fc Improved SpotifyId implementation
Moved conversion of SpotifyAudioType from and to &str directly to traits
Used a simpler and more idiomatic syntax in some places.
2021-01-29 11:50:50 +01:00
Michał Chojnacki
6b09836117 Refactor SpotifyId
- perf:
  * base62 encoding is an order of magnitude faster (~20x);
  * base16/62 enc/dec and from_uri are several times faster (~2-20x);
  * Let FileId::to_base16() reuse the hex encoder (~20x);

- changes:
  * Add to_uri() method;
  * Make from_uri() error handling consistent;
  * Move audio type from string matching to a SpotifyAudioType factory (private);
  * Implent From/Into<&str> for SpotifyAudioType;
  * Add representation sizes as associated constants (private);

- cs/docs:
  * Add rudimentary docs for most public funcs;
  * Add trivial test cases for the codecs;
2021-01-29 11:33:31 +01:00
johannesd3
07514c9dcc Add proxy support to apresolve 2021-01-25 20:55:49 +01:00
johannesd3
fd1f049572 Removed volume struct 2021-01-25 10:52:06 +01:00
johannesd3
fa5c9f7d11 Made locations in cache optional
The locations of credentials, volume and audio are now stored
in three separate Optional<PathBuf>s.
Removed the clearing of the cache if an error occurs. This might
be added again later.
2021-01-25 10:48:14 +01:00
johannesd3
14a004f84c Refactored Cache
Proper error handling, and moving the conversion between
{ credentials, volume } and file into the cache module
2021-01-25 10:47:42 +01:00
johannesd3
6c9d8c8d83 Replace pin_project and updated dependencies 2021-01-25 09:04:33 +01:00
johannesd3
6867ad0750 Added test 2021-01-25 09:04:33 +01:00
johannesd3
40e6355c34 Migrate core to tokio 1.0 2021-01-25 09:04:33 +01:00
Sasha Hilton
06f5aa9c90 Fix incorrect audio cache directory reference 2021-01-02 23:31:37 +00:00
Sasha Hilton
414383db18
Merge pull request #506 from LaurentLouf/feature-split_cache_folders
Feature split cache folders, resolves #505
2021-01-02 23:17:33 +00:00
Lyndon Brown
4fbbe44ab8 bump base64 dependency (v0.10 to v0.13)
very little changed, compiles fine after.
2020-12-14 11:53:54 +00:00
Lyndon Brown
0460429380 bump num-bigint dependency (v0.2 to v0.3)
compiles fine after version change; version changes seem to be very minimal.
2020-12-14 11:53:54 +00:00
Lyndon Brown
bc973d02dc bump uuid dependency from 0.7 to 0.8
seems compatible
2020-12-14 11:53:54 +00:00
Sasha Hilton
c8713a6c01
Merge pull request #518 from LaurentLouf/feature-handle_cache_full_situation
Handle cache full situation
2020-12-13 17:34:14 +00:00
Lyndon Brown
4708e0a2bf cargo toml formatting fix
for consistency
2020-11-26 19:31:51 +00:00
Lyndon Brown
f87cbd6fde add missing repo links to sub-crate cargo toml files
such that links are available from their crates.io pages to the project repo.
2020-11-26 19:30:37 +00:00
Laurent Louf
5f11ddea50 Main issue is probably when copying the content to the file, not during the file creation, but handle both cases just to be sure 2020-08-04 12:25:32 +02:00
Laurent Louf
9d832baf83 Instead of disabling audio cache, just clean the audio cache and start caching again from the current file 2020-08-03 13:18:23 +02:00
Laurent Louf
b34032690b Don't create directories for the audio cache if it disabled 2020-08-02 10:52:09 +02:00
Sasha Hilton
45f4276d68 Update version numbers to 0.1.3 2020-07-29 16:23:41 +01:00
Sasha Hilton
4886d4eed2
Merge pull request #504 from librespot-org/build-fixes
General fixes to protobuf bindings, depreciation warnings and publish.sh
2020-07-27 00:17:38 +01:00
Laurent Louf
c14c254c6b Format 2020-07-26 16:11:32 +02:00
ashthespy
99be49acd2 Set volume control default to log, clean up stray debugs 2020-07-25 09:52:21 +02:00
Ash
f0b3b2c7e8
Refactor Volume control, allow for a fixed volume option (#447)
Refactored the old `--linear-volume` flag to a more generic `--volume-ctrl` flag that takes the options of `[linear, log, fixed]`. It defaults as previously to log.
2020-07-25 09:38:08 +02:00
Sasha Hilton
16462b34e2 Accidentally bumped protobuf version 2020-07-25 04:50:58 +01:00
Sasha Hilton
e97911e3cf Generate proto bindings in OUT_DIR, remove precompiled bindings 2020-07-25 04:43:01 +01:00
Sasha Hilton
dc99cd73c0
Merge pull request #440 from tehcodedninja/SpotfyId-toURI
Ability to get the Spotify URI from a SpotifyId
2020-07-25 03:19:44 +01:00
Laurent Louf
f075a75aee Disable audio cache when there is an error trying to create a file 2020-07-25 01:20:08 +02:00
Laurent Louf
8fc9ebfa8c Add the option to specify the system cache for credentials and volume files and adapt Cache to use two cache directories instead of one 2020-07-24 23:18:29 +02:00
Sasha Hilton
4a21b5cbeb Fix depreciation warnings
Fixes error description depreciation warnings and removes unnecessary parentheses
2020-07-24 03:32:36 +01:00
Sasha Hilton
cd944035de
Merge pull request #476 from PlusMinus0/fix-utf-username
Fix utf username
2020-07-22 17:22:33 +01:00
Sasha Hilton
68949da7c2 Update version numbers to 0.1.2 2020-07-22 16:53:52 +01:00
Ash
72437bff66
Bump protobuf v2.8.1 -> v~2.14.0 and fix build issues (#485) 2020-07-22 12:47:25 +02:00
PlusMinus0
6f084d7ea5 Fix utf username. 2020-05-12 08:55:08 +02:00
Michael Pivonka
d47cc75dc6 Fixed formatting 2020-03-02 06:36:27 -05:00
Michael Pivonka
8939954bd7 Added to_uri function to spotify_id 2020-03-02 06:29:13 -05:00
Adam Nielsen
036f1f7cec
Make sequences wrap around to avoid overflows
Instead of aborting with an `attempt to add with overflow` error, wrap the sequence around so that it goes back to 0 once it has reached the maximum value for the integer type.  Fixes #437.
2020-02-23 11:27:38 +10:00
Sasha Hilton
6daa2acd0a Update version numbers to 0.1.1 2020-01-30 02:39:41 +01:00
Konstantin Seiler
65d1c1bf8e Proper error handling when connecting to the server. 2020-01-29 09:45:06 +11:00
Sasha Hilton
e9c3357e41 Run cargo fmt 2020-01-24 02:26:16 +01:00
Sasha Hilton
cdcb919c08
Merge branch 'dev' into connection-lost-crash 2020-01-24 01:02:40 +01:00
Konstantin Seiler
17821b26aa Rename variable to be in line with existing code. 2020-01-23 19:32:00 +11:00
Konstantin Seiler
ea1e0925dc Enable proper shutdown of the channels. 2020-01-23 01:23:34 +11:00
Konstantin Seiler
3fe3849588 Enable Mercury to be shut down and all pending requests being cancelled. 2020-01-23 01:14:43 +11:00
Konstantin Seiler
b6c676ad60 Prevent librespot from panicking if server connection is lost. 2020-01-22 21:55:45 +11:00
Konstantin Seiler
362106df62 Fix error handling for closed channel.
fixes #417
2020-01-22 16:58:21 +11:00
marcelbuesing
c9147d31ab
Turn child crates into rust 2018 edition 2020-01-17 20:54:05 +01:00
marcelbuesing
38d82f2dc2
Rerun rustfmt on full codebase 2020-01-17 18:47:30 +01:00
ashthespy
d26590afc5
Update to Rust 2018
- Fix deprecated Error::cause warnings and missing dyn
- Reset max_width
- Add rustfmt to Travis
- Run rustfmt on full codebase
 with `cargo fmt --all`
- Add rustfmt to Travis
- Complete migration to edition 2018
- Replace try! shorthand
- Use explicit `dyn Trait`
2020-01-17 18:11:52 +01:00