Commit graph

1526 commits

Author SHA1 Message Date
JasonLG1979 368bee1088 condense some option parsings 2021-12-13 18:43:28 -06:00
JasonLG1979 d29337c62d Dry up error messages. 2021-12-12 23:25:19 -06:00
Roderick van Domburg 8f23c3498f
Clean up warnings 2021-12-12 20:01:05 +01:00
Roderick van Domburg 79c4040a53
Skip track on decoding error 2021-12-12 12:56:02 +01:00
JasonLG1979 8c480b7e39 Fix Command line arguments incorrectly echoed in TRACE
Fix up for #886
Closes: #898

And...

* Don't silently ignore non-Unicode while parsing env vars.

* Iterating over `std::env::args` will panic! on invalid unicode. Let's not do that. `getopts` will catch missing args and exit if those args are required after our error message about the arg not being valid unicode.

* Gaurd against empty strings. There are a few places while parsing options strings that we don't immediately evaluate their validity let's at least makes sure that they are not empty if present.

* `args` is only used in `get_setup` it doesn't need to be in main.

* Nicer help header.

* Get rid of `use std::io::{stderr, Write};` and just use `rpassword::prompt_password_stderr`.

* Get rid of `get_credentials` it was clunky, ugly and only used once. There is no need for it to be a separate function.

* Handle an empty password prompt and password prompt parsing errors.

* + Other random misc clean ups.
2021-12-11 16:24:09 -06:00
Roderick van Domburg 9a93cca562
Get connection ID 2021-12-11 23:06:58 +01:00
Roderick van Domburg 9a31aa0362
Pretty-print trace messages 2021-12-11 20:45:08 +01:00
Roderick van Domburg e748d543e9
Check availability from the catalogue attribute 2021-12-11 20:22:44 +01:00
Roderick van Domburg 51b6c46fcd
Receive autoplay and other attributes 2021-12-11 16:43:34 +01:00
Roderick van Domburg 9a0d2390b7
Get user attributes and updates 2021-12-11 00:03:35 +01:00
Roderick van Domburg 40163754bb
Update protobufs to 1.1.73.517 2021-12-10 20:33:43 +01:00
Roderick van Domburg 4f51c1e810
Report actual CPU, OS, platform and librespot version 2021-12-09 19:01:54 +01:00
Roderick van Domburg f3bb679ab1
Rid of the last remaining clippy warnings 2021-12-08 21:00:42 +01:00
Roderick van Domburg 33620280f5
Fix build on Cargo 1.48 2021-12-08 20:44:48 +01:00
Roderick van Domburg f74c574c9f
Fix lyrics and add simpler endpoint 2021-12-08 20:27:15 +01:00
Roderick van Domburg 9b2ca1442e
Move FileId out of SpotifyId 2021-12-08 19:53:45 +01:00
Roderick van Domburg f03a7e95c1
Merge remote-tracking branch 'librespot-org/dev' into new-api-wip 2021-12-08 19:11:53 +01:00
Roderick van Domburg 87f6a78d3e
Fix examples 2021-12-07 23:52:34 +01:00
Roderick van Domburg 0e2686863a
Major metadata refactoring and enhancement
* Expose all fields of recent protobufs

 * Add support for user-scoped playlists, user root playlists and
   playlist annotations

 * Convert messages with the Rust type system

 * Attempt to adhere to embargos (tracks and episodes scheduled for
   future release)

 * Return `Result`s with meaningful errors instead of panicking on
   `unwrap`s

 * Add foundation for future playlist editing

 * Up version in connection handshake to get all version-gated features
