mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-03 01:39:28 +02:00
Update protobuf and related crates to 3.x (#1092)
This commit is contained in:
parent
8941495b80
commit
3662302196
38 changed files with 694 additions and 672 deletions
|
@ -423,12 +423,12 @@ impl TryFrom<&Vec<u8>> for SpotifyId {
|
|||
impl TryFrom<&protocol::spirc::TrackRef> for SpotifyId {
|
||||
type Error = crate::Error;
|
||||
fn try_from(track: &protocol::spirc::TrackRef) -> Result<Self, Self::Error> {
|
||||
match SpotifyId::from_raw(track.get_gid()) {
|
||||
match SpotifyId::from_raw(track.gid()) {
|
||||
Ok(mut id) => {
|
||||
id.item_type = SpotifyItemType::Track;
|
||||
Ok(id)
|
||||
}
|
||||
Err(_) => SpotifyId::from_uri(track.get_uri()),
|
||||
Err(_) => SpotifyId::from_uri(track.uri()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -438,7 +438,7 @@ impl TryFrom<&protocol::metadata::Album> for SpotifyId {
|
|||
fn try_from(album: &protocol::metadata::Album) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
item_type: SpotifyItemType::Album,
|
||||
..Self::from_raw(album.get_gid())?
|
||||
..Self::from_raw(album.gid())?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ impl TryFrom<&protocol::metadata::Artist> for SpotifyId {
|
|||
fn try_from(artist: &protocol::metadata::Artist) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
item_type: SpotifyItemType::Artist,
|
||||
..Self::from_raw(artist.get_gid())?
|
||||
..Self::from_raw(artist.gid())?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ impl TryFrom<&protocol::metadata::Episode> for SpotifyId {
|
|||
fn try_from(episode: &protocol::metadata::Episode) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
item_type: SpotifyItemType::Episode,
|
||||
..Self::from_raw(episode.get_gid())?
|
||||
..Self::from_raw(episode.gid())?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ impl TryFrom<&protocol::metadata::Track> for SpotifyId {
|
|||
fn try_from(track: &protocol::metadata::Track) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
item_type: SpotifyItemType::Track,
|
||||
..Self::from_raw(track.get_gid())?
|
||||
..Self::from_raw(track.gid())?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -478,7 +478,7 @@ impl TryFrom<&protocol::metadata::Show> for SpotifyId {
|
|||
fn try_from(show: &protocol::metadata::Show) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
item_type: SpotifyItemType::Show,
|
||||
..Self::from_raw(show.get_gid())?
|
||||
..Self::from_raw(show.gid())?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -488,7 +488,7 @@ impl TryFrom<&protocol::metadata::ArtistWithRole> for SpotifyId {
|
|||
fn try_from(artist: &protocol::metadata::ArtistWithRole) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
item_type: SpotifyItemType::Artist,
|
||||
..Self::from_raw(artist.get_artist_gid())?
|
||||
..Self::from_raw(artist.artist_gid())?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -498,7 +498,7 @@ impl TryFrom<&protocol::playlist4_external::Item> for SpotifyId {
|
|||
fn try_from(item: &protocol::playlist4_external::Item) -> Result<Self, Self::Error> {
|
||||
Ok(Self {
|
||||
item_type: SpotifyItemType::Track,
|
||||
..Self::from_uri(item.get_uri())?
|
||||
..Self::from_uri(item.uri())?
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -508,7 +508,7 @@ impl TryFrom<&protocol::playlist4_external::Item> for SpotifyId {
|
|||
impl TryFrom<&protocol::playlist4_external::MetaItem> for SpotifyId {
|
||||
type Error = crate::Error;
|
||||
fn try_from(item: &protocol::playlist4_external::MetaItem) -> Result<Self, Self::Error> {
|
||||
Self::try_from(item.get_revision())
|
||||
Self::try_from(item.revision())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -518,7 +518,7 @@ impl TryFrom<&protocol::playlist4_external::SelectedListContent> for SpotifyId {
|
|||
fn try_from(
|
||||
playlist: &protocol::playlist4_external::SelectedListContent,
|
||||
) -> Result<Self, Self::Error> {
|
||||
Self::try_from(playlist.get_revision())
|
||||
Self::try_from(playlist.revision())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -530,7 +530,7 @@ impl TryFrom<&protocol::playlist_annotate3::TranscodedPicture> for SpotifyId {
|
|||
fn try_from(
|
||||
picture: &protocol::playlist_annotate3::TranscodedPicture,
|
||||
) -> Result<Self, Self::Error> {
|
||||
Self::from_base62(picture.get_uri())
|
||||
Self::from_base62(picture.uri())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue