Commit Graph

541 Commits

Author SHA1 Message Date
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
5dcbc18f85 Save current state on SIGHUP as well
Fixes #948
2022-10-04 08:30:18 +02:00
Henrik Friedrichsen
b1f1c20484 Exit gracefully on SIGTERM
* Exit gracefully on `SIGTERM`

Save current state and close ncspot on `SIGTERM`

Fixes #948

* Disable signal handling on non-UNIX platforms
2022-10-03 00:07:40 +02:00
Henrik Friedrichsen
c2ab691722 Upgrade to Clap v4 2022-10-02 22:11:10 +02:00
Thomas Frans
655d663aed Fix: fixes a bug that crashed ncspot.
Like mentioned in the corresponding issue by ayushjaipuriyar, ncspot
would crash when the queue was empty, shuffled, and played. This commit
fixes that, together with some minor clippy fixes.
2022-10-02 21:46:57 +02:00
Thomas Frans
be7ed20897 Cleanup: Remove PlayTrackMenu
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 ;)
2022-09-23 13:38:32 +02:00
Thomas
0eedc38b8a Improve context menus to make the UX/UI more consistent (#923)
* Add save option to context menu of all possible ListItems

* Add play options to context menus

* Fix for playlists and tracks

* Move playback controls into main menu
2022-09-20 22:09:51 +02:00
Henrik Friedrichsen
a668574376 Fix: properly set up Browse screen
Previously two vectors of categories were created. The pagination was set up to
store the newly fetched page in the `Vec` that was not displayed.

With this change newly fetched pages should correctly show up in the "Browse"
screen.

As reported in #939
2022-09-16 22:12:37 +02:00
Thomas Frans
2be126430d Fixed pagination bug that caused items not to load 2022-09-16 21:31:47 +02:00
Henrik Friedrichsen
c1f0c5409c Fix: Re-request album tracks if it has >50 tracks
Fixes #926
2022-09-12 23:29:12 +02:00
Henrik Friedrichsen
f4ef7e1b56 Fix: remove broken staleness detection
Ever since albums were sorted the cache staleness detection stopped working as
the order of items plays into the check. Remove it as it currently doesn't
work. It also wasn't a very good check.
2022-09-12 23:16:06 +02:00
Henrik Friedrichsen
63722c5be3 Fix: Use buffered backend to prevent flickering
This is reported to be occuring with the Cursive Termion backend as it redraws
the screen every time, resulting in flickering for some users.

Should be removed once Cursive has integrated this.

See also:
- https://github.com/gyscos/cursive/issues/142
- https://github.com/gyscos/cursive/issues/667

Fixes #934
2022-09-11 23:34:24 +02:00
Henrik Friedrichsen
10213f9bcf Fix: set track position only for clicks, not hold
Fixes #920
2022-08-29 21:45:29 +02:00
Henrik Friedrichsen
816d2f133d Mouse wheel: scroll up/down without changing focus
Fixes #918
2022-08-25 22:53:03 +02:00
Ronak Buch
56c8817aa8 Fix order of parameters to Cache::new
When updating to librespot 0.4.0 in c41294c, the volume and audio path
parameters were specified in the wrong order.
2022-08-25 09:22:26 +02:00
Thomas
b8b565d0c3 Fix back button mouse left click 2022-08-24 20:41:55 +02:00
Henrik Friedrichsen
a9f7f3cddc Fix: align with color palette of Cursive
Should make context menus (`SelectView`) look like ncspot's `ListView`.

Fixes #431
2022-08-20 23:40:33 +02:00
Henrik Friedrichsen
966223392e Handle clicks on back button (pop view from stack) 2022-08-20 23:05:14 +02:00
Henrik Friedrichsen
8905db457a Implement category playlist browsing in library
Fixes #187
2022-08-20 22:32:25 +02:00
Henrik Friedrichsen
a04bc40051 Refactor: Extract command handling for ListView 2022-08-20 00:40:21 +02:00
Henrik Friedrichsen
38dfba1db5 Use ViewExt.title() in TabView
Instead of storing a separate copy of the view title.

Additionally, rename `ViewExt.set_title()` to `ViewExt.with_title()` as it
consumes `self` and returns ownership.
2022-08-19 20:42:46 +02:00
Henrik Friedrichsen
5db79d5b2e Fix ListView scrollbar dragging
With af08a56 properly passing down relativized events we don't have to implement
to scrollbar dragging logic ourselves anymore, but can rely on the one in
cursive.

This also fixes #839
2022-08-19 19:02:15 +02:00
Henrik Friedrichsen
2311e49ea2 Don't open item/context menu for clicks after end
The previous behavior would select and open the last item if the user clicked a
row after the last item. This change prevents such a behavior as it can be
misleading.

Related to #840
2022-08-19 00:41:19 +02:00
Henrik Friedrichsen
81010fc453 Refactor: Unify list size calculation 2022-08-19 00:31:56 +02:00
Henrik Friedrichsen
82716b267b Handle left mouse click on item, i.e. albums/lists
Another part of #840
2022-08-19 00:31:47 +02:00
Henrik Friedrichsen
4315cdc077 Add CursiveExt trait
For easier usage of shared logic involving the `Cursive` instance.
2022-08-19 00:18:34 +02:00
Henrik Friedrichsen
f5bf1d527f cargo clippy --fix 2022-08-17 19:41:23 +02:00
Bettehem
0af93f816d Fixed clipboard not working on GNOME Wayland. 2022-08-17 19:33:02 +02:00
Henrik Friedrichsen
d3e89115d7 Open context menu when right-clicking on items
Another part of #840
2022-08-16 23:01:51 +02:00
Henrik Friedrichsen
af08a560c7 Pass down relativized events to child views
So child views can correctly calculate the local mouse cursor position.
2022-08-16 21:52:01 +02:00
Henrik Friedrichsen
8aab5cabf2 Fix: don't crash on empty command input 2022-08-16 21:52:01 +02:00
Henrik Friedrichsen
f7f2cb63eb Handle mouse clicks and scrolling in tab header
Partially implements #840
2022-08-09 17:51:44 +02:00
eulerfan271
593a4c9284 Add notification customization (#893)
* Add custom notification formatting

* Added `notification_format` to README

* cleaned up code formatting

* Fix typo

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2022-08-07 15:51:38 +02:00
Henrik Friedrichsen
1e135de443 Apply cargo clippy suggestions 2022-07-31 11:32:59 +02:00
Henrik Friedrichsen
249a4ef5a7 Add statusbar_format configuration option
Fixes #877
2022-07-31 11:24:22 +02:00
Bettehem
bba70b1809 Added possibility to Follow/Unfollow artists via the context menu (#868)
* Added possibility to Follow/Unfollow artists via the context menu

* Formatted code properly.

* Changed Show Artist to Artist (or Artists if there are many).
2022-07-27 22:07:30 +02:00
Bettehem
5158a13e19 Enable wayland clipboard support by default on supported platforms (#869)
* Added possibility to Follow/Unfollow artists via the context menu

* Formatted code properly.

* Wayland support is now automatically built on supported platforms.

* Revert "Formatted code properly."

This reverts commit ec057f9716574d0a7912ba8b5308c73bb0342f84.

* Revert "Added possibility to Follow/Unfollow artists via the context menu"

This reverts commit 9ac20514a640b9150fcfa38630d338ad6f097689.

* Removed need for separate wayland_clipboard feature.
Possibly fixed windows build.

* Added more cfg conditions to sharing.rs.
This possibly fixes the windows build.

* Changed to only build wayland clipboard feature on linux by default.
2022-07-25 23:05:13 +02:00
Henrik Friedrichsen
7b2c1bafdb Initialize PulseAudio backend environment vars
Set application name/description and media role to allow application specific
settings.

Fixes #871
2022-07-21 20:50:56 +02:00
James Adam
ed10872ca3 Add 'hide_display_names' config option 2022-07-11 08:27:41 +02:00
Henrik Friedrichsen
faad7dab95 Fix: don't throw error if search yields no result
Fixes #832
2022-06-10 21:37:59 +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
ce6b360cba Fix: prevent integer overflow when calculating cache size
Fixes #823
2022-06-08 19:30:51 +02:00
cyqsimon
2e8f37e42b Add desktop entry & notification icon hint (#822)
* Add desktop entry & notification icon hint

* Fix build for non-linux

* Set notification priority with hints
2022-06-05 23:59:42 +02:00
Bettehem
f7450321da Add track_format config option (#800)
* Added track_name_first config option to allow choosing if artists' names should be shown before or after the track name.

* Added active_fields config option, which allows configuration of which columns are visible in Queue/Library view.
This also removes the need for a separate track_name_first and album_column option.

* Fixed README

* Made custom tracklist formatting more flexible.
Updated readme with new instructions.
Reformatted impl member order to match the definitions in traits.rs.

* Added track_name_first config option to allow choosing if artists' names should be shown before or after the track name.

* Added active_fields config option, which allows configuration of which columns are visible in Queue/Library view.
This also removes the need for a separate track_name_first and album_column option.

* Fixed README

* Made custom tracklist formatting more flexible.
Updated readme with new instructions.
Reformatted impl member order to match the definitions in traits.rs.

* Fetch formatting config from library config

Instead of the lazy static mutex

* Moved custom format function to Playable impl as it's a better location to handle both Tracks and Episodes

* Rename from `tracklist_formatting` to `track_format`

Also shorten `format_{left|center|right}` to `{left|center|right}`

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
2022-05-28 14:13:37 +02:00
Henrik Friedrichsen
c41294cb8d Update to librespot 0.4.0
Changes: https://github.com/librespot-org/librespot/compare/v0.3.1..v0.4.0
2022-05-22 17:15:02 +02:00
Henrik Friedrichsen
cef6eb43b0 Add option to customize library tabs
New option is called `library_tabs`. By default all tabs are enabled.

Fixes #798
2022-05-10 22:59:49 +02:00
Bettehem
dfecb759a0 Added playback_state config option (#783)
* Added playback_state config option.
It can be used to pre-define a certain playback state for the player.

* Changed playback_state to use enums and removed redundant check for the "Playing" state.
2022-04-28 10:03:17 +02:00
Henrik Friedrichsen
0bbb4932e5 Clean up clippy warnings 2022-04-27 22:41:04 +02:00
Henrik Friedrichsen
d1a44a613f Fix: do not crash DBus on invalid Spotify URIs
Fixes #795
2022-04-27 22:38:15 +02:00
Henrik Friedrichsen
52e2a53839 Fix: process command bindings in play track menu 2022-04-25 22:52:49 +02:00