2021-12-07 23:22:24 +01:00
Roderick van Domburg 7160dc1017
Merge pull request #897 from JasonLG1979/clippy-lints
Address clippy lint warnings from Rust 1.57
2021-12-03 20:07:56 +01:00
JasonLG1979 4370258716 Address clippy lint warnings for rust 1.57 2021-12-03 12:51:41 -06:00
Jason Gray e66cc5508c
parse environment variables (#886)
Make librespot able to parse environment variables for options and flags.

To avoid name collisions environment variables must be prepended with `LIBRESPOT_` so option/flag `foo-bar` becomes `LIBRESPOT_FOO_BAR`.

Verbose logging mode (`-v`, `--verbose`) logs all parsed environment variables and command line arguments (credentials are redacted).
2021-12-01 21:29:58 +01:00
Roderick van Domburg 47badd61e0
Update tokio and fix build 2021-11-27 14:26:13 +01:00
Roderick van Domburg f037a42908
Migrate and expand playlist protos 2021-11-27 11:59:22 +01:00
Roderick van Domburg a73e05837e
Return HttpClientError for status code <> 200 2021-11-27 10:41:54 +01:00
Roderick van Domburg e1b273b8a1
Fix lyrics retrieval 2021-11-27 08:30:51 +01:00
Roderick van Domburg d19fd24074
Add spclient and HTTPS support
* Change metadata to use spclient
 * Add support for HTTPS proxies
 * Start purging unwraps and using Result instead
2021-11-26 23:28:37 +01:00
Nick Botticelli 56585cabb6
Add Google sign in credential to protobufs 2021-11-26 23:28:37 +01:00
Tom Vincent bbd575ed23
Harden systemd service, update restart policy (#888) 2021-11-26 19:49:50 +01:00
Roderick van Domburg 97399e2c0a
Merge pull request #883 from JasonLG1979/improve_device_list_outputs
Improve `--device ?` functionality for the alsa backend
2021-11-25 09:45:36 +01:00
JasonLG1979 c006a23644 Improve --device ? functionality for the alsa backend
This makes `--device ?` only show compatible devices (ones that support 2 ch 44.1 Interleaved) and it shows what `librespot` format(s) they support.

This should be more useful to users as the info maps directly to `librespot`'s `--device` and `--format` options.
2021-11-20 13:51:24 -06:00
Roderick van Domburg e064f27c13
Merge pull request #880 from JasonLG1979/fix_index_out_bounds_spirc
Guard against tracks_len being zero
2021-11-19 21:52:39 +01:00
JasonLG1979 3016d6fbdb Guard against tracks_len being zero
to prevent 'index out of bounds: the len is 0 but the index is 0'
https://github.com/librespot-org/librespot/issues/226#issuecomment-971642037
2021-11-17 21:15:35 -06:00
Roderick van Domburg 85d6049ee7
Merge pull request #875 from JasonLG1979/refactor-main
Refactor main.rs
2021-11-17 22:44:22 +01:00
JasonLG1979 0e9fdbe6b4 Refactor main.rs
* Don't panic when parsing options. Instead list valid values and exit.
* Get rid of needless .expect in playback/src/audio_backend/mod.rs.
* Enforce reasonable ranges for option values (breaking).
* Don't evaluate options that would otherwise have no effect.
* Add pub const MIXERS to mixer/mod.rs very similar to the audio_backend's implementation. (non-breaking though)
* Use different option descriptions and error messages based on what backends are enabled at build time.
* Add a -q, --quiet option that changed the logging level to warn.
* Add a short name for every flag and option.
* Note removed options.
* Other misc cleanups.
2021-11-17 15:31:16 -06:00
Roderick van Domburg 45b19efd03
Merge pull request #874 from JasonLG1979/kill-the-undead
Prevent librespot from becoming a zombie
2021-10-30 20:27:42 +02:00
JasonLG1979 24e4d2b636 Prevent librespot from becoming a zombie
Prevent hang when discovery is disabled and there are no credentials or when bad credentials are given.
2021-10-28 09:13:46 -05:00
Roderick van Domburg 5049cd76e0
Merge pull request #872 from JasonLG1979/add-disable-credential-cache-flag
Add disable credential cache flag
2021-10-28 15:18:34 +02:00
JasonLG1979 9e017119bb Address review change request 2021-10-27 14:47:33 -05:00
Jason Gray fefd432773
Merge branch 'librespot-org:dev' into add-disable-credential-cache-flag 2021-10-27 14:42:24 -05:00
Roderick van Domburg bd39a362f7
Merge pull request #873 from jannuary/patch-1
README: Mention Spot
2021-10-27 20:50:46 +02:00
JasonLG1979 e543ef72ed Clean up cache logic in main 2021-10-27 10:14:40 -05:00
Noëlle 81e7c61c17
README: Mention Spot 2021-10-27 20:03:14 +07:00
JasonLG1979 9152ca8159 Update changelog 2021-10-26 22:20:24 -05:00
JasonLG1979 52bd212e43 Add disable credential cache flag
As mentioned in https://github.com/librespot-org/librespot/discussions/870, this allows someone who would otherwise like to take advantage of audio file and volume caching to disable credential caching.
2021-10-26 22:06:52 -05:00
Roderick van Domburg b4784ebf9c
Merge pull request #871 from roderickvd/update-crates
Update crates
2021-10-26 21:40:58 +02:00
Roderick van Domburg 72b2c01b3a
Update crates 2021-10-26 20:10:39 +02:00
Roderick van Domburg c1ac4cbb3a
Update Cargo.lock for 0.3.1 2021-10-24 20:24:28 +02:00
Roderick van Domburg 0e6b1ba9dc
Update version numbers to 0.3.1 2021-10-24 20:12:33 +02:00
Roderick van Domburg 9d19841c0f
Prepare for 0.3.1 release 2021-10-24 20:07:11 +02:00