Commit Graph

74 Commits

Author SHA1 Message Date
Thomas Frans
fe8f8e78ee style(clippy): enforce clippy use_self lint
Clippy's `use_self` line ensures that `Self` is used instead of the real
name whenever possible. This makes searching easier and cleans up the
code a bit.
2023-09-27 22:06:54 +02:00
Henrik Friedrichsen
66bb0746b6 Update to strum 0.25.0 2023-07-22 12:44:50 +02:00
Thomas Frans
6c990b5bda fix: config option command_key not working 2023-06-06 20:44:14 +02:00
Thomas Frans
c36d3cf272 refactor: move and add functions 2023-06-02 23:20:24 +02:00
Thomas Frans
04cbe8ac20 refactor: move base path config + documentation 2023-06-02 23:20:24 +02:00
Thomas Frans
6be45ece90 chore: document items in the config module
Sometimes the use of an item wasn't clear without reading the code. This
should help with that.
2023-06-02 23:20:24 +02:00
Thomas Frans
abffb3c2a9 refactor: move cli argument parsing to main
Command line arguments are part of the OS process and should be under
main.
2023-06-02 23:20:24 +02:00
inemajo
c2e030c2f0 Allow executing program to retrieve credentials
* config / authentication: permit to call external program for getting credentials

You can add into your ncspot/config.toml like this:

```
creds_username = "mylogin"
creds_passeval = "pass my_pass_path_to_spot_password"
```

Or using any password manager who send your password.to stdout.
If a newline is detected it will be automatically removed

* Move credential commands into separate structure

Also add an option for a username command

