* 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>
- Show error on deletion, as we currently do not have a Uri we can pass to the
Spotify API to delete local files in playlists
- Mark local files in `ListView`
fixes#1213
* Sorting QoL
Ignore leading "The" when sorting albums and artists by artist name
in the library.
* Simplify stripping of `The ` prefix in artist
---------
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
The `screenchange` member variable on `Layout` didn't seem to be used
for anything except for debugging. A comment in `on_layout` makes it
seem like it wasn't meant to be used for debugging purposes but for
actual functionality that wasn't implemented.
After refactoring layout, the if statements were removed in favor of a
single match. This changed the control flow a bit, breaking mouse event
propagation.
To have a clear distinction between code dealing with OS process
characteristics and code of ncspot itself, it makes sense to move the
async runtime together with ncspot as it doesn't have anything to do
with the OS process.
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.
For instance for when multiple ncspot instances are running. In that case the
PID will be appended to the path, i.e. `~/.cache/ncspot/ncspot.20707.sock`.
Also ncspot will now delete the socket on shutdown.
Fixes#1158
Some systems may have an ncspot binary with enabled MPRIS/DBus support, even
though DBus is not actually running on the system or the session is broken.
ncspot should not panic in such a situation, but handle gracefully instead.
Should help with #1139
* Rewrite MPRIS implementation using zbus
The initial DBus implementation was getting harder to maintain and `zbus` offers
some nice convenience features that should make our MPRIS implementation
cleaner.
For now this only implements the `org.mpris.MediaPlayer2` interface which does
not do much.
Should help with #1103
* Implement MPRIS properties
- `PlaybackStatus`
- `PlaybackRate`
- `Volume` (get/set)
* Implement remaining player properties/functions
* Emit signal for changed properties on track change
Change the behavior of `ListView` to treat a click on an item that is
already selected as a double click. It allows the user to play songs
(not episodes since currently it's not possible to determine if a
`ListItem` is an episode) by "double clicking" them. It is a bit of a
hack, but it works pretty well. A possible downside is that when people
that don't like mouse integration in a TUI click to focus the terminal
window, it could jump to the song they clicked if that happened to be
the selected one.
* Add automatic shell completion generation.
Add automatic generation of shell completion scripts for various shells
(the ones supported by `clap_complete`). The scripts can be generated
using the `generate-shell-completion` xtask, which outputs the shell
script to stdout.
* Improve shell completion generation xtask.
General improvements to both the shell completion generation as well as
the xtask package itself. Update the README to match the new additions.
* Add manpage generation.
* Hide xtask compilation info.
This changes the default behavior of the `cargo run` command for xtasks
to hide the compilation info. This makes sense as xtask's are run as a
program, and showing the compilation info every time clutters stdout
with unrelated info.
* Move ncspot's `clap::Command` to `lib.rs`.
Moving the `clap::Command` used internally by ncspot to a library allows
it to be easily shared between different packages (xtask and ncspot
itself).
This commit also reworks the xtasks to use clap for parsing the xtask
arguments, which simplifies writing new xtasks.
* Make `generate-manpage` `--output` optional.
When more xtasks get added, it would make sense to have a `generate-all`
subcommand that executes all xtasks, which wouldn't be able to have
options for every separate subcommand. Therefore the `output` argument
should be optional, and by default output to the `misc` directory which
contains extra metadata files already.
* Add packaging info to `README.md`.
Update the README to include information for packagers. The information
includes provided files as well as info on how to generate some of them.
Autojump seems to take precedence over regular keys, which isn't the
wanted behavior, especially when there are playlists in the list that
contain some of the most common Vim keybindings. For example when there
is a playlist called 'jazz', pressing `j` will jump to that playlist
instead of going down.
This commit disables autojump for now. If search inside the add to
playlist dialog would be a wanted feature, it could be implemented using
the default Vim search button `/` which would work the same way as
searching in other lists works right now.
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.
* config / authentication: permit to call external program for getting credentials
You can add into your ncspot/config.toml like this:
```
creds_username = "mylogin"
creds_passeval = "pass my_pass_path_to_spot_password"
```
Or using any password manager who send your password.to stdout.
If a newline is detected it will be automatically removed
* Move credential commands into separate structure
Also add an option for a username command
* Document credential commands
---------
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
* 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>