Various changes following review

This commit is contained in:
HEnquist 2019-09-22 21:21:44 +02:00
parent cee786ebc0
commit a4f0fe96f8
4 changed files with 15 additions and 6 deletions

1
Cargo.lock generated
View file

@ -927,6 +927,7 @@ dependencies = [
"librespot-core 0.1.0",
"librespot-protocol 0.1.0",
"linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
"protobuf 2.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]

View file

@ -8,6 +8,7 @@ byteorder = "1.3"
futures = "0.1"
linear-map = "1.2"
protobuf = "2.8.*"
log = "0.4"
[dependencies.librespot-core]
path = "../core"

View file

@ -1,3 +1,6 @@
#[macro_use]
extern crate log;
extern crate byteorder;
extern crate futures;
extern crate linear_map;
@ -95,8 +98,8 @@ pub struct Album {
#[derive(Debug, Clone)]
pub struct Playlist {
pub revision: Vec<u8>,
pub user: String,
pub length: i32,
pub name: String,
pub tracks: Vec<SpotifyId>,
}
@ -218,9 +221,13 @@ impl Metadata for Playlist {
})
.collect::<Vec<_>>();
if tracks.len() != msg.get_length() as usize {
warn!("Got {} tracks, but the playlist should contain {} tracks.", tracks.len(), msg.get_length());
}
Playlist {
revision: msg.get_revision().to_vec(),
name: msg.get_attributes().get_name().to_owned(),
length: msg.get_length(),
tracks: tracks,
user: msg.get_owner_username().to_string(),
}

View file

@ -6,9 +6,9 @@ pub mod keyexchange;
pub mod mercury;
pub mod metadata;
pub mod playlist4changes;
pub mod playlist4content;
pub mod playlist4issues;
pub mod playlist4meta;
pub mod playlist4ops;
mod playlist4content;
mod playlist4issues;
mod playlist4meta;
mod playlist4ops;
pub mod pubsub;
pub mod spirc;