Henrik Friedrichsen
63722c5be3
Fix: Use buffered backend to prevent flickering
...
This is reported to be occuring with the Cursive Termion backend as it redraws
the screen every time, resulting in flickering for some users.
Should be removed once Cursive has integrated this.
See also:
- https://github.com/gyscos/cursive/issues/142
- https://github.com/gyscos/cursive/issues/667
Fixes #934
2022-09-11 23:34:24 +02:00
Henrik Friedrichsen
4315cdc077
Add CursiveExt trait
...
For easier usage of shared logic involving the `Cursive` instance.
2022-08-19 00:18:34 +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
c41294cb8d
Update to librespot 0.4.0
...
Changes: https://github.com/librespot-org/librespot/compare/v0.3.1..v0.4.0
2022-05-22 17:15:02 +02:00
Henrik Friedrichsen
2a14a6de43
Fix clap deprecation warnings
2022-02-18 22:05:29 +01:00
Henrik Friedrichsen
06c6ea316e
Migrate to cursive 0.17
2022-01-11 20:42:50 +01:00
Henrik Friedrichsen
68b3b9b510
Fix warnings
2022-01-09 21:39:14 +01:00
dependabot[bot]
4d1388e5bd
Bump clap from 2.34.0 to 3.0.0 ( #689 )
...
* Bump clap from 2.34.0 to 3.0.0
Bumps [clap](https://github.com/clap-rs/clap ) from 2.34.0 to 3.0.0.
- [Release notes](https://github.com/clap-rs/clap/releases )
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md )
- [Commits](https://github.com/clap-rs/clap/compare/v2.34.0...clap_complete-v3.0.0 )
---
updated-dependencies:
- dependency-name: clap
dependency-type: direct:production
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] <support@github.com >
* Adapt to clap v3 changes
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org >
2022-01-01 21:04:02 +01:00
cyqsimon
9771c36c7b
More detailed error message in case of command parse error ( #684 )
...
* Refactored `command::parse`
* Removed unnecessary duplication in error msg
* Renamed `NotEnoughArgs` -> `InsufficientArgs`
* Inaccurate var name
* Ditch wordy error prefix
* Use `split_whitespace` instead of regex
* Cleanup unused regex import
* `insert` cmd fails fast
* Refactor: use `and_then` instead of `unwrap`
* Updated `Command::to_string`
* Added `Command::basename`
* Better err msg when running cmd in unsupported view, fully closes #597
* Sort `match` branches by their order in the enum
2022-01-01 20:48:34 +01:00
Henrik Friedrichsen
075ecd0e24
Set terminal title to ncspot
...
Fixes #685
2021-12-31 16:18:48 +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
George Hafiz
49f2d40b44
Add userRating entity to mpris metadata, with 0 and 1 corresponding to unsaved/not-liked and saved/liked in Spotify, respectively.
2021-10-15 16:26:37 +02:00
HMH
102acd803e
Enable binding multiple commands to a key.
...
This enables useful combinations of commands like `Space -> queue; move
down 1` using ';' as command separator. ';' can be escaped using ';;'.
2021-09-11 21:40:00 +02:00
Henrik Friedrichsen
faad362f55
Refactor: separate Spotify API from player logic
...
The separation is not perfect yet, but it's a start and makes the entire codebase much easier to read.
2021-08-23 22:15:54 +02:00
Henrik Friedrichsen
d731fe7188
Make command_key configurable
...
Fixes #487
2021-07-27 01:35:21 +02:00
Henrik Friedrichsen
6bd83ce9c8
Don't panic if user quits login process
...
Fixes #479
2021-07-26 18:50:08 +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
9eb99cc8be
cargo clippy
2021-07-11 01:38:57 +02:00
Henrik Friedrichsen
0d405cf221
Print Spotify connection message only once
...
To avoid the terminal output getting garbled when ncspot is reconnecting
2021-05-24 21:03:25 +02:00
Henrik Friedrichsen
a2873d2438
Fix cfg borrow with cover feature
...
Fixes : #534
2021-05-20 17:01:55 +02:00
Henrik Friedrichsen
b42315d113
Add flip_status_indicators setting
...
Fixes #511
2021-05-14 17:41:19 +02:00
Henrik Friedrichsen
f6a895e160
Update to librespot 0.2.0 and Tokio v1
...
This also brings some much need async/.await rewrites
2021-05-07 22:51:32 +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
9cad68b8b0
Display error when command can not be parsed
...
fixes #161
2021-05-01 23:48:09 +02:00
Henrik Friedrichsen
b80e018079
Remove libc dependency + setlocale call
...
This is already taken care of in Cursive:
e2f79776a4
2021-05-01 22:53:23 +02:00
Henrik Friedrichsen
98e572169b
Implement track preloading
...
Will preload the next track close to the end of the currently playing
track. Should make playback of queued tracks a little smoother.
2021-04-11 15:54:32 +02:00
Henrik Friedrichsen
e61e18608b
Move config (de)serialization to separate file
2021-04-11 00:46:25 +02:00
Henrik Friedrichsen
32cb6e70d3
Show tracks + duration of album, playlist, queue
...
Stats are in the top right
Fixes #475
2021-04-08 22:26:19 +02:00
Henrik Friedrichsen
0f573f8247
Refactor: Make Spotify cloneable
2021-04-03 22:35:08 +02:00
Henrik Friedrichsen
8483653cde
Refactor: extract Spotify Worker to separate file
2021-04-03 21:38:42 +02:00
Henrik Friedrichsen
d6db7a54d6
Remove plain-text credential store
...
librespot stores a more secure token that is valid for a while, rely on this
instead.
On the flip side this requires users to re-enter their login data when their
token has expired.
If the token validity is too short we will have to come up with another
approach, e.g. OS keyrings.
fixes #447
2021-03-05 23:47:12 +01:00
KoffeinFlummi
df87ff9bdd
Implement cover drawing as optional feature
2021-02-27 13:14:49 +01:00
Alexandre Bury
cfb91493a5
Update to cursive 0.16
2021-01-19 21:47:18 +01:00
André Andersson
ed0c62a888
Add support for open.spotify.com links ( #392 )
...
* No longer necessary
* Add support for open.spotify.com links
* Reuse struct for insert command
* Formatting
2021-01-17 20:12:07 +01:00
Henrik Friedrichsen
a216af91ac
remember view stacks separately for screens
...
Previously, the stack would be reset when switching between screens.
With the new search flow this means that search results are lost, e.g. when switching
from search results to the queue and back.
2021-01-10 01:42:23 +01:00
Henrik Friedrichsen
254c7a3856
refactor: differentiate between screens and views
2021-01-09 23:23:57 +01:00
Henrik Friedrichsen
18dc6c6bf8
separate search and search results
...
fixes #219
2021-01-09 22:55:41 +01:00
Felix Van der Jeugt
02b66b6cdd
Allow primary selection for sharing
...
Adds a feature flag to use the primary selection instead of the
clipboard. Only works on Linux.
2020-12-15 22:31:35 +01:00
Henrik Friedrichsen
09febf7187
cargo update + format + clippy
2020-11-21 15:42:17 +01:00
Bettehem
9baed7ae98
Added possibility to turn on/off shuffle using MPRIS ( #318 )
...
* Added possibility to turn shuffle on/off via MPRIS
* Simplified code to use unwrap_or instead of a match.
Changed the default value to be retrieved from spotify.
* only set shuffle setting if parameter was passed
* fix: fetch shuffle state with every MPRIS query
And not just once during DBus/MPRIS setup. Also, redraw UI when shuffle
state has changed.
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org >
2020-11-14 21:50:13 +01:00
Henrik Friedrichsen
5fb4eb7af2
fix: update playlist changes in local store
...
Move playlist change logic out of the library while we're at it and notify
the library of changes instead.
fixes #302
2020-10-25 00:09:23 +02:00
dependabot-preview[bot]
e698d51e59
Bump dbus from 0.8.4 to 0.9.0 ( #296 )
...
* Bump dbus from 0.8.4 to 0.9.0
Bumps [dbus](https://github.com/diwic/dbus-rs ) from 0.8.4 to 0.9.0.
- [Release notes](https://github.com/diwic/dbus-rs/releases )
- [Commits](https://github.com/diwic/dbus-rs/compare/dbus-v0.8.4...dbus-v0.9.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com >
* migrate to dbus/dbus-tree 0.9.0
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org >
2020-10-24 00:03:19 +02: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
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
Henrik Friedrichsen
f3c66111a2
cargo clippy
2020-10-10 20:47:12 +02:00
Bolli
79093eca1e
feat: add insert command to paste spotify links ( #277 )
...
* feat: add insert command to paste spotify links
- use Ctrl-v to paste from clipboard or use :insert without an argument
* fix: handle paste on disabled clipboard feature
* fix: handle wrong URIs
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org >
2020-10-09 19:26:52 +02:00
Moshe Sherman
f2b4f01242
Vim like search ( #279 )
...
* add quick search within a list
* vim like search navigation
* close cmd line with esc
* format
* document changes in README
2020-10-05 13:50:12 +02:00
pin
b5e718f5f6
Use libc for setlocale() to fix non-ASCII ( #256 )
...
* Use libc for setlocale() to fix non-ASCII
character printing.
https://github.com/hrkfdn/ncspot/issues/221
* move string instantiation outside unsafe block
update libc crate while at it
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org >
2020-08-29 11:27:47 +02:00
Henrik Friedrichsen
1edf28a165
make contextmenu aware of commands
...
e.g. to process vim-like keybindings for navigation
fixes #108 , fixes #157 , fixes #178 , fixes #199 , fixes #250
2020-08-23 20:44:03 +02:00