mirror of
https://github.com/librespot-org/librespot.git
synced 2025-03-09 00:17:28 +00:00
metadata: handle empty trailer_uri for shows (#1432)
* metadata: handle empty trailer_uri for shows * chore: update changelog
This commit is contained in:
parent
2a574267ae
commit
7003e98c1b
2 changed files with 8 additions and 2 deletions
|
@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
client ID on Android platform.
|
||||
- [connect] Fix "play" command not handled if missing "offset" property
|
||||
- [discovery] Fix libmdns zerconf setup errors not propagating to the main task.
|
||||
- [metadata] `Show::trailer_uri` is now optional since it isn't always present (breaking)
|
||||
|
||||
### Removed
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ pub struct Show {
|
|||
pub media_type: ShowMediaType,
|
||||
pub consumption_order: ShowConsumptionOrder,
|
||||
pub availability: Availabilities,
|
||||
pub trailer_uri: SpotifyId,
|
||||
pub trailer_uri: Option<SpotifyId>,
|
||||
pub has_music_and_talk: bool,
|
||||
pub is_audiobook: bool,
|
||||
}
|
||||
|
@ -63,7 +63,12 @@ impl TryFrom<&<Self as Metadata>::Message> for Show {
|
|||
media_type: show.media_type(),
|
||||
consumption_order: show.consumption_order(),
|
||||
availability: show.availability.as_slice().try_into()?,
|
||||
trailer_uri: SpotifyId::from_uri(show.trailer_uri())?,
|
||||
trailer_uri: show
|
||||
.trailer_uri
|
||||
.as_deref()
|
||||
.filter(|s| !s.is_empty())
|
||||
.map(SpotifyId::from_uri)
|
||||
.transpose()?,
|
||||
has_music_and_talk: show.music_and_talk(),
|
||||
is_audiobook: show.is_audiobook(),
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue