Skip to content

Commit e600c47

Browse files
authored
upgrade dependencies (#819)
Resolves #810 Resolves #811 Resolves #815 This PR upgrade dependencies to prepare for a new release
1 parent 3baf44d commit e600c47

File tree

9 files changed

+171
-224
lines changed

9 files changed

+171
-224
lines changed

Cargo.lock

Lines changed: 112 additions & 195 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ docker run --rm \
164164
165165
To enable a full [Spotify connect](https://www.spotify.com/us/connect/) support, users will need to enable a _"user-provided client integration"_.
166166
167-
This integration can be done by following [this documentation](https://developer.spotify.com/documentation/general/guides/authorization/app-settings/) to register a Spotify app and then specifying the app's `client_id` in the [general configuration file](docs/config.md#general).
167+
This integration can be done by following [this documentation](https://developer.spotify.com/documentation/general/guides/authorization/app-settings/) to register a Spotify app and then specifying the app's `client_id` in the [general configuration file](docs/config.md#general). **NOTE**: please make sure that you specify `http://127.0.0.1:8989/login` (default value of `login_redirect_uri` config option) in the **Redirect URI** section when creating the app.
168168
169169
Upon running `spotify_player` with a user-provided `client_id`, user will be prompted to authenticate the app described earlier. **NOTE** that this prompt is different from the prompt to authenticate `spotify_player`. Upon accepting the authentication request, `spotify_player` will retrieve an access token of the app to finish setting up the integration.
170170

lyric_finder/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ rustls-tls = ["reqwest/rustls-tls"]
1414
native-tls = ["reqwest/native-tls"]
1515

1616
[dependencies]
17-
reqwest = { version = "0.12.22", features = ["json", "native-tls-alpn", "http2"], default-features = false }
18-
anyhow = "1.0.98"
17+
reqwest = { version = "0.12.23", features = ["json", "native-tls-alpn", "http2"], default-features = false }
18+
anyhow = "1.0.99"
1919
serde = { version = "1.0.219", features = ["derive"] }
2020
html5ever = "=0.27.0"
2121
markup5ever_rcdom = "0.3.0"
2222
log = "0.4.27"
2323

2424
[dev-dependencies]
25-
tokio = { version = "1.47.0", features = ["rt", "rt-multi-thread", "macros"] }
25+
tokio = { version = "1.47.1", features = ["rt", "rt-multi-thread", "macros"] }
2626
env_logger = { version = "0.11.8", default-features = false }
2727

2828
[[example]]

spotify_player/Cargo.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "spotify_player"
3-
version = "0.20.7"
3+
version = "0.21.0"
44
authors = ["Thang Pham <[email protected]>"]
55
edition = "2021"
66
license = "MIT"
@@ -10,36 +10,36 @@ keywords = ["spotify", "tui", "ratatui", "player"]
1010
readme = "../README.md"
1111

1212
[dependencies]
13-
anyhow = "1.0.98"
14-
clap = { version = "4.5.41", features = ["derive", "string"] }
13+
anyhow = "1.0.99"
14+
clap = { version = "4.5.46", features = ["derive", "string"] }
1515
config_parser2 = "0.1.6"
1616
crossterm = "0.29.0"
1717
dirs-next = "2.0.0"
18-
librespot-connect = { version = "0.7.0", optional = true }
19-
librespot-core = "0.7.0"
20-
librespot-oauth = "0.7.0"
21-
librespot-playback = { version = "0.7.0", optional = true }
22-
librespot-metadata = "0.7.0"
18+
librespot-connect = { version = "0.7.1", optional = true }
19+
librespot-core = { version = "0.7.1" }
20+
librespot-oauth = { version = "0.7.1" }
21+
librespot-playback = {version = "0.7.0", optional = true, default-features = false, features = ["native-tls"]}
22+
librespot-metadata = { version = "0.7.1" }
2323
log = "0.4.27"
2424
chrono = "0.4.41"
2525
chrono-humanize = "0.2.3"
26-
reqwest = { version = "0.12.22", features = ["json"] }
27-
rspotify = {version = "0.15.0", features = ["cli"] }
26+
reqwest = { version = "0.12.23", features = ["json"] }
27+
rspotify = {version = "0.15.1", features = ["cli"] }
2828
serde = { version = "1.0.219", features = ["derive"] }
29-
tokio = { version = "1.47.0", features = [
29+
tokio = { version = "1.47.1", features = [
3030
"rt",
3131
"rt-multi-thread",
3232
"macros",
3333
"time",
3434
] }
35-
toml = "0.9.2"
35+
toml = "0.9.5"
3636
ratatui = { version = "0.29.0" }
3737
rand = "0.9.2"
3838
maybe-async = "0.2.10"
39-
async-trait = "0.1.88"
39+
async-trait = "0.1.89"
4040
parking_lot = "0.12.4"
4141
tracing = "0.1.41"
42-
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
42+
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
4343
backtrace = "0.3.75"
4444
souvlaki = { version = "0.8.3", optional = true }
4545
viuer = { version = "0.9.2", optional = true }
@@ -48,11 +48,11 @@ notify-rust = { version = "4.11.7", optional = true, default-features = false, f
4848
"d",
4949
] }
5050
flume = "0.11.1"
51-
serde_json = "1.0.141"
52-
regex = "1.11.1"
51+
serde_json = "1.0.143"
52+
regex = "1.11.2"
5353
daemonize = { version = "0.5.0", optional = true }
5454
ttl_cache = "0.5.1"
55-
clap_complete = "4.5.55"
55+
clap_complete = "4.5.57"
5656
which = "8.0.0"
5757
fuzzy-matcher = { version = "0.3.7", optional = true }
5858
html-escape = "0.2.13"

spotify_player/src/client/mod.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,7 +1573,7 @@ impl AppClient {
15731573
let prev_name = match prev_item {
15741574
Some(rspotify::model::PlayableItem::Track(track)) => track.name.clone(),
15751575
Some(rspotify::model::PlayableItem::Episode(episode)) => episode.name.clone(),
1576-
None => String::new(),
1576+
Some(rspotify::model::PlayableItem::Unknown(_)) | None => String::new(),
15771577
};
15781578

15791579
player.playback = playback;
@@ -1584,7 +1584,7 @@ impl AppClient {
15841584
let curr_name = match curr_item {
15851585
Some(rspotify::model::PlayableItem::Track(track)) => track.name.clone(),
15861586
Some(rspotify::model::PlayableItem::Episode(episode)) => episode.name.clone(),
1587-
None => String::new(),
1587+
Some(rspotify::model::PlayableItem::Unknown(_)) | None => String::new(),
15881588
};
15891589

15901590
let new_playback = prev_name != curr_name && !curr_name.is_empty();
@@ -1654,7 +1654,8 @@ impl AppClient {
16541654
}
16551655
}
16561656
}
1657-
rspotify::model::PlayableItem::Episode(_) => None,
1657+
rspotify::model::PlayableItem::Episode(_)
1658+
| rspotify::model::PlayableItem::Unknown(_) => None,
16581659
};
16591660

16601661
if let Some(artist) = curr_artist {
@@ -1676,6 +1677,7 @@ impl AppClient {
16761677
crate::utils::get_episode_show_image_url(episode)
16771678
.ok_or(anyhow::anyhow!("missing image"))?
16781679
}
1680+
rspotify::model::PlayableItem::Unknown(_) => return Ok(()),
16791681
};
16801682

16811683
let filename = (match curr_item {
@@ -1697,6 +1699,7 @@ impl AppClient {
16971699
&episode.show.id.as_ref().id()[..6]
16981700
)
16991701
}
1702+
rspotify::model::PlayableItem::Unknown(_) => return Ok(()),
17001703
})
17011704
.replace('/', ""); // remove invalid characters from the file's name
17021705
let path = configs.cache_folder.join("image").join(filename);
@@ -1808,6 +1811,7 @@ impl AppClient {
18081811
let name = match playable {
18091812
rspotify::model::PlayableItem::Track(ref track) => &track.name,
18101813
rspotify::model::PlayableItem::Episode(ref episode) => &episode.name,
1814+
rspotify::model::PlayableItem::Unknown(_) => continue,
18111815
};
18121816
text += name;
18131817
}
@@ -1823,6 +1827,7 @@ impl AppClient {
18231827
rspotify::model::PlayableItem::Episode(ref episode) => {
18241828
text += &episode.show.name;
18251829
}
1830+
rspotify::model::PlayableItem::Unknown(_) => {}
18261831
},
18271832
&_ => {}
18281833
}

spotify_player/src/event/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn handle_mouse_event(
7777
let duration = match player.currently_playing() {
7878
Some(rspotify::model::PlayableItem::Track(track)) => Some(track.duration),
7979
Some(rspotify::model::PlayableItem::Episode(episode)) => Some(episode.duration),
80-
None => None,
80+
Some(rspotify::model::PlayableItem::Unknown(_)) | None => None,
8181
};
8282
if let Some(duration) = duration {
8383
let position_ms =
@@ -534,6 +534,9 @@ fn handle_global_action(
534534
ui,
535535
);
536536
}
537+
rspotify::model::PlayableItem::Unknown(_) => {
538+
return Ok(false);
539+
}
537540
}
538541
}
539542
}
@@ -633,6 +636,7 @@ fn handle_global_command(
633636
ListState::default(),
634637
));
635638
}
639+
rspotify::model::PlayableItem::Unknown(_) => {}
636640
}
637641
}
638642
}
@@ -831,7 +835,7 @@ fn handle_global_command(
831835
Some(rspotify::model::PlayableItem::Episode(episode)) => {
832836
PlayableId::Episode(episode.id.clone())
833837
}
834-
None => return Ok(false),
838+
Some(rspotify::model::PlayableItem::Unknown(_)) | None => return Ok(false),
835839
};
836840

837841
if let PageState::Context {

spotify_player/src/media_control.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ fn update_control_metadata(
3030
}
3131

3232
match item {
33+
rspotify::model::PlayableItem::Unknown(_) => {}
3334
rspotify::model::PlayableItem::Track(track) => {
3435
// only update metadata when the track information is changed
3536
let track_info = format!("{}/{}", track.name, track.album.name);

spotify_player/src/ui/page.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,9 +727,9 @@ pub fn render_queue_page(
727727
fn get_playable_name(item: &PlayableItem) -> String {
728728
match item {
729729
PlayableItem::Track(FullTrack { ref name, .. })
730-
| PlayableItem::Episode(FullEpisode { ref name, .. }) => name,
730+
| PlayableItem::Episode(FullEpisode { ref name, .. }) => name.to_string(),
731+
PlayableItem::Unknown(_) => String::new(),
731732
}
732-
.to_string()
733733
}
734734
fn get_playable_artists(item: &PlayableItem) -> String {
735735
match item {
@@ -739,12 +739,14 @@ pub fn render_queue_page(
739739
.collect::<Vec<_>>()
740740
.join(", "),
741741
PlayableItem::Episode(FullEpisode { ref show, .. }) => show.publisher.clone(),
742+
PlayableItem::Unknown(_) => String::new(),
742743
}
743744
}
744745
fn get_playable_duration(item: &PlayableItem) -> String {
745746
match item {
746747
PlayableItem::Track(FullTrack { ref duration, .. })
747748
| PlayableItem::Episode(FullEpisode { ref duration, .. }) => format_duration(duration),
749+
PlayableItem::Unknown(_) => String::new(),
748750
}
749751
}
750752

spotify_player/src/ui/playback.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub fn render_playback_window(
5454
rspotify::model::PlayableItem::Episode(episode) => {
5555
crate::utils::get_episode_show_image_url(episode).map(String::from)
5656
}
57+
rspotify::model::PlayableItem::Unknown(_) => None,
5758
};
5859
if let Some(url) = url {
5960
let needs_clear = if ui.last_cover_image_render_info.url != url
@@ -121,6 +122,10 @@ pub fn render_playback_window(
121122
let duration = match item {
122123
rspotify::model::PlayableItem::Track(track) => track.duration,
123124
rspotify::model::PlayableItem::Episode(episode) => episode.duration,
125+
rspotify::model::PlayableItem::Unknown(item) => {
126+
log::warn!("Unknown playback item: {item:?}");
127+
return other_rect;
128+
}
124129
};
125130

126131
let progress = std::cmp::min(
@@ -250,7 +255,8 @@ fn construct_playback_text(
250255
}
251256
None => continue,
252257
},
253-
rspotify::model::PlayableItem::Episode(_) => continue,
258+
rspotify::model::PlayableItem::Episode(_)
259+
| rspotify::model::PlayableItem::Unknown(_) => continue,
254260
},
255261
"{track}" => match playable {
256262
rspotify::model::PlayableItem::Track(track) => (
@@ -275,6 +281,9 @@ fn construct_playback_text(
275281
},
276282
ui.theme.playback_track(),
277283
),
284+
rspotify::model::PlayableItem::Unknown(_) => {
285+
continue;
286+
}
278287
},
279288
"{artists}" => match playable {
280289
rspotify::model::PlayableItem::Track(track) => (
@@ -284,6 +293,9 @@ fn construct_playback_text(
284293
rspotify::model::PlayableItem::Episode(episode) => {
285294
(episode.show.publisher.clone(), ui.theme.playback_artists())
286295
}
296+
rspotify::model::PlayableItem::Unknown(_) => {
297+
continue;
298+
}
287299
},
288300
"{album}" => match playable {
289301
rspotify::model::PlayableItem::Track(track) => {
@@ -293,6 +305,9 @@ fn construct_playback_text(
293305
to_bidi_string(&episode.show.name),
294306
ui.theme.playback_album(),
295307
),
308+
rspotify::model::PlayableItem::Unknown(_) => {
309+
continue;
310+
}
296311
},
297312
"{genres}" => match playable {
298313
rspotify::model::PlayableItem::Track(full_track) => {
@@ -305,6 +320,9 @@ fn construct_playback_text(
305320
rspotify::model::PlayableItem::Episode(_) => {
306321
(to_bidi_string("no genre"), ui.theme.playback_genres())
307322
}
323+
rspotify::model::PlayableItem::Unknown(_) => {
324+
continue;
325+
}
308326
},
309327
"{metadata}" => {
310328
let repeat_value = if playback.fake_track_repeat_state {

0 commit comments

Comments
 (0)