Commit Graph

54 Commits

Author SHA1 Message Date
cyqsimon
7f882ccaee style: warn enum_glob_use 2024-04-14 13:36:50 +02:00
Thomas Frans
209d8e260b refactor: remove lazy_static crate
The `lazy_static` crate was superseded by the `once_cell` crate which
has been included in Rust's standard library since version `1.70`.
Remove the `lazy_static` dependency and refactor all use cases to use
`std::sync::OnceLock` instead.

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2023-10-07 17:33:48 +02:00
Thomas Frans
2f365c1551 chore: remove placeholder code
Remove the placeholder entries from the command aliases.
2023-10-07 17:27:00 +02: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
cyqsimon
4942647e1c Improve how we indicate that a command arg is optional 2023-08-21 21:26:17 +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
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
BlakeJC94
1a0258f197 Add vim-like page scrolling
* feat: added match fallback for handle_command SelectViewExt

* feat: HalfPage and FullPage MoveAmount variants

* feat: Display for MoveAmount variants

* feat: fallback for MoveAmount variants in TabView

* feat: ListView FullPage/HalfPage MoveAmount

* feat: default keybinds for page scrolling

* feat: HalfPage/FullPage MoveAmount for HelpView

* feat: removed new defaul keybinds for pagescroll

* style: "upwards" -> "halfpageup" etc.

* feat: toml parse "move pageup" / "move halfpageup"

* chore: cargo fmt

* feat: simplified page scroll command interface

* docs: added `move` to readme

* feat: replace FullPage and HalfPage with Float variant

* fix: remove stray variant

* dosc: update move command

* chore: fmt

* feat: implement MoveAmount::Float for selectview

* chore: fmt
2023-03-12 13:26:00 +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
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
Henrik Friedrichsen
f5bf1d527f cargo clippy --fix 2022-08-17 19:41:23 +02:00
Henrik Friedrichsen
8aab5cabf2 Fix: don't crash on empty command input 2022-08-16 21:52:01 +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
68b3b9b510 Fix warnings 2022-01-09 21:39:14 +01:00
cyqsimon
ba36f98367 seek spits out correct error when used with no args 2022-01-04 09:21:43 +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
cyqsimon
17867685ab Improved README (#683)
* auto generate table of contents

* cspell check

* Added `single` alias to repeat mode `track`

* Updated command documentation

* Reformat command table
Removed the "alias" column since it takes up too much space.
2021-12-27 16:34:56 +01:00
cyqsimon
e0ec759730 Improved seek command to allow more units (#682)
* `seek` command accepts fancy duration

* Use default formatting

* Better var naming

* Documented `seek` command
2021-12-27 09:28:49 +01:00
Henrik Friedrichsen
299c470cf9 Add exec command
Fixes #673
2021-12-17 20:57:52 +01:00
Henrik Friedrichsen
dc977d758e Fix serialization of jump commands 2021-12-07 21:36:36 +01:00
Felix
3d43081df3 Added jumpnext and jumpprevious as commands 2021-12-07 16:35:52 +01: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
6b8e1d33dc Code cleanups 2021-08-15 15:05:49 +02:00
Henrik Friedrichsen
9eb99cc8be cargo clippy 2021-07-11 01:38:57 +02:00
Henrik Friedrichsen
a0231362f1 implement logout command
fixes #470
2021-03-22 21:56:50 +01:00
Henrik Friedrichsen
b436e40851 Fix display of PlayNext command
fixes #445
2021-02-27 13:23:30 +01:00
Henrik Friedrichsen
3c66379cc6 fix search command and update docs
fixes #353
2021-01-02 22:18:41 +01:00
Henrik Friedrichsen
54e48a7dc6 cargo clippy 2020-12-13 21:58:58 +01:00
André Andersson
68d2bbd64f Add support for sorting playlist tracks (#328)
* Add support for sorting playlists

* Update string

* formatting
2020-11-22 17:02:33 +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
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
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
0f0c0e1383 fix save command parsing for parameterless values
fixes #231
2020-07-31 22:16:07 +02:00
Henry Snopek
0f08a56f90 [feat] add Command::Noop 2020-06-25 15:45:53 +02:00
Henry Snopek
d2eede2777 [feat] add Command::Help to command.parse 2020-06-25 11:09:48 +02:00
Henrik Friedrichsen
4e7af1c920 add command/binding to jump to currently playing track
fixes #181
2020-04-18 21:57:41 +02:00
Henrik Friedrichsen
705a54c08c reformat + remove redundant closure 2020-04-02 21:21:51 +02:00
Marcin Sobczyk
07be9dc48d Command::Move: Add support for extreme moves
This patch adds a 'MoveAmount' enum that permits movements by integer
values or to abstract extremes which loosely translate to "top" for up
direction, "bottom" for down direction, etc. The goal behind the effort
is to add support for buttons like "Home" and "End".

The new enum has a 'Default' impl that yields a value of integer
movement by 1 field. This replaces the previous 'Option' wrap, that
in fact served the same purpose, with the value of '1' scattered
around different places in code.

Along with the enum, new commands have been defined to make use of it:

 - "move top"
 - "move bottom"
 - "move leftmost"
 - "move rightmost"
2020-03-31 10:49:08 +02: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
Henrik Friedrichsen
dccb36d8e7 update to rust edition 2018 + bump version 2020-03-15 11:06:24 +01:00
Henrik Friedrichsen
d2915316da various non-functional code cleanups 2020-02-21 23:33:08 +01:00
Henrik Friedrichsen
54230bd85b show commands in help screen in the same syntax they are parsed 2020-02-05 22:48:35 +01:00
Henrik Friedrichsen
a5da4897de implement software volume mixing
closes #115
2020-01-11 18:11:41 +01:00
Henrik Friedrichsen
85e9e99d87 rebind + change playlist update command to update entire library 2019-11-30 17:13:41 +01:00