Commit Graph

154 Commits

Author SHA1 Message Date
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
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
1b1d392ab8 podcast support (#203)
* implement search for shows/podcasts

* create Playable supertype for queue to contain tracks and episodes

* wip: implement playback of episodes

* load spotify id from uri instead of raw id to fix podcast playback

* show duration for podcast episodes

* implement generic status bar for playables (tracks and episodes)

omit saved indicator for now as the library does not yet support podcasts

* instead of only the last 50 fetch all episodes of a show

* refactor: extract Playable code to separate file

* implement playback/queuing of shows + sharing url

* implement podcast library

* migrate mpris code to Playable supertype
2020-07-14 10:38:22 +02:00
Henrik Friedrichsen
8188f9e304 fix: only clear credentials when they're invalid
fixes #77
2020-06-21 21:50:49 +02:00
Henrik Friedrichsen
65126c5c78 add configuration value to drop default keybindings
resolves #204
2020-06-18 19:33:46 +02:00
Henrik Friedrichsen
8013609d0e recreate librespot session when it's invalid
initial attempt to handle #192
2020-06-13 20:23:28 +02:00
Henrik Friedrichsen
ce5b11dac4 update to cursive 0.15.0 2020-06-02 23:19:21 +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
b5566351b5 use cached credentials from librespot
attempt at fixing #160
2020-04-08 21:07:20 +02:00
Henrik Friedrichsen
1b0ac4d5cc migrate to futures 0.3 2020-03-28 23:31:27 +01:00
Henrik Friedrichsen
082675a5d7 push help view to stack instead of making it a separate screen
fixes #157
2020-03-21 15:51:35 +01:00