Commit Graph

100 Commits

Author SHA1 Message Date
Thomas Frans
e0373890fe feat: improve configuration file error handling
Cleans up the error messages generated when errors are encountered in
the configuration file. Instead of showing the raw error message, give
clear information about the problem.
2023-11-29 09:44:59 +01:00
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
Flynn Duniho
924296ac52 Add add command for adding song to playlist (#1232)
* Add command for adding song to playlist

* edits for code style

* Return playlist dialog via `CommandResult::Modal`

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2023-07-22 16:03:21 +02:00
hrdl
f74661a15d feat: add save current command 2023-07-07 11:23:47 +02:00
Thomas Frans
6d32f3d1f8 refactor: move 'global' data into Application
Some applications move their 'global' data into a struct called `App` or
`Application`. This makes it very clear what data belongs to the
'global' scope or in other words, to the application itself.
2023-06-02 23:20:24 +02:00
Henrik Friedrichsen
3a460ea4ad Revert "Display shuffle order"
This reverts commit e68f50ddff.

Will be reintroduced with #1075
2023-03-09 19:34:13 +01:00
Thomas Frans
98a0596c70 Change unnecessary usage of Arc to borrow instead
Some basic cleanup of function signatures that took ownership of their
parameters, even though they didn't need ownership. Switching over the
usage of `Arc` to a normal borrow has the added benefit of cleaning up
the code a bit since now a reference can be given instead of having to
clone the values. The other benefit is that a lot of clones aren't
necessary anymore. It's not going to have noticable performance
benefits, but it is still a good thing to have less clones all over the
code.
2023-03-05 00:02:25 +01:00
Thomas Frans
e68f50ddff Display shuffle order 2023-03-01 12:02:10 +01:00
inemajo
801e847c88 commands: Adding "disconnect" command to force socket shutdown (#1057)
* commands: Adding "disconnect" command to force socket shutdown

* Rename to `reconnect`

* Add documentation to README

Related to: #628 #1033

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2023-02-26 20:46:41 +01:00
Thomas Frans
be7ed20897 Cleanup: Remove PlayTrackMenu
PlayTrackMenu was used before the refactor of the contextmenus. I forgot
to clean up the struct before making the commit since rustc didn't
complain. Just cleaning up my mistakes ;)
2022-09-23 13:38:32 +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
Bettehem
bba70b1809 Added possibility to Follow/Unfollow artists via the context menu (#868)
* Added possibility to Follow/Unfollow artists via the context menu

* Formatted code properly.

* Changed Show Artist to Artist (or Artists if there are many).
2022-07-27 22:07:30 +02:00
cyqsimon
fefbd4191d Fix some errors and warnings when enabling/disabling features (#821)
* Fix E&Ws when enabling features

* `share_clipboard` feature can be disabled more cleanly

* `notify` feature can be disabled more cleanly
2022-06-10 21:32:59 +02:00
Henrik Friedrichsen
52e2a53839 Fix: process command bindings in play track menu 2022-04-25 22:52:49 +02: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
299c470cf9 Add exec command
Fixes #673
2021-12-17 20:57:52 +01:00
Matheus Cardoso
1ea2f0a434 Fix key bindings inconsistency (#627) 2021-10-17 15:31:42 +02:00
Henrik Friedrichsen
a78bbe6684 Add redraw command and bind to CTRL+L
solves #609
2021-10-01 18:44:25 +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
HMH
d17c66f8ad Add command to show recommendations. (#593)
* Add command to show recommendations.

This adds a command `similar selected|current` which enables searching for
track recommendations for playlists, albums as well as single tracks.

* Make sure to only send 5 seed items in total.

* Add docs for recommendation bindings to the README
2021-09-07 15:01:06 +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
6b8e1d33dc Code cleanups 2021-08-15 15:05:49 +02:00
Henrik Friedrichsen
46a8f01bac Fix: Handle commands in select artist modal
Fixes #560
2021-07-11 01:29:11 +02:00
Ronak Buch
b0d2e8f62e Make behavior of Shift modifier consistent
Previously, Shift+o opened the menu for the currently playing item
while Shift+x copied a link to the currently selected item. Now Shift
operates on the currently playing item in both cases.
2021-05-07 22:52:42 +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
cea5228245 (Re)store currently playing track + shuffle state
Solves #448
2021-04-09 19:10:34 +02:00
Henrik Friedrichsen
0f573f8247 Refactor: Make Spotify cloneable 2021-04-03 22:35:08 +02:00
Henrik Friedrichsen
d2edfc3caf rename as_boxed_view_ext to into_boxed_view_ext 2021-03-22 22:36:33 +01:00
Henrik Friedrichsen
a0231362f1 implement logout command
fixes #470
2021-03-22 21:56:50 +01:00
KoffeinFlummi
df87ff9bdd Implement cover drawing as optional feature 2021-02-27 13:14:49 +01:00
Henrik Friedrichsen
92d1978340 Save track queue when closing and restore at start 2021-02-22 22:14:34 +01:00
Henrik Friedrichsen
7f5856dfb6 open search results in search screen
fixes #413
2021-02-02 20:54:18 +01:00
Henrik Friedrichsen
9afad2d91c cargo fmt/clippy 2021-01-10 01:54:54 +01:00
Henrik Friedrichsen
18dc6c6bf8 separate search and search results
fixes #219
2021-01-09 22:55:41 +01:00
Henrik Friedrichsen
9639115f48 show confirmation dialog before deleting queue
fixes #227
2021-01-03 23:13:53 +01:00
Henrik Friedrichsen
3c66379cc6 fix search command and update docs
fixes #353
2021-01-02 22:18:41 +01:00
JojiiOfficial
5fefe9eec3 Add hjkl controls for AddToPlaylistMenu (#335)
* Add hjkl controls for AddToPlaylistMenu

* turn off autojump in contextmenu for vim bindings

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2020-12-13 20:41:22 +01:00
Bolli
d88ea93a94 feat: create new empty playlist via command (#272)
* feat: create new empty playlist via command

- type :newplaylist <name> to create a new playlist

fixes #242

* use full argument string for playlist name

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2020-10-25 17:57:49 +01:00
Saul Chavez Sanchez
c9d02507ac Increase/Decrease volume by 5 (#298)
* Increase/Decrease volume by 5

* Fixed static value

* use fallback value in case parsing fails

fixes #282

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2020-10-22 20:21:49 +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
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
Moshe Sherman
fc79889665 play next (#278)
* add play next feature

* fix play_next insertion order

* fix play_next call for playable

* document play_next shortcut + reformat

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2020-10-04 16:58:55 +02:00
Moshe Sherman
c4ec1a9122 give proper name to the space key
fixes #266
2020-09-16 08:56:50 +02:00
Henrik Friedrichsen
6f7b64c908 cargo clippy 2020-08-23 21:00:29 +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
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
Henry Snopek
0f08a56f90 [feat] add Command::Noop 2020-06-25 15:45:53 +02:00
Henrik Friedrichsen
65126c5c78 add configuration value to drop default keybindings
resolves #204
2020-06-18 19:33:46 +02:00
Henrik Friedrichsen
4e7af1c920 add command/binding to jump to currently playing track
fixes #181
2020-04-18 21:57:41 +02:00