mirror of
https://github.com/aome510/spotify-player.git
synced 2026-04-26 09:25:49 +03:00
[GH-ISSUE #561] The 'notify' feature requires the 'streaming' feature, otherwise it won't compile #322
Labels
No labels
bug
documentation
enhancement
good first issue
help wanted
pull-request
question
third-party
third-party
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotify-player#322
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DJ-pH3luy on GitHub (Sep 6, 2024).
Original GitHub issue: https://github.com/aome510/spotify-player/issues/561
Describe the bug
See title: Building the app with the 'notify' feature set also requires the 'streaming' feature to be set, otherwise it won't compile.
To Reproduce
Build the app with:
cargo build --release --bin spotify_player --no-default-features --features notifyExpected behaviour
It should be possible to compile 'notify' on its own (or make it dependent on 'streaming').
The problem lies in the if statement in spotify_player/src/client/mod.rs:1464 : It gets enabled ONLY by the 'notify' feature flag but in ln1465 two fields are accessed which are only present when BOTH 'notify' and 'streaming' flags are set (see spotify_player/src/client/mod.rs:36 and spotify_player/src/config/mod.rs:109). Thus it won't compile.
As I'm not familiar with the project I'm not sure if it is fixed by simply changing client/mod.rs:ln1463 from #[cfg(feature = "notify")] to #[cfg(all(feature = "streaming", feature = "notify"))] so that these fields are only accessed when we are sure that they are present. But I suspect this would somewhat break the notify feature (if compiled on its own).
Log and backtrace
Compiler error:
Screenshots
Environment
Additional context
Maybe a good first issue? I'd like to fix it / open a PR by myself but I'm quite unfamiliar with this project (and with rust).
@DJ-pH3luy commented on GitHub (Sep 7, 2024):
just proposed a fix in #562