mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
Don't panic on local files (#846)
Skip tracks whose Spotify ID can't be found
This commit is contained in:
parent
e27992a754
commit
7401d6a96e
2 changed files with 3 additions and 2 deletions
|
@ -49,6 +49,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- [playback] `alsa`, `gstreamer`, `pulseaudio`: always output in native endianness
|
||||
- [playback] `alsa`: revert buffer size to ~500 ms
|
||||
- [playback] `alsa`, `pipe`, `pulseaudio`: better error handling
|
||||
- [metadata] Skip tracks whose Spotify ID's can't be found (e.g. local files, which aren't supported)
|
||||
|
||||
## [0.2.0] - 2021-05-04
|
||||
|
||||
|
|
|
@ -291,10 +291,10 @@ impl Metadata for Playlist {
|
|||
.get_contents()
|
||||
.get_items()
|
||||
.iter()
|
||||
.map(|item| {
|
||||
.filter_map(|item| {
|
||||
let uri_split = item.get_uri().split(':');
|
||||
let uri_parts: Vec<&str> = uri_split.collect();
|
||||
SpotifyId::from_base62(uri_parts[2]).unwrap()
|
||||
SpotifyId::from_base62(uri_parts[2]).ok()
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
|
Loading…
Reference in a new issue