* Document credential commands

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2023-03-01 11:28:11 +01:00
Henrik Friedrichsen
8222f1b2e4 Use variables directly inside format strings
Most systems should have an up to date Rust compiler by now, so we should be
fine.
2023-02-06 20:15:43 +01:00
Harold Nieuwboer
8c0fbe5f43 Theme config support for HighlightInactive 2023-02-03 17:47:27 +01:00
Thomas
e15657ae67 fix(backtrace): Fix backtrace logging and stdout (#988)
* fix(backtrace): Fix backtrace logging and stdout
- Add manual implementation for panic that logs backtrace to a file.
- Remove all manual output to stdout.
- Fix new clippy warnings from Rust 1.65.

* Update docs

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2022-11-18 22:20:57 +01:00
Henrik Friedrichsen
8905db457a Implement category playlist browsing in library
Fixes #187
2022-08-20 22:32:25 +02:00
Henrik Friedrichsen
f5bf1d527f cargo clippy --fix 2022-08-17 19:41:23 +02:00
eulerfan271
593a4c9284 Add notification customization (#893)
* Add custom notification formatting

* Added `notification_format` to README

* cleaned up code formatting

* Fix typo

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2022-08-07 15:51:38 +02:00
Henrik Friedrichsen
249a4ef5a7 Add statusbar_format configuration option
Fixes #877
2022-07-31 11:24:22 +02:00
James Adam
ed10872ca3 Add 'hide_display_names' config option 2022-07-11 08:27:41 +02:00
Bettehem
f7450321da Add track_format config option (#800)
* Added track_name_first config option to allow choosing if artists' names should be shown before or after the track name.

* Added active_fields config option, which allows configuration of which columns are visible in Queue/Library view.
This also removes the need for a separate track_name_first and album_column option.

* Fixed README

* Made custom tracklist formatting more flexible.
Updated readme with new instructions.
Reformatted impl member order to match the definitions in traits.rs.

* Added track_name_first config option to allow choosing if artists' names should be shown before or after the track name.

* Added active_fields config option, which allows configuration of which columns are visible in Queue/Library view.
This also removes the need for a separate track_name_first and album_column option.

* Fixed README

* Made custom tracklist formatting more flexible.
Updated readme with new instructions.
Reformatted impl member order to match the definitions in traits.rs.

* Fetch formatting config from library config

Instead of the lazy static mutex

* Moved custom format function to Playable impl as it's a better location to handle both Tracks and Episodes

* Rename from `tracklist_formatting` to `track_format`

Also shorten `format_{left|center|right}` to `{left|center|right}`

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2022-05-28 14:13:37 +02:00
Henrik Friedrichsen
cef6eb43b0 Add option to customize library tabs
New option is called `library_tabs`. By default all tabs are enabled.

Fixes #798
2022-05-10 22:59:49 +02:00
Bettehem
dfecb759a0 Added playback_state config option (#783)
* Added playback_state config option.
It can be used to pre-define a certain playback state for the player.

* Changed playback_state to use enums and removed redundant check for the "Playing" state.
2022-04-28 10:03:17 +02:00
Henrik Friedrichsen
550fa6acf4 Add cache_version flag to saved state
Can be used to determine whether the cache file format has been broken after an update.
If so, the cache will be discarded and recreated.
2021-11-30 20:43:58 +01:00
Henrik Friedrichsen
74b4e65b64 Refactor: move playable models to separate module 2021-11-08 20:44:21 +01:00
Henrik Friedrichsen
ec640581bc Add initial_screen config variable
Resolves #616
2021-10-15 17:20:12 +02:00
Henrik Friedrichsen
0c69e991b8 Upgrade to librespot 0.3.0
- logarithmic volume conversion is now done by librespot
- use default normalisation threshold
2021-10-14 23:41:00 +02:00
Henrik Friedrichsen
d731fe7188 Make command_key configurable
Fixes #487
2021-07-27 01:35:21 +02:00
Henrik Friedrichsen
2a82826e7a Add commandline flag for custom config filename
Related to #565
2021-07-22 17:17:57 +02:00
Henrik Friedrichsen
b42315d113 Add flip_status_indicators setting
Fixes #511
2021-05-14 17:41:19 +02:00
Henrik Friedrichsen
5fd93c33cb Add audio_cache_size to set maximum cache size 2021-05-07 23:14:26 +02:00
Henrik Friedrichsen
71d42d489e Remove extern crate statements
https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html
2021-05-07 22:51:32 +02:00
Henrik Friedrichsen
50fcab4d7a Store user state in binary CBOR format
The state structure is growing a little too complex to store it as a TOML.
User state is now stored at `~/.config/ncspot/userstate.cbor`.
2021-04-11 00:47:49 +02:00
Henrik Friedrichsen
e61e18608b Move config (de)serialization to separate file 2021-04-11 00:46:25 +02:00
Christopher Hasse
8c68347c24 Allow creation of default userstate.toml file
Serializing an empty `Vec<Playable>` causes serde to panic as described
in #485 This commit tells serde not to serialize `queue` if it is an
empty `Vec`.
2021-04-10 14:59:37 +02:00
Henrik Friedrichsen
cea5228245 (Re)store currently playing track + shuffle state
Solves #448
2021-04-09 19:10:34 +02:00
Henrik Friedrichsen
ca8f1a8545 Persist sorting orders for playlists
Closes #436
2021-03-05 21:54:29 +01:00
KoffeinFlummi
df87ff9bdd Implement cover drawing as optional feature 2021-02-27 13:14:49 +01:00
Henrik Friedrichsen
db894d7ce8 Add config values to override shuffle/repeat state 2021-02-25 21:07:12 +01:00
Henrik Friedrichsen
92d1978340 Save track queue when closing and restore at start 2021-02-22 22:14:34 +01:00
Henrik Friedrichsen
a880ffd1f6 Persist volume and shuffle/repeat state 2021-02-22 22:14:34 +01:00
Qluxzz
9bc98f70fd Expose gapless playback config option 2021-01-08 09:40:50 +01:00
Henrik Friedrichsen
013beb245b refactor: pass globally mutable config reference
Before, copies of the configuration were passed over. This change also
causes configuration reloads to affect the entire application and is
easier to maintain but introduces some RwLock overhead.
2020-10-18 13:09:45 +02:00
Henrik Friedrichsen
e1b4892b8a make album column for tracks configurable
introduces new config variable `album_column`

fixes #267
2020-10-17 23:56:23 +02:00
Henrik Friedrichsen
f00580b97e highlight search query matches in listviews 2020-10-15 23:43:18 +02:00
Mario Rodas
6bb2c08705 Replace directories with platform_dirs create
`directories` create is no longer maintained, and uses
`~/Library/Preferences` on MacOS, but Apple advises against creating
files in `Preferences`.

`platform-dirs` allows to use `~/.config` on MacOS.
2020-10-12 10:46:36 +02:00
eulerfan271
9e970f5799 Added config option for bitrate (#270)
* added config option for bitrate

* updated README.md to include bitrate config options
2020-09-22 17:01:56 +02:00
Henrik Friedrichsen
e5bc12b1ba use cfg of spotify object
TODO:
- apply this to other single config values that are passed directly, e.g. in the
  statusbar
- use a more appropriate object to hold `cfg`
2020-08-18 23:06:41 +02:00
Ronak Buch
097f59eb83 Add notifications 2020-08-18 23:06:38 +02:00
Henrik Friedrichsen
4f71b2489b implement command to reload config (#243)
* implement command to reload themes

* refresh keybindings after config reload
2020-08-12 01:12:08 +02:00
Henrik Friedrichsen
65126c5c78 add configuration value to drop default keybindings
resolves #204
2020-06-18 19:33:46 +02:00
Henrik Friedrichsen
91ce808ef8 support configuration of audio backend and backend device
fixes #194
2020-05-19 00:05:32 +02:00
Henrik Friedrichsen
d04766160d implement audio_cache setting
fixes #196
2020-05-14 22:11:35 +02:00
Henrik Friedrichsen
85bc898830 implement volume normalization setting
fixes #195
2020-05-14 21:48:09 +02:00