Commit Graph

1014 Commits

Author SHA1 Message Date
Henrik Friedrichsen
dc2f42fd07 Revert "Update CD workflow"
This reverts commit e369994b06705c9c520266feebd89422b5be90c3.

`cross-rs/cross` has already updated to a newer Ubuntu version but not released
their images yet, thus cross-compilation builds fail. Revert for now to get out
the release. Hopefully we can reapply this change for the next release.
2023-03-09 19:49:41 +01:00
Henrik Friedrichsen
758e8d74ce Bump version to 0.13.0 2023-03-09 19:35:41 +01:00
Henrik Friedrichsen
95b256b400 Update dependencies 2023-03-09 19:34:16 +01: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
dependabot[bot]
45cca123bc Bump serde from 1.0.152 to 1.0.154
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.152 to 1.0.154.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.152...v1.0.154)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-09 19:04:37 +01:00
Thomas Frans
e8adff444c Automatic shell completion generation
* 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.
2023-03-09 19:02:11 +01:00
Henrik Friedrichsen
c457efc6fc Dependency updates 2023-03-06 22:02:57 +01:00
Thomas Frans
b27e84a386 Add manpage generation using xtask
* 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.
2023-03-06 21:55:19 +01:00
Klaus Umbach
7d1a9d2e80 Fix debian dependencies for Bookworm
Bookworm favours pipewire over pulseaudio, so the dependency to the
package "pulseaudio" from my previous PR #405 has to be removed. It
seemes, it was never really necessary anyway, because "$auto" already
adds the correct dependency to "libpulse0".
2023-03-06 21:52:12 +01:00
Thomas Frans
0c5693c426 Disable autojump for add to playlist dialog.
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.
2023-03-05 00:04:09 +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
c2e030c2f0 Allow executing program to retrieve credentials
* 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>
2023-03-01 11:28:11 +01:00
dependabot[bot]
3a3d8ae8b4 Bump clap from 4.1.6 to 4.1.7
Bumps [clap](https://github.com/clap-rs/clap) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/v4.1.6...v4.1.7)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-28 23:16:46 +01:00
Thomas Frans
9ca72e391d CI/CD: Add clippy and update actions
* Add clippy to CI.

* Update .github/workflows/ci.yml

* Update .github/workflows/ci.yml

* Use `cargo check` instead of `cargo build`

* Update CD workflow

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2023-02-28 22:49:32 +01:00
Henrik Friedrichsen
879d8e8e04 Dependency updates 2023-02-26 20:50:43 +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
Jonas Wunderlich
e8d652cc78 Always pass cover URL to notification
Regardless of the `cover` feature
2023-02-24 18:30:10 +01:00
dependabot[bot]
f7e415666a Bump toml from 0.5.11 to 0.7.2
Bumps [toml](https://github.com/toml-rs/toml) from 0.5.11 to 0.7.2.
- [Release notes](https://github.com/toml-rs/toml/releases)
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.11...toml-v0.7.2)

---
updated-dependencies:
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-19 14:02:04 +01:00
Henrik Friedrichsen
6fc99541e1 cargo update 2023-02-19 00:11:10 +01:00
Thomas Frans
a3c4989571 Switch from MM:SS to HH:MM:SS duration representation if needed
* Contidionally switch from MM:SS to HH:MM:SS duration representation if needed.

* Correct tiny style issue.

* --amend
2023-02-17 09:22:12 +01:00
Thomas Frans
829b799cc5 Fix clippy warnings. 2023-02-16 13:33:56 +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
2fe3b056bf Raise SIGTSTP on UNIX and ncurses backend
See also: gyscos/cursive#521

Fixes #1040
2023-02-06 20:01:48 +01:00
Henrik Friedrichsen
5e950b6c2c cargo update 2023-02-03 20:44:53 +01:00
Harold Nieuwboer
8c0fbe5f43 Theme config support for HighlightInactive 2023-02-03 17:47:27 +01:00
Simon Vandevelde
25680bc9b4 Add info on extracting currently playing to README (#1038)
* Add info on extracting currently playing

* Add word

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2023-01-31 23:53:32 +01:00
Henrik Friedrichsen
7e974bb7ce Bump version to 0.12.0 2022-12-29 00:17:52 +01:00
Henrik Friedrichsen
ec4b7c209a Create IPC socket on UNIX platforms (#1018)
* Create IPC socket on UNIX platforms

Creates an IPC socket which remote programs/scripts can connect to. This
can be used to control ncspot or fetch the current playback status.

At the moment, only remote control is implemented. Next step is to send
the current player status as a JSON object.

Fixes #524

* Publish status changes to connected sockets

Whenever the playback mode (playing, paused, stopped) or the track changes, all
socket listeners will be notified.

Fixes #924, fixes #1019

* Document IPC feature
2022-12-28 19:01:59 +01:00
Henrik Friedrichsen
93816af654 Linter fixes 2022-12-28 14:37:08 +01:00
Henrik Friedrichsen
cf78f1aed3 cargo update 2022-12-28 14:33:20 +01:00
Henrik Friedrichsen
703ffc76ba Refactor: Don't clone references 2022-12-15 23:42:55 +01:00
Henrik Friedrichsen
23e9ecfd5c Upgrade rspotify to 0.11.6
Passing IDs to rspotify still feels a little wonky with their `Id` changes
making use of `Cow`. Maybe it can be simplified on our end, but it's a start.

Fixes #844

See also:

https://github.com/ramsayleung/rspotify/pull/332
2022-12-14 21:12:08 +01:00
Thomas Frans
7063c9a9aa Document queue module. 2022-12-13 23:25:27 +01:00
Henrik Friedrichsen
8e54abf341 Add Flathub link
Fixes #997
2022-12-12 15:33:17 +01:00
Thomas
ccce78af66 Convert main from async to sync again
* Make entry point synchronous and switch to global runtime instead.

* Switch all futures::block_on() to global runtime.

* Fix formatting.
2022-12-11 19:09:22 +01:00
Henrik Friedrichsen
7751afafd2 cargo update 2022-12-07 17:09:48 +01:00
Thomas Frans
8a41815bb2 Add back PanicInfo to backtrace. 2022-12-07 17:03:40 +01:00
Henrik Friedrichsen
0a6dd20d54 cargo update 2022-12-03 12:44:18 +01:00
pghvlaans
92a7903825 main.rs: println before setting up cursive backend. (#969)
Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2022-11-24 20:52:23 +01:00
Henrik Friedrichsen
5c1fe9331a Remove mention of RUST_BACKTRACE
See also https://github.com/hrkfdn/ncspot/pull/988#issuecomment-1320562882
2022-11-18 22:49:44 +01:00
Thomas
e15657ae67 fix(backtrace): Fix backtrace logging and stdout (#988)
* fix(backtrace): Fix backtrace logging and stdout
- Add manual implementation for panic that logs backtrace to a file.
- Remove all manual output to stdout.
- Fix new clippy warnings from Rust 1.65.

* Update docs

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2022-11-18 22:20:57 +01:00
Henrik Friedrichsen
3db8d02295 cargo update 2022-11-16 21:05:54 +01:00
Henrik Friedrichsen
1dcebeace1 Add "save/unsave album" to context menu
Fixes #964
2022-10-22 14:20:43 +02:00
Henrik Friedrichsen
0ffcb212bc cargo update 2022-10-22 14:10:28 +02:00
Thomas
6a5efb1052 Fix Clone impl marked todo on Pagination
- Fixed a manual implementation of Clone on Pagination (needed extra
  trait bounds to be derivable)
- Made clippy happy :)
2022-10-19 22:02:39 +02:00
Henrik Friedrichsen
05d221aada Bump version to 0.11.2 2022-10-15 12:48:44 +02:00
Henrik Friedrichsen
03ffbbc6d8 cargo update 2022-10-15 12:47:32 +02:00
Henrik Friedrichsen
bcd51ee33a cargo update 2022-10-07 23:05:49 +02:00
Henrik Friedrichsen
5dcbc18f85 Save current state on SIGHUP as well
Fixes #948
2022-10-04 08:30:18 +02:00