mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 10:19:27 +02:00
Fix playlist metadata fields parsing (#1019)
Some fields were wrongly parsed as `SpotifyId`s, although they do not always encode exactly 16 bytes in practice. Also, some optional fields caused `[]` to be parsed as `SpotifyId`, which obviously failed as well.
This commit is contained in:
parent
05b9b13cf8
commit
88f7cdbb44
6 changed files with 29 additions and 32 deletions
|
@ -1,5 +1,5 @@
|
|||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
convert::TryFrom,
|
||||
ops::{Deref, DerefMut},
|
||||
};
|
||||
|
||||
|
@ -152,7 +152,7 @@ impl TryFrom<CdnUrlMessage> for MaybeExpiringUrls {
|
|||
|
||||
Ok(MaybeExpiringUrl(
|
||||
cdn_url.to_owned(),
|
||||
Some(expiry.try_into()?),
|
||||
Some(Date::from_timestamp_ms(expiry * 1000)?),
|
||||
))
|
||||
} else {
|
||||
Ok(MaybeExpiringUrl(cdn_url.to_owned(), None))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue