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.
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.
* 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>
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 ;)
* Added possibility to Follow/Unfollow artists via the context menu
* Formatted code properly.
* Changed Show Artist to Artist (or Artists if there are many).
* 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
* 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
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.
* 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>
* 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>
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.
* 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>
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"