Commit Graph

1115 Commits

Author SHA1 Message Date
Thomas Frans
0cee99ba4c feat: add info command line subcommand (#1330)
* feat: add `info` command line subcommand

Adding an info command allows the documentation to refer to it when
mentioning platform specific information. This gives users a nicer
experience since they don't need to think about how `ncspot` will behave
on their system, but can run `ncspot info` to get that information.

* fix: info command don't create runtime directory

* fix: don't print runtime path on Windows

Windows doesn't use the runtime path so it shouldn't be printed there.

* fix: make `info` command easier to parse

* docs: add back the default configuration directory
2023-11-27 08:43:55 +01:00
dependabot[bot]
0c9be11357 chore(deps): bump the cargo group with 1 update
Bumps the cargo group with 1 update: [notify-rust](https://github.com/hoodie/notify-rust).

- [Release notes](https://github.com/hoodie/notify-rust/releases)
- [Changelog](https://github.com/hoodie/notify-rust/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hoodie/notify-rust/compare/v4.9.0...v4.10.0)

---
updated-dependencies:
- dependency-name: notify-rust
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-24 21:20:32 +01:00
Thomas Frans
caf937d858 fix: add leading slash to gitignore paths
The leading slash forces Git to only look for the mentioned files from
the root of the directory, not inside allowed subdirectories.
2023-11-24 19:10:28 +01:00
dependabot[bot]
9c29f17ca1 chore(deps): bump the cargo group with 5 updates
Bumps the cargo group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.4.7` | `4.4.8` |
| [libc](https://github.com/rust-lang/libc) | `0.2.149` | `0.2.150` |
| [serde](https://github.com/serde-rs/serde) | `1.0.190` | `1.0.192` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.107` | `1.0.108` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.33.0` | `1.34.0` |


Updates `clap` from 4.4.7 to 4.4.8
- [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.4.7...v4.4.8)

Updates `libc` from 0.2.149 to 0.2.150
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.149...0.2.150)

Updates `serde` from 1.0.190 to 1.0.192
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.190...v1.0.192)

Updates `serde_json` from 1.0.107 to 1.0.108
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.107...v1.0.108)

Updates `tokio` from 1.33.0 to 1.34.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.33.0...tokio-1.34.0)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-19 11:38:08 +01:00
Thomas Frans
cd73c24150 docs: formatting fixes 2023-11-19 11:37:55 +01:00
Thomas Frans
fcf68995cb fix!: create IPC socket in user runtime directory (#1313)
Each user has their own runtime directory at `/run/user/<uid>`. Creating
the IPC socket in there makes sure it is cleaned up regardless of
whether `ncspot` exits normally.

BREAKING CHANGE: move IPC socket location
2023-10-28 18:43:33 +02:00
Thomas Frans
2c14883f48 docs: add changelog (#1318)
* docs: add changelog

* Add PR template

* docs: tweak PR template changelog info

* docs: extend the changelog and update it

The changelog was missing some of the unreleased changes. Some more
information was also added from previous versions.

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2023-10-28 17:15:58 +02:00
dependabot[bot]
c61f0c6508 chore(deps): bump rustix from 0.37.24 to 0.37.26
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.37.24 to 0.37.26.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.37.24...v0.37.26)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-26 18:21:41 +02:00
dependabot[bot]
e0d1d267b3 chore(deps): bump the cargo group with 13 updates
Bumps the cargo group with 13 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.4.6` | `4.4.7` |
| [futures](https://github.com/rust-lang/futures-rs) | `0.3.28` | `0.3.29` |
| [libc](https://github.com/rust-lang/libc) | `0.2.148` | `0.2.149` |
| [regex](https://github.com/rust-lang/regex) | `1.9.6` | `1.10.2` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.11.20` | `0.11.22` |
| [serde](https://github.com/serde-rs/serde) | `1.0.188` | `1.0.190` |
| [strum_macros](https://github.com/Peternator7/strum) | `0.25.2` | `0.25.3` |
| [tokio](https://github.com/tokio-rs/tokio) | `1.32.0` | `1.33.0` |
| [tokio-util](https://github.com/tokio-rs/tokio) | `0.7.9` | `0.7.10` |
| [toml](https://github.com/toml-rs/toml) | `0.8.1` | `0.8.2` |
| [wl-clipboard-rs](https://github.com/YaLTeR/wl-clipboard-rs) | `0.7.0` | `0.8.0` |
| [clap_mangen](https://github.com/clap-rs/clap) | `0.2.14` | `0.2.15` |
| [clap_complete](https://github.com/clap-rs/clap) | `4.4.3` | `4.4.4` |


Updates `clap` from 4.4.6 to 4.4.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.4.6...v4.4.7)

Updates `futures` from 0.3.28 to 0.3.29
- [Release notes](https://github.com/rust-lang/futures-rs/releases)
- [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.28...0.3.29)

Updates `libc` from 0.2.148 to 0.2.149
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.148...0.2.149)

Updates `regex` from 1.9.6 to 1.10.2
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.9.6...1.10.2)

Updates `reqwest` from 0.11.20 to 0.11.22
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.20...v0.11.22)

Updates `serde` from 1.0.188 to 1.0.190
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.188...v1.0.190)

Updates `strum_macros` from 0.25.2 to 0.25.3
- [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Peternator7/strum/commits)

Updates `tokio` from 1.32.0 to 1.33.0
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.32.0...tokio-1.33.0)

Updates `tokio-util` from 0.7.9 to 0.7.10
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

Updates `toml` from 0.8.1 to 0.8.2
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.1...toml-v0.8.2)

Updates `wl-clipboard-rs` from 0.7.0 to 0.8.0
- [Changelog](https://github.com/YaLTeR/wl-clipboard-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/YaLTeR/wl-clipboard-rs/compare/v0.7.0...v0.8.0)

Updates `clap_mangen` from 0.2.14 to 0.2.15
- [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/clap_mangen-v0.2.14...clap_mangen-v0.2.15)

Updates `clap_complete` from 4.4.3 to 4.4.4
- [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/clap_complete-v4.4.3...clap_complete-v4.4.4)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: futures
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: strum_macros
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: tokio-util
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: wl-clipboard-rs
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
- dependency-name: clap_mangen
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-26 18:21:01 +02:00
dependabot[bot]
08c2b8c301 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).

- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-26 18:09:59 +02:00
Henrik Friedrichsen
c4e31210a8 chore: Group Dependabot updates
Also, add GitHub Actions to Dependabot.
2023-10-26 18:06:05 +02:00
Henrik Friedrichsen
6ee00e39d3 Change color of unavailable song
If song is not available/playable, use secondary text color.

Fixes #1300
2023-10-14 22:36:22 +02:00
Henrik Friedrichsen
a1a986344f Revert "feat: move to async POSIX signal handler"
This reverts commit a067ab2ae2.
2023-10-14 12:44:47 +02:00
Thomas Frans
8d00ca74fc fix: MPRIS loop tokio::select!() panic on exit
This fixes a bug that would cause a panic when quiting the process
normally. `tokio::select!()` was used to await a single branch, which is
useless as it can be replaced by a normal await.
2023-10-14 12:42:24 +02:00
Thomas Frans
51d1b34ccc fix: prevent IPC socket cleanup panic
Prevent a panic when the IPC socket isn't available when the user quits
`ncspot`.
2023-10-14 12:15:38 +02:00
Thomas Frans
a69e2d763b fix: disable cursive_buffered_backend tracing
Disable the useless trace logs from the `cursive_buffered_backend`
crate.
2023-10-12 11:14:51 +02:00
Thomas Frans
a067ab2ae2 feat: move to async POSIX signal handler
Instead of trying to handle signals for every step of the `cursive`
event loop, move the signal handling into its own asynchronous task and
send callbacks to `cursive` when a signal arrives.
2023-10-08 10:47:43 +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
b27b067a47 fix: prevent MPRIS D-Bus duplicate name
Append `instance<pid>` to the MPRIS bus name to prevent two instances
from fighting over the same bus name.
2023-10-03 17:29:37 +02:00
Henrik Friedrichsen
edee66aeed Update dependencies 2023-10-01 12:34:14 +02:00
Henrik Friedrichsen
57538e2650 Switch to Crossterm backend by default
- Is capable of 256 colors
- Can handle Shift+Up/Shift+Down/etc. (#1283)
2023-09-29 22:05:12 +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
Arthur McLain
01e01b59e4 docs: update users.md (#1274)
* Update users.md

* Reformat table

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2023-09-10 22:41:37 +02:00
Henrik Friedrichsen
fcf8223e00 Update dependencies
Adapt to rspotify 0.12 breaking changes
2023-09-10 20:32:07 +02:00
Henrik Friedrichsen
c0c7ea8828 Make worker command delivery more resilient
This may discard commands during reauthentication, but at least it doesn't crash
the application.

May help with #993 and #1257
2023-08-29 21:47:07 +02:00
Henrik Friedrichsen
b4a397c84d Use Rc for UserData as it's !Sync 2023-08-26 15:06:23 +02:00
Henrik Friedrichsen
055a82cb77 Update dependencies 2023-08-26 14:37:46 +02:00
cyqsimon
4942647e1c Improve how we indicate that a command arg is optional 2023-08-21 21:26:17 +02:00
Henrik Friedrichsen
bd80670345 Use step output environment file
See also:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-07-24 01:58:13 +02:00
Henrik Friedrichsen
7d9faa7b59 Document add current and save current 2023-07-24 01:32:49 +02:00
Henrik Friedrichsen
17413fbad4 Update GitHub actions for CD pipeline 2023-07-24 01:27:24 +02:00
Henrik Friedrichsen
8e31ff10a8 Bump version to 0.13.4
+ update dependencies
2023-07-23 23:51:38 +02:00
Henrik Friedrichsen
0c13afb46f Fix: fetch album only once
Should speed up display of the context menu

Fixes #1225
2023-07-23 14:49:21 +02:00
Henrik Friedrichsen
bef4742cec Remove duplicate album query 2023-07-23 14:49:21 +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
Henrik Friedrichsen
92cd4f1c8b Handle local tracks in playlist
- 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
2023-07-22 15:42:14 +02:00
Henrik Friedrichsen
90b4560a2d Gracefully handle tracks without IDs
As reported in #1231:

Local files in playlists have no IDs. When trying to delete them ncspot crashes
as it tries to extract a track ID.
2023-07-22 15:42:14 +02:00
bentheklutz
2786c6ba34 Sort Artists Ignoring "The" (#1238)
* 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>
2023-07-22 13:05:03 +02:00
Henrik Friedrichsen
66bb0746b6 Update to strum 0.25.0 2023-07-22 12:44:50 +02:00
cyqsimon
9709c73324 Recommend Ueberzug++ 2023-07-22 12:34:14 +02:00
Henrik Friedrichsen
83f9e8d224 Update dependencies 2023-07-22 12:31:26 +02:00
hrdl
f74661a15d feat: add save current command 2023-07-07 11:23:47 +02:00
Henrik Friedrichsen
2c61a965f1 Update dependencies 2023-07-02 15:00:17 +02:00
Thomas Frans
0c93cafccf refactor: remove unused screenchange variable
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.
2023-06-18 17:04:43 +02:00
Thomas Frans
d644397180 fix: forward mouse events inside layout
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.
2023-06-14 23:03:25 +02:00
Thomas Frans
03cfd4da5f chore: improve release build options 2023-06-13 20:41:37 +02:00
Henrik Friedrichsen
9b0cd76fc5 Bump version to 0.13.3 2023-06-11 22:41:29 +02:00
Henrik Friedrichsen
07c2245bd6 Update dependencies 2023-06-11 22:39:28 +02:00
Thomas Frans
21c26abaa3 docs: add cargo installation method
Since people were having problems when installing from crates.io, it
would be nice to document it to prevent further problems.
2023-06-07 21:06:55 +02:00