Commit Graph

20 Commits

Author SHA1 Message Date
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
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
Henrik Friedrichsen
fcf8223e00 Update dependencies
Adapt to rspotify 0.12 breaking changes
2023-09-10 20:32:07 +02:00
Henrik Friedrichsen
bef4742cec Remove duplicate album query 2023-07-23 14:49:21 +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
Thomas Frans
ae090b6073 refactor: move async runtime to application module
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.
2023-06-02 23:20:24 +02:00
Jakub Jirutka
ba60fbddd0 Fix: breaking changes in rpostify 0.11.7 2023-05-09 10:36:04 +02:00
Thomas Frans
829b799cc5 Fix clippy warnings. 2023-02-16 13:33:56 +01:00
Henrik Friedrichsen
93816af654 Linter fixes 2022-12-28 14:37:08 +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
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
8905db457a Implement category playlist browsing in library
Fixes #187
2022-08-20 22:32:25 +02:00
Henrik Friedrichsen
d1a44a613f Fix: do not crash DBus on invalid Spotify URIs
Fixes #795
2022-04-27 22:38:15 +02:00
Csaba Varró
f0a2cd79ff Remove panics in the update_token flow (#688)
It caused a crash when the token failed to update
2022-01-01 21:43:12 +01:00
Henrik Friedrichsen
ebc49117b0 Update rspotify to 0.11.3 (et al)
Also allows us to revert the previously applied fix where the market parameter had to be removed.
2021-11-29 22:43:06 +01:00
Henrik Friedrichsen
e83ea5b833 Don't set market for user albums
Workaround until next rspotify is released

Fixes #650
2021-11-20 20:52:40 +01:00
Henrik Friedrichsen
74b4e65b64 Refactor: move playable models to separate module 2021-11-08 20:44:21 +01:00
Henrik Friedrichsen
96f2d88696 Update to rspotify 0.11.2 (#640)
* Update to rspotify 0.11.x

Many breaking changes

* Minor cleanups via Clippy
2021-11-07 17:19:56 +01:00
Henrik Friedrichsen
faad362f55 Refactor: separate Spotify API from player logic
The separation is not perfect yet, but it's a start and makes the entire codebase much easier to read.
2021-08-23 22:15:54 +02:00