diff --git a/connect/src/spirc.rs b/connect/src/spirc.rs index 37576a9e..92e26ce0 100644 --- a/connect/src/spirc.rs +++ b/connect/src/spirc.rs @@ -168,6 +168,7 @@ fn initial_device_state(config: ConnectConfig) -> DeviceState { let repeated = msg.mut_stringValue(); repeated.push(::std::convert::Into::into("audio/local")); repeated.push(::std::convert::Into::into("audio/track")); + repeated.push(::std::convert::Into::into("audio/episode")); repeated.push(::std::convert::Into::into("local")); repeated.push(::std::convert::Into::into("track")) }; @@ -796,6 +797,7 @@ impl SpircTask { } fn update_tracks(&mut self, frame: &protocol::spirc::Frame) { + // debug!("State: {:?}", frame.get_state()); let index = frame.get_state().get_playing_track_index(); let context_uri = frame.get_state().get_context_uri().to_owned(); let tracks = frame.get_state().get_track(); @@ -812,7 +814,14 @@ impl SpircTask { } fn load_track(&mut self, play: bool) { - let track = { + let context_uri = self.state.get_context_uri().to_owned(); + let index = self.state.get_playing_track_index(); + info!("context: {}", context_uri); + // Redundant check here + let track = if context_uri.contains(":show:") || context_uri.contains(":episode:") { + let uri = self.state.get_track()[index as usize].get_uri(); + SpotifyId::from_uri(uri).expect("Unable to parse uri") + } else { let mut index = self.state.get_playing_track_index(); // Check for malformed gid let tracks_len = self.state.get_track().len() as u32; diff --git a/core/src/spotify_id.rs b/core/src/spotify_id.rs index 79414a18..01c4ddd4 100644 --- a/core/src/spotify_id.rs +++ b/core/src/spotify_id.rs @@ -1,8 +1,17 @@ use std; use std::fmt; -#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] -pub struct SpotifyId(u128); +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub enum SpotifyTrackType { + Track, + Podcast, +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +pub struct SpotifyId { + pub id: u128, + pub track_type: SpotifyTrackType, +} #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] pub struct SpotifyIdError; @@ -11,6 +20,13 @@ const BASE62_DIGITS: &'static [u8] = b"0123456789abcdefghijklmnopqrstuvwxyzABCDE const BASE16_DIGITS: &'static [u8] = b"0123456789abcdef"; impl SpotifyId { + fn as_track(n: u128) -> SpotifyId { + SpotifyId { + id: n.to_owned(), + track_type: SpotifyTrackType::Track, + } + } + pub fn from_base16(id: &str) -> Result { let data = id.as_bytes(); @@ -24,7 +40,7 @@ impl SpotifyId { n = n + d; } - Ok(SpotifyId(n)) + Ok(SpotifyId::as_track(n)) } pub fn from_base62(id: &str) -> Result { @@ -39,8 +55,7 @@ impl SpotifyId { n = n * 62; n = n + d; } - - Ok(SpotifyId(n)) + Ok(SpotifyId::as_track(n)) } pub fn from_raw(data: &[u8]) -> Result { @@ -51,15 +66,26 @@ impl SpotifyId { let mut arr: [u8; 16] = Default::default(); arr.copy_from_slice(&data[0..16]); - Ok(SpotifyId(u128::from_be_bytes(arr))) + Ok(SpotifyId::as_track(u128::from_be_bytes(arr))) + } + + pub fn from_uri(uri: &str) -> Result { + let parts = uri.split(":").collect::>(); + if uri.contains(":show:") || uri.contains(":episode:") { + let mut spotify_id = SpotifyId::from_base62(parts[2]).unwrap(); + spotify_id.track_type = SpotifyTrackType::Podcast; + Ok(spotify_id) + } else { + SpotifyId::from_base62(parts[2]) + } } pub fn to_base16(&self) -> String { - format!("{:032x}", self.0) + format!("{:032x}", self.id) } pub fn to_base62(&self) -> String { - let &SpotifyId(mut n) = self; + let &SpotifyId { id: mut n, .. } = self; let mut data = [0u8; 22]; for i in 0..22 { @@ -71,7 +97,7 @@ impl SpotifyId { } pub fn to_raw(&self) -> [u8; 16] { - self.0.to_be_bytes() + self.id.to_be_bytes() } } diff --git a/metadata/src/lib.rs b/metadata/src/lib.rs index 60ca2738..6aa6a5bd 100644 --- a/metadata/src/lib.rs +++ b/metadata/src/lib.rs @@ -93,6 +93,28 @@ pub struct Album { pub covers: Vec, } +#[derive(Debug, Clone)] +pub struct Episode { + pub id: SpotifyId, + pub name: String, + pub external_url: String, + pub duration: i32, + pub language: String, + pub show: SpotifyId, + pub files: LinearMap, + pub covers: Vec, + pub available: bool, + pub explicit: bool, +} + +#[derive(Debug, Clone)] +pub struct Show { + pub id: SpotifyId, + pub name: String, + pub episodes: Vec, + pub covers: Vec, +} + #[derive(Debug, Clone)] pub struct Artist { pub id: SpotifyId, @@ -222,6 +244,91 @@ impl Metadata for Artist { } } +// Podcast +impl Metadata for Episode { + type Message = protocol::metadata::Episode; + + fn base_url() -> &'static str { + "hm://metadata/3/episode" + } + + fn parse(msg: &Self::Message, session: &Session) -> Self { + let country = session.country(); + + let files = msg + .get_file() + .iter() + .filter(|file| file.has_file_id()) + .map(|file| { + let mut dst = [0u8; 20]; + dst.clone_from_slice(file.get_file_id()); + (file.get_format(), FileId(dst)) + }) + .collect(); + + let covers = msg + .get_covers() + .get_image() + .iter() + .filter(|image| image.has_file_id()) + .map(|image| { + let mut dst = [0u8; 20]; + dst.clone_from_slice(image.get_file_id()); + FileId(dst) + }) + .collect::>(); + + Episode { + id: SpotifyId::from_raw(msg.get_gid()).unwrap(), + name: msg.get_name().to_owned(), + external_url: msg.get_external_url().to_owned(), + duration: msg.get_duration().to_owned(), + language: msg.get_language().to_owned(), + show: SpotifyId::from_raw(msg.get_show().get_gid()).unwrap(), + covers: covers, + files: files, + available: parse_restrictions(msg.get_restriction(), &country, "premium"), + explicit: msg.get_explicit().to_owned(), + } + } +} + +impl Metadata for Show { + type Message = protocol::metadata::Show; + + fn base_url() -> &'static str { + "hm://metadata/3/show" + } + + fn parse(msg: &Self::Message, _: &Session) -> Self { + let episodes = msg + .get_episode() + .iter() + .filter(|episode| episode.has_gid()) + .map(|episode| SpotifyId::from_raw(episode.get_gid()).unwrap()) + .collect::>(); + + let covers = msg + .get_covers() + .get_image() + .iter() + .filter(|image| image.has_file_id()) + .map(|image| { + let mut dst = [0u8; 20]; + dst.clone_from_slice(image.get_file_id()); + FileId(dst) + }) + .collect::>(); + + Show { + id: SpotifyId::from_raw(msg.get_gid()).unwrap(), + name: msg.get_name().to_owned(), + episodes: episodes, + covers: covers, + } + } +} + struct StrChunks<'s>(&'s str, usize); trait StrChunksExt { diff --git a/playback/src/player.rs b/playback/src/player.rs index 4be73acd..3b48a594 100644 --- a/playback/src/player.rs +++ b/playback/src/player.rs @@ -12,12 +12,12 @@ use std::time::Duration; use config::{Bitrate, PlayerConfig}; use librespot_core::session::Session; -use librespot_core::spotify_id::SpotifyId; +use librespot_core::spotify_id::{FileId, SpotifyId, SpotifyTrackType}; use audio::{AudioDecrypt, AudioFile}; use audio::{VorbisDecoder, VorbisPacket}; use audio_backend::Sink; -use metadata::{FileFormat, Metadata, Track}; +use metadata::{Episode, FileFormat, Metadata, Track}; use mixer::AudioFilter; pub struct Player { @@ -526,44 +526,77 @@ impl PlayerInternal { } } - fn load_track(&self, track_id: SpotifyId, position: i64) -> Option<(Decoder, f32)> { - let track = Track::get(&self.session, track_id).wait().unwrap(); + fn get_file_id(&self, spotify_id: SpotifyId) -> Option { + let file_id = match spotify_id.track_type { + SpotifyTrackType::Track => { + let track = Track::get(&self.session, spotify_id).wait().unwrap(); - info!( - "Loading track \"{}\" with Spotify URI \"spotify:track:{}\"", - track.name, - track_id.to_base62() - ); + info!( + "Loading track \"{}\" with Spotify URI \"spotify:track:{}\"", + track.name, + spotify_id.to_base62() + ); - let track = match self.find_available_alternative(&track) { - Some(track) => track, - None => { - warn!("Track \"{}\" is not available", track.name); - return None; + let track = match self.find_available_alternative(&track) { + Some(track) => track, + None => { + warn!("Track \"{}\" is not available", track.name); + return None; + } + }; + + let format = match self.config.bitrate { + Bitrate::Bitrate96 => FileFormat::OGG_VORBIS_96, + Bitrate::Bitrate160 => FileFormat::OGG_VORBIS_160, + Bitrate::Bitrate320 => FileFormat::OGG_VORBIS_320, + }; + match track.files.get(&format) { + Some(&file_id) => file_id, + None => { + warn!("Track \"{}\" is not available in format {:?}", track.name, format); + return None; + } + } + } + // This should be refactored! + SpotifyTrackType::Podcast => { + let episode = Episode::get(&self.session, spotify_id).wait().unwrap(); + info!("Episode {:?}", episode); + + info!( + "Loading episode \"{}\" with Spotify URI \"spotify:episode:{}\"", + episode.name, + spotify_id.to_base62() + ); + + // Podcasts seem to have only 96 OGG_VORBIS support, other filetypes indicate + // AAC_24, MP4_128, MP4_128_DUAL, MP3_96 among others + let format = match self.config.bitrate { + _ => FileFormat::OGG_VORBIS_96, + }; + + match episode.files.get(&format) { + Some(&file_id) => file_id, + None => { + warn!( + "Episode \"{}\" is not available in format {:?}", + episode.name, format + ); + return None; + } + } } }; + return Some(file_id); + } - let format = match self.config.bitrate { - Bitrate::Bitrate96 => FileFormat::OGG_VORBIS_96, - Bitrate::Bitrate160 => FileFormat::OGG_VORBIS_160, - Bitrate::Bitrate320 => FileFormat::OGG_VORBIS_320, - }; + fn load_track(&self, spotify_id: SpotifyId, position: i64) -> Option<(Decoder, f32)> { + let file_id = self.get_file_id(spotify_id).unwrap(); + info!("{:?} -> {:?}", spotify_id, file_id); - let file_id = match track.files.get(&format) { - Some(&file_id) => file_id, - None => { - warn!("Track \"{}\" is not available in format {:?}", track.name, format); - return None; - } - }; - - let key = self - .session - .audio_key() - .request(track.id, file_id); + let key = self.session.audio_key().request(spotify_id, file_id); let encrypted_file = AudioFile::open(&self.session, file_id); - let encrypted_file = encrypted_file.wait().unwrap(); let key = key.wait().unwrap(); let mut decrypted_file = AudioDecrypt::new(key, encrypted_file); @@ -587,7 +620,7 @@ impl PlayerInternal { } } - info!("Track \"{}\" loaded", track.name); + // info!("Track \"{}\" loaded", track.name); Some((decoder, normalisation_factor)) } diff --git a/protocol/files.rs b/protocol/files.rs new file mode 100644 index 00000000..f4ddd9ad --- /dev/null +++ b/protocol/files.rs @@ -0,0 +1,9 @@ +// Autogenerated by build.rs +pub const FILES: &'static [(&'static str, u32)] = &[ + ("proto/authentication.proto", 2098196376), + ("proto/keyexchange.proto", 451735664), + ("proto/mercury.proto", 709993906), + ("proto/metadata.proto", 1409162985), + ("proto/pubsub.proto", 2686584829), + ("proto/spirc.proto", 1587493382), +]; diff --git a/protocol/proto/metadata.proto b/protocol/proto/metadata.proto index 1a7a900b..c3730ca7 100644 --- a/protocol/proto/metadata.proto +++ b/protocol/proto/metadata.proto @@ -156,12 +156,87 @@ message AudioFile { MP3_160 = 0x5; MP3_96 = 0x6; MP3_160_ENC = 0x7; - OTHER2 = 0x8; + MP4_128_DUAL = 0x8; OTHER3 = 0x9; AAC_160 = 0xa; AAC_320 = 0xb; - OTHER4 = 0xc; + MP4_128 = 0xc; OTHER5 = 0xd; } } +// Podcast Protos +message PublishTime { + optional sint32 year = 0x1; + optional sint32 month = 0x2; + optional sint32 day = 0x3; + // These seem to be differently encoded + optional sint32 minute = 0x5; + optional sint32 hour = 0x4; +} + +message Show { + optional bytes gid = 0x1; + optional string name = 0x2; + repeated Episode episode = 0x46; + // Educated guesses + optional string description = 0x40; + optional string publisher = 0x42; + optional string language = 0x43; + optional bool explicit = 0x44; + optional ImageGroup covers = 0x45; + repeated Restriction restriction = 0x48; + optional MediaType media_type = 0x4A; + optional ConsumptionOrder consumption_order = 0x4B; + optional bool interpret_restriction_using_geoip = 0x4C; + optional string country_of_origin = 0x4F; + repeated Category categories = 0x50; + optional PassthroughEnum passthrough = 0x51; +} + +enum ConsumptionOrder { + SEQUENTIAL = 1; + EPISODIC = 2; + RECENT = 3; + } +enum MediaType { + MIXED = 0; + AUDIO = 1; + VIDEO = 2; +} +enum PassthroughEnum { + UNKNOWN = 0; + NONE = 1; +} + +message Episode { + optional bytes gid = 0x1; + optional string name = 0x2; + optional sint32 duration = 0x7; + optional sint32 popularity = 0x8; + repeated AudioFile file = 0xc; + // Educated guesses + optional string description = 0x40; + optional Date publish_time = 0x42; + optional ImageGroup covers = 0x44; + optional string language = 0x45; + optional bool explicit = 0x46; + optional Show show = 0x47; + repeated AudioFile preview = 0x4A; + repeated Restriction restriction = 0x4B; + // Order of these flags might be wrong! + optional bool suppress_monetization = 0x4E; + optional bool allow_background_playback = 0x4F; + optional bool interpret_restriction_using_geoip = 0x51; + optional string external_url = 0x53; + optional OriginalAudio original_audio = 0x54; +} + +message Category { + optional string name = 0x1; + repeated Category subcategories = 0x2; +} + +message OriginalAudio { + optional bytes uuid = 0x1; +} diff --git a/protocol/src/metadata.rs b/protocol/src/metadata.rs index 7cfa964d..1a1a7f00 100644 --- a/protocol/src/metadata.rs +++ b/protocol/src/metadata.rs @@ -6143,11 +6143,11 @@ pub enum AudioFile_Format { MP3_160 = 5, MP3_96 = 6, MP3_160_ENC = 7, - OTHER2 = 8, + MP4_128_DUAL = 8, OTHER3 = 9, AAC_160 = 10, AAC_320 = 11, - OTHER4 = 12, + MP4_128 = 12, OTHER5 = 13, } @@ -6166,11 +6166,11 @@ impl ::protobuf::ProtobufEnum for AudioFile_Format { 5 => ::std::option::Option::Some(AudioFile_Format::MP3_160), 6 => ::std::option::Option::Some(AudioFile_Format::MP3_96), 7 => ::std::option::Option::Some(AudioFile_Format::MP3_160_ENC), - 8 => ::std::option::Option::Some(AudioFile_Format::OTHER2), + 8 => ::std::option::Option::Some(AudioFile_Format::MP4_128_DUAL), 9 => ::std::option::Option::Some(AudioFile_Format::OTHER3), 10 => ::std::option::Option::Some(AudioFile_Format::AAC_160), 11 => ::std::option::Option::Some(AudioFile_Format::AAC_320), - 12 => ::std::option::Option::Some(AudioFile_Format::OTHER4), + 12 => ::std::option::Option::Some(AudioFile_Format::MP4_128), 13 => ::std::option::Option::Some(AudioFile_Format::OTHER5), _ => ::std::option::Option::None } @@ -6186,11 +6186,11 @@ impl ::protobuf::ProtobufEnum for AudioFile_Format { AudioFile_Format::MP3_160, AudioFile_Format::MP3_96, AudioFile_Format::MP3_160_ENC, - AudioFile_Format::OTHER2, + AudioFile_Format::MP4_128_DUAL, AudioFile_Format::OTHER3, AudioFile_Format::AAC_160, AudioFile_Format::AAC_320, - AudioFile_Format::OTHER4, + AudioFile_Format::MP4_128, AudioFile_Format::OTHER5, ]; values @@ -6224,6 +6224,2729 @@ impl ::protobuf::reflect::ProtobufValue for AudioFile_Format { } } +#[derive(PartialEq,Clone,Default)] +pub struct PublishTime { + // message fields + year: ::std::option::Option, + month: ::std::option::Option, + day: ::std::option::Option, + minute: ::std::option::Option, + hour: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PublishTime { + fn default() -> &'a PublishTime { + ::default_instance() + } +} + +impl PublishTime { + pub fn new() -> PublishTime { + ::std::default::Default::default() + } + + // optional sint32 year = 1; + + + pub fn get_year(&self) -> i32 { + self.year.unwrap_or(0) + } + pub fn clear_year(&mut self) { + self.year = ::std::option::Option::None; + } + + pub fn has_year(&self) -> bool { + self.year.is_some() + } + + // Param is passed by value, moved + pub fn set_year(&mut self, v: i32) { + self.year = ::std::option::Option::Some(v); + } + + // optional sint32 month = 2; + + + pub fn get_month(&self) -> i32 { + self.month.unwrap_or(0) + } + pub fn clear_month(&mut self) { + self.month = ::std::option::Option::None; + } + + pub fn has_month(&self) -> bool { + self.month.is_some() + } + + // Param is passed by value, moved + pub fn set_month(&mut self, v: i32) { + self.month = ::std::option::Option::Some(v); + } + + // optional sint32 day = 3; + + + pub fn get_day(&self) -> i32 { + self.day.unwrap_or(0) + } + pub fn clear_day(&mut self) { + self.day = ::std::option::Option::None; + } + + pub fn has_day(&self) -> bool { + self.day.is_some() + } + + // Param is passed by value, moved + pub fn set_day(&mut self, v: i32) { + self.day = ::std::option::Option::Some(v); + } + + // optional sint32 minute = 5; + + + pub fn get_minute(&self) -> i32 { + self.minute.unwrap_or(0) + } + pub fn clear_minute(&mut self) { + self.minute = ::std::option::Option::None; + } + + pub fn has_minute(&self) -> bool { + self.minute.is_some() + } + + // Param is passed by value, moved + pub fn set_minute(&mut self, v: i32) { + self.minute = ::std::option::Option::Some(v); + } + + // optional sint32 hour = 4; + + + pub fn get_hour(&self) -> i32 { + self.hour.unwrap_or(0) + } + pub fn clear_hour(&mut self) { + self.hour = ::std::option::Option::None; + } + + pub fn has_hour(&self) -> bool { + self.hour.is_some() + } + + // Param is passed by value, moved + pub fn set_hour(&mut self, v: i32) { + self.hour = ::std::option::Option::Some(v); + } +} + +impl ::protobuf::Message for PublishTime { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_sint32()?; + self.year = ::std::option::Option::Some(tmp); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_sint32()?; + self.month = ::std::option::Option::Some(tmp); + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_sint32()?; + self.day = ::std::option::Option::Some(tmp); + }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_sint32()?; + self.minute = ::std::option::Option::Some(tmp); + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_sint32()?; + self.hour = ::std::option::Option::Some(tmp); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(v) = self.year { + my_size += ::protobuf::rt::value_varint_zigzag_size(1, v); + } + if let Some(v) = self.month { + my_size += ::protobuf::rt::value_varint_zigzag_size(2, v); + } + if let Some(v) = self.day { + my_size += ::protobuf::rt::value_varint_zigzag_size(3, v); + } + if let Some(v) = self.minute { + my_size += ::protobuf::rt::value_varint_zigzag_size(5, v); + } + if let Some(v) = self.hour { + my_size += ::protobuf::rt::value_varint_zigzag_size(4, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(v) = self.year { + os.write_sint32(1, v)?; + } + if let Some(v) = self.month { + os.write_sint32(2, v)?; + } + if let Some(v) = self.day { + os.write_sint32(3, v)?; + } + if let Some(v) = self.minute { + os.write_sint32(5, v)?; + } + if let Some(v) = self.hour { + os.write_sint32(4, v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PublishTime { + PublishTime::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( + "year", + |m: &PublishTime| { &m.year }, + |m: &mut PublishTime| { &mut m.year }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( + "month", + |m: &PublishTime| { &m.month }, + |m: &mut PublishTime| { &mut m.month }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( + "day", + |m: &PublishTime| { &m.day }, + |m: &mut PublishTime| { &mut m.day }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( + "minute", + |m: &PublishTime| { &m.minute }, + |m: &mut PublishTime| { &mut m.minute }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( + "hour", + |m: &PublishTime| { &m.hour }, + |m: &mut PublishTime| { &mut m.hour }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "PublishTime", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static PublishTime { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const PublishTime, + }; + unsafe { + instance.get(PublishTime::new) + } + } +} + +impl ::protobuf::Clear for PublishTime { + fn clear(&mut self) { + self.year = ::std::option::Option::None; + self.month = ::std::option::Option::None; + self.day = ::std::option::Option::None; + self.minute = ::std::option::Option::None; + self.hour = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PublishTime { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PublishTime { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Show { + // message fields + gid: ::protobuf::SingularField<::std::vec::Vec>, + name: ::protobuf::SingularField<::std::string::String>, + episode: ::protobuf::RepeatedField, + description: ::protobuf::SingularField<::std::string::String>, + publisher: ::protobuf::SingularField<::std::string::String>, + language: ::protobuf::SingularField<::std::string::String>, + explicit: ::std::option::Option, + covers: ::protobuf::SingularPtrField, + restriction: ::protobuf::RepeatedField, + media_type: ::std::option::Option, + consumption_order: ::std::option::Option, + interpret_restriction_using_geoip: ::std::option::Option, + country_of_origin: ::protobuf::SingularField<::std::string::String>, + categories: ::protobuf::RepeatedField, + passthrough: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Show { + fn default() -> &'a Show { + ::default_instance() + } +} + +impl Show { + pub fn new() -> Show { + ::std::default::Default::default() + } + + // optional bytes gid = 1; + + + pub fn get_gid(&self) -> &[u8] { + match self.gid.as_ref() { + Some(v) => &v, + None => &[], + } + } + pub fn clear_gid(&mut self) { + self.gid.clear(); + } + + pub fn has_gid(&self) -> bool { + self.gid.is_some() + } + + // Param is passed by value, moved + pub fn set_gid(&mut self, v: ::std::vec::Vec) { + self.gid = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_gid(&mut self) -> &mut ::std::vec::Vec { + if self.gid.is_none() { + self.gid.set_default(); + } + self.gid.as_mut().unwrap() + } + + // Take field + pub fn take_gid(&mut self) -> ::std::vec::Vec { + self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string name = 2; + + + pub fn get_name(&self) -> &str { + match self.name.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_name(&mut self) { + self.name.clear(); + } + + pub fn has_name(&self) -> bool { + self.name.is_some() + } + + // Param is passed by value, moved + pub fn set_name(&mut self, v: ::std::string::String) { + self.name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_name(&mut self) -> &mut ::std::string::String { + if self.name.is_none() { + self.name.set_default(); + } + self.name.as_mut().unwrap() + } + + // Take field + pub fn take_name(&mut self) -> ::std::string::String { + self.name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // repeated .Episode episode = 70; + + + pub fn get_episode(&self) -> &[Episode] { + &self.episode + } + pub fn clear_episode(&mut self) { + self.episode.clear(); + } + + // Param is passed by value, moved + pub fn set_episode(&mut self, v: ::protobuf::RepeatedField) { + self.episode = v; + } + + // Mutable pointer to the field. + pub fn mut_episode(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.episode + } + + // Take field + pub fn take_episode(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.episode, ::protobuf::RepeatedField::new()) + } + + // optional string description = 64; + + + pub fn get_description(&self) -> &str { + match self.description.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_description(&mut self) { + self.description.clear(); + } + + pub fn has_description(&self) -> bool { + self.description.is_some() + } + + // Param is passed by value, moved + pub fn set_description(&mut self, v: ::std::string::String) { + self.description = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_description(&mut self) -> &mut ::std::string::String { + if self.description.is_none() { + self.description.set_default(); + } + self.description.as_mut().unwrap() + } + + // Take field + pub fn take_description(&mut self) -> ::std::string::String { + self.description.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string publisher = 66; + + + pub fn get_publisher(&self) -> &str { + match self.publisher.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_publisher(&mut self) { + self.publisher.clear(); + } + + pub fn has_publisher(&self) -> bool { + self.publisher.is_some() + } + + // Param is passed by value, moved + pub fn set_publisher(&mut self, v: ::std::string::String) { + self.publisher = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_publisher(&mut self) -> &mut ::std::string::String { + if self.publisher.is_none() { + self.publisher.set_default(); + } + self.publisher.as_mut().unwrap() + } + + // Take field + pub fn take_publisher(&mut self) -> ::std::string::String { + self.publisher.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional string language = 67; + + + pub fn get_language(&self) -> &str { + match self.language.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_language(&mut self) { + self.language.clear(); + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language.set_default(); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool explicit = 68; + + + pub fn get_explicit(&self) -> bool { + self.explicit.unwrap_or(false) + } + pub fn clear_explicit(&mut self) { + self.explicit = ::std::option::Option::None; + } + + pub fn has_explicit(&self) -> bool { + self.explicit.is_some() + } + + // Param is passed by value, moved + pub fn set_explicit(&mut self, v: bool) { + self.explicit = ::std::option::Option::Some(v); + } + + // optional .ImageGroup covers = 69; + + + pub fn get_covers(&self) -> &ImageGroup { + self.covers.as_ref().unwrap_or_else(|| ImageGroup::default_instance()) + } + pub fn clear_covers(&mut self) { + self.covers.clear(); + } + + pub fn has_covers(&self) -> bool { + self.covers.is_some() + } + + // Param is passed by value, moved + pub fn set_covers(&mut self, v: ImageGroup) { + self.covers = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_covers(&mut self) -> &mut ImageGroup { + if self.covers.is_none() { + self.covers.set_default(); + } + self.covers.as_mut().unwrap() + } + + // Take field + pub fn take_covers(&mut self) -> ImageGroup { + self.covers.take().unwrap_or_else(|| ImageGroup::new()) + } + + // repeated .Restriction restriction = 72; + + + pub fn get_restriction(&self) -> &[Restriction] { + &self.restriction + } + pub fn clear_restriction(&mut self) { + self.restriction.clear(); + } + + // Param is passed by value, moved + pub fn set_restriction(&mut self, v: ::protobuf::RepeatedField) { + self.restriction = v; + } + + // Mutable pointer to the field. + pub fn mut_restriction(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.restriction + } + + // Take field + pub fn take_restriction(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.restriction, ::protobuf::RepeatedField::new()) + } + + // optional .MediaType media_type = 74; + + + pub fn get_media_type(&self) -> MediaType { + self.media_type.unwrap_or(MediaType::MIXED) + } + pub fn clear_media_type(&mut self) { + self.media_type = ::std::option::Option::None; + } + + pub fn has_media_type(&self) -> bool { + self.media_type.is_some() + } + + // Param is passed by value, moved + pub fn set_media_type(&mut self, v: MediaType) { + self.media_type = ::std::option::Option::Some(v); + } + + // optional .ConsumptionOrder consumption_order = 75; + + + pub fn get_consumption_order(&self) -> ConsumptionOrder { + self.consumption_order.unwrap_or(ConsumptionOrder::SEQUENTIAL) + } + pub fn clear_consumption_order(&mut self) { + self.consumption_order = ::std::option::Option::None; + } + + pub fn has_consumption_order(&self) -> bool { + self.consumption_order.is_some() + } + + // Param is passed by value, moved + pub fn set_consumption_order(&mut self, v: ConsumptionOrder) { + self.consumption_order = ::std::option::Option::Some(v); + } + + // optional bool interpret_restriction_using_geoip = 76; + + + pub fn get_interpret_restriction_using_geoip(&self) -> bool { + self.interpret_restriction_using_geoip.unwrap_or(false) + } + pub fn clear_interpret_restriction_using_geoip(&mut self) { + self.interpret_restriction_using_geoip = ::std::option::Option::None; + } + + pub fn has_interpret_restriction_using_geoip(&self) -> bool { + self.interpret_restriction_using_geoip.is_some() + } + + // Param is passed by value, moved + pub fn set_interpret_restriction_using_geoip(&mut self, v: bool) { + self.interpret_restriction_using_geoip = ::std::option::Option::Some(v); + } + + // optional string country_of_origin = 79; + + + pub fn get_country_of_origin(&self) -> &str { + match self.country_of_origin.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_country_of_origin(&mut self) { + self.country_of_origin.clear(); + } + + pub fn has_country_of_origin(&self) -> bool { + self.country_of_origin.is_some() + } + + // Param is passed by value, moved + pub fn set_country_of_origin(&mut self, v: ::std::string::String) { + self.country_of_origin = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_country_of_origin(&mut self) -> &mut ::std::string::String { + if self.country_of_origin.is_none() { + self.country_of_origin.set_default(); + } + self.country_of_origin.as_mut().unwrap() + } + + // Take field + pub fn take_country_of_origin(&mut self) -> ::std::string::String { + self.country_of_origin.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // repeated .Category categories = 80; + + + pub fn get_categories(&self) -> &[Category] { + &self.categories + } + pub fn clear_categories(&mut self) { + self.categories.clear(); + } + + // Param is passed by value, moved + pub fn set_categories(&mut self, v: ::protobuf::RepeatedField) { + self.categories = v; + } + + // Mutable pointer to the field. + pub fn mut_categories(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.categories + } + + // Take field + pub fn take_categories(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.categories, ::protobuf::RepeatedField::new()) + } + + // optional .PassthroughEnum passthrough = 81; + + + pub fn get_passthrough(&self) -> PassthroughEnum { + self.passthrough.unwrap_or(PassthroughEnum::UNKNOWN) + } + pub fn clear_passthrough(&mut self) { + self.passthrough = ::std::option::Option::None; + } + + pub fn has_passthrough(&self) -> bool { + self.passthrough.is_some() + } + + // Param is passed by value, moved + pub fn set_passthrough(&mut self, v: PassthroughEnum) { + self.passthrough = ::std::option::Option::Some(v); + } +} + +impl ::protobuf::Message for Show { + fn is_initialized(&self) -> bool { + for v in &self.episode { + if !v.is_initialized() { + return false; + } + }; + for v in &self.covers { + if !v.is_initialized() { + return false; + } + }; + for v in &self.restriction { + if !v.is_initialized() { + return false; + } + }; + for v in &self.categories { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?; + }, + 70 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.episode)?; + }, + 64 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.description)?; + }, + 66 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.publisher)?; + }, + 67 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)?; + }, + 68 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.explicit = ::std::option::Option::Some(tmp); + }, + 69 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.covers)?; + }, + 72 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)?; + }, + 74 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.media_type, 74, &mut self.unknown_fields)? + }, + 75 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.consumption_order, 75, &mut self.unknown_fields)? + }, + 76 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.interpret_restriction_using_geoip = ::std::option::Option::Some(tmp); + }, + 79 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.country_of_origin)?; + }, + 80 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.categories)?; + }, + 81 => { + ::protobuf::rt::read_proto2_enum_with_unknown_fields_into(wire_type, is, &mut self.passthrough, 81, &mut self.unknown_fields)? + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.gid.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(ref v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + for value in &self.episode { + let len = value.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(ref v) = self.description.as_ref() { + my_size += ::protobuf::rt::string_size(64, &v); + } + if let Some(ref v) = self.publisher.as_ref() { + my_size += ::protobuf::rt::string_size(66, &v); + } + if let Some(ref v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(67, &v); + } + if let Some(v) = self.explicit { + my_size += 3; + } + if let Some(ref v) = self.covers.as_ref() { + let len = v.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + for value in &self.restriction { + let len = value.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(v) = self.media_type { + my_size += ::protobuf::rt::enum_size(74, v); + } + if let Some(v) = self.consumption_order { + my_size += ::protobuf::rt::enum_size(75, v); + } + if let Some(v) = self.interpret_restriction_using_geoip { + my_size += 3; + } + if let Some(ref v) = self.country_of_origin.as_ref() { + my_size += ::protobuf::rt::string_size(79, &v); + } + for value in &self.categories { + let len = value.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(v) = self.passthrough { + my_size += ::protobuf::rt::enum_size(81, v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.gid.as_ref() { + os.write_bytes(1, &v)?; + } + if let Some(ref v) = self.name.as_ref() { + os.write_string(2, &v)?; + } + for v in &self.episode { + os.write_tag(70, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if let Some(ref v) = self.description.as_ref() { + os.write_string(64, &v)?; + } + if let Some(ref v) = self.publisher.as_ref() { + os.write_string(66, &v)?; + } + if let Some(ref v) = self.language.as_ref() { + os.write_string(67, &v)?; + } + if let Some(v) = self.explicit { + os.write_bool(68, v)?; + } + if let Some(ref v) = self.covers.as_ref() { + os.write_tag(69, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + for v in &self.restriction { + os.write_tag(72, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if let Some(v) = self.media_type { + os.write_enum(74, v.value())?; + } + if let Some(v) = self.consumption_order { + os.write_enum(75, v.value())?; + } + if let Some(v) = self.interpret_restriction_using_geoip { + os.write_bool(76, v)?; + } + if let Some(ref v) = self.country_of_origin.as_ref() { + os.write_string(79, &v)?; + } + for v in &self.categories { + os.write_tag(80, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if let Some(v) = self.passthrough { + os.write_enum(81, v.value())?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Show { + Show::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "gid", + |m: &Show| { &m.gid }, + |m: &mut Show| { &mut m.gid }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &Show| { &m.name }, + |m: &mut Show| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "episode", + |m: &Show| { &m.episode }, + |m: &mut Show| { &mut m.episode }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "description", + |m: &Show| { &m.description }, + |m: &mut Show| { &mut m.description }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "publisher", + |m: &Show| { &m.publisher }, + |m: &mut Show| { &mut m.publisher }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "language", + |m: &Show| { &m.language }, + |m: &mut Show| { &mut m.language }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "explicit", + |m: &Show| { &m.explicit }, + |m: &mut Show| { &mut m.explicit }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "covers", + |m: &Show| { &m.covers }, + |m: &mut Show| { &mut m.covers }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "restriction", + |m: &Show| { &m.restriction }, + |m: &mut Show| { &mut m.restriction }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "media_type", + |m: &Show| { &m.media_type }, + |m: &mut Show| { &mut m.media_type }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "consumption_order", + |m: &Show| { &m.consumption_order }, + |m: &mut Show| { &mut m.consumption_order }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "interpret_restriction_using_geoip", + |m: &Show| { &m.interpret_restriction_using_geoip }, + |m: &mut Show| { &mut m.interpret_restriction_using_geoip }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "country_of_origin", + |m: &Show| { &m.country_of_origin }, + |m: &mut Show| { &mut m.country_of_origin }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "categories", + |m: &Show| { &m.categories }, + |m: &mut Show| { &mut m.categories }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "passthrough", + |m: &Show| { &m.passthrough }, + |m: &mut Show| { &mut m.passthrough }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Show", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Show { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Show, + }; + unsafe { + instance.get(Show::new) + } + } +} + +impl ::protobuf::Clear for Show { + fn clear(&mut self) { + self.gid.clear(); + self.name.clear(); + self.episode.clear(); + self.description.clear(); + self.publisher.clear(); + self.language.clear(); + self.explicit = ::std::option::Option::None; + self.covers.clear(); + self.restriction.clear(); + self.media_type = ::std::option::Option::None; + self.consumption_order = ::std::option::Option::None; + self.interpret_restriction_using_geoip = ::std::option::Option::None; + self.country_of_origin.clear(); + self.categories.clear(); + self.passthrough = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Show { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Show { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Episode { + // message fields + gid: ::protobuf::SingularField<::std::vec::Vec>, + name: ::protobuf::SingularField<::std::string::String>, + duration: ::std::option::Option, + popularity: ::std::option::Option, + file: ::protobuf::RepeatedField, + description: ::protobuf::SingularField<::std::string::String>, + publish_time: ::protobuf::SingularPtrField, + covers: ::protobuf::SingularPtrField, + language: ::protobuf::SingularField<::std::string::String>, + explicit: ::std::option::Option, + show: ::protobuf::SingularPtrField, + preview: ::protobuf::RepeatedField, + restriction: ::protobuf::RepeatedField, + suppress_monetization: ::std::option::Option, + allow_background_playback: ::std::option::Option, + interpret_restriction_using_geoip: ::std::option::Option, + external_url: ::protobuf::SingularField<::std::string::String>, + original_audio: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Episode { + fn default() -> &'a Episode { + ::default_instance() + } +} + +impl Episode { + pub fn new() -> Episode { + ::std::default::Default::default() + } + + // optional bytes gid = 1; + + + pub fn get_gid(&self) -> &[u8] { + match self.gid.as_ref() { + Some(v) => &v, + None => &[], + } + } + pub fn clear_gid(&mut self) { + self.gid.clear(); + } + + pub fn has_gid(&self) -> bool { + self.gid.is_some() + } + + // Param is passed by value, moved + pub fn set_gid(&mut self, v: ::std::vec::Vec) { + self.gid = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_gid(&mut self) -> &mut ::std::vec::Vec { + if self.gid.is_none() { + self.gid.set_default(); + } + self.gid.as_mut().unwrap() + } + + // Take field + pub fn take_gid(&mut self) -> ::std::vec::Vec { + self.gid.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } + + // optional string name = 2; + + + pub fn get_name(&self) -> &str { + match self.name.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_name(&mut self) { + self.name.clear(); + } + + pub fn has_name(&self) -> bool { + self.name.is_some() + } + + // Param is passed by value, moved + pub fn set_name(&mut self, v: ::std::string::String) { + self.name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_name(&mut self) -> &mut ::std::string::String { + if self.name.is_none() { + self.name.set_default(); + } + self.name.as_mut().unwrap() + } + + // Take field + pub fn take_name(&mut self) -> ::std::string::String { + self.name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional sint32 duration = 7; + + + pub fn get_duration(&self) -> i32 { + self.duration.unwrap_or(0) + } + pub fn clear_duration(&mut self) { + self.duration = ::std::option::Option::None; + } + + pub fn has_duration(&self) -> bool { + self.duration.is_some() + } + + // Param is passed by value, moved + pub fn set_duration(&mut self, v: i32) { + self.duration = ::std::option::Option::Some(v); + } + + // optional sint32 popularity = 8; + + + pub fn get_popularity(&self) -> i32 { + self.popularity.unwrap_or(0) + } + pub fn clear_popularity(&mut self) { + self.popularity = ::std::option::Option::None; + } + + pub fn has_popularity(&self) -> bool { + self.popularity.is_some() + } + + // Param is passed by value, moved + pub fn set_popularity(&mut self, v: i32) { + self.popularity = ::std::option::Option::Some(v); + } + + // repeated .AudioFile file = 12; + + + pub fn get_file(&self) -> &[AudioFile] { + &self.file + } + pub fn clear_file(&mut self) { + self.file.clear(); + } + + // Param is passed by value, moved + pub fn set_file(&mut self, v: ::protobuf::RepeatedField) { + self.file = v; + } + + // Mutable pointer to the field. + pub fn mut_file(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.file + } + + // Take field + pub fn take_file(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.file, ::protobuf::RepeatedField::new()) + } + + // optional string description = 64; + + + pub fn get_description(&self) -> &str { + match self.description.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_description(&mut self) { + self.description.clear(); + } + + pub fn has_description(&self) -> bool { + self.description.is_some() + } + + // Param is passed by value, moved + pub fn set_description(&mut self, v: ::std::string::String) { + self.description = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_description(&mut self) -> &mut ::std::string::String { + if self.description.is_none() { + self.description.set_default(); + } + self.description.as_mut().unwrap() + } + + // Take field + pub fn take_description(&mut self) -> ::std::string::String { + self.description.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional .Date publish_time = 66; + + + pub fn get_publish_time(&self) -> &Date { + self.publish_time.as_ref().unwrap_or_else(|| Date::default_instance()) + } + pub fn clear_publish_time(&mut self) { + self.publish_time.clear(); + } + + pub fn has_publish_time(&self) -> bool { + self.publish_time.is_some() + } + + // Param is passed by value, moved + pub fn set_publish_time(&mut self, v: Date) { + self.publish_time = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_publish_time(&mut self) -> &mut Date { + if self.publish_time.is_none() { + self.publish_time.set_default(); + } + self.publish_time.as_mut().unwrap() + } + + // Take field + pub fn take_publish_time(&mut self) -> Date { + self.publish_time.take().unwrap_or_else(|| Date::new()) + } + + // optional .ImageGroup covers = 68; + + + pub fn get_covers(&self) -> &ImageGroup { + self.covers.as_ref().unwrap_or_else(|| ImageGroup::default_instance()) + } + pub fn clear_covers(&mut self) { + self.covers.clear(); + } + + pub fn has_covers(&self) -> bool { + self.covers.is_some() + } + + // Param is passed by value, moved + pub fn set_covers(&mut self, v: ImageGroup) { + self.covers = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_covers(&mut self) -> &mut ImageGroup { + if self.covers.is_none() { + self.covers.set_default(); + } + self.covers.as_mut().unwrap() + } + + // Take field + pub fn take_covers(&mut self) -> ImageGroup { + self.covers.take().unwrap_or_else(|| ImageGroup::new()) + } + + // optional string language = 69; + + + pub fn get_language(&self) -> &str { + match self.language.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_language(&mut self) { + self.language.clear(); + } + + pub fn has_language(&self) -> bool { + self.language.is_some() + } + + // Param is passed by value, moved + pub fn set_language(&mut self, v: ::std::string::String) { + self.language = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_language(&mut self) -> &mut ::std::string::String { + if self.language.is_none() { + self.language.set_default(); + } + self.language.as_mut().unwrap() + } + + // Take field + pub fn take_language(&mut self) -> ::std::string::String { + self.language.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional bool explicit = 70; + + + pub fn get_explicit(&self) -> bool { + self.explicit.unwrap_or(false) + } + pub fn clear_explicit(&mut self) { + self.explicit = ::std::option::Option::None; + } + + pub fn has_explicit(&self) -> bool { + self.explicit.is_some() + } + + // Param is passed by value, moved + pub fn set_explicit(&mut self, v: bool) { + self.explicit = ::std::option::Option::Some(v); + } + + // optional .Show show = 71; + + + pub fn get_show(&self) -> &Show { + self.show.as_ref().unwrap_or_else(|| Show::default_instance()) + } + pub fn clear_show(&mut self) { + self.show.clear(); + } + + pub fn has_show(&self) -> bool { + self.show.is_some() + } + + // Param is passed by value, moved + pub fn set_show(&mut self, v: Show) { + self.show = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_show(&mut self) -> &mut Show { + if self.show.is_none() { + self.show.set_default(); + } + self.show.as_mut().unwrap() + } + + // Take field + pub fn take_show(&mut self) -> Show { + self.show.take().unwrap_or_else(|| Show::new()) + } + + // repeated .AudioFile preview = 74; + + + pub fn get_preview(&self) -> &[AudioFile] { + &self.preview + } + pub fn clear_preview(&mut self) { + self.preview.clear(); + } + + // Param is passed by value, moved + pub fn set_preview(&mut self, v: ::protobuf::RepeatedField) { + self.preview = v; + } + + // Mutable pointer to the field. + pub fn mut_preview(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.preview + } + + // Take field + pub fn take_preview(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.preview, ::protobuf::RepeatedField::new()) + } + + // repeated .Restriction restriction = 75; + + + pub fn get_restriction(&self) -> &[Restriction] { + &self.restriction + } + pub fn clear_restriction(&mut self) { + self.restriction.clear(); + } + + // Param is passed by value, moved + pub fn set_restriction(&mut self, v: ::protobuf::RepeatedField) { + self.restriction = v; + } + + // Mutable pointer to the field. + pub fn mut_restriction(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.restriction + } + + // Take field + pub fn take_restriction(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.restriction, ::protobuf::RepeatedField::new()) + } + + // optional bool suppress_monetization = 78; + + + pub fn get_suppress_monetization(&self) -> bool { + self.suppress_monetization.unwrap_or(false) + } + pub fn clear_suppress_monetization(&mut self) { + self.suppress_monetization = ::std::option::Option::None; + } + + pub fn has_suppress_monetization(&self) -> bool { + self.suppress_monetization.is_some() + } + + // Param is passed by value, moved + pub fn set_suppress_monetization(&mut self, v: bool) { + self.suppress_monetization = ::std::option::Option::Some(v); + } + + // optional bool allow_background_playback = 79; + + + pub fn get_allow_background_playback(&self) -> bool { + self.allow_background_playback.unwrap_or(false) + } + pub fn clear_allow_background_playback(&mut self) { + self.allow_background_playback = ::std::option::Option::None; + } + + pub fn has_allow_background_playback(&self) -> bool { + self.allow_background_playback.is_some() + } + + // Param is passed by value, moved + pub fn set_allow_background_playback(&mut self, v: bool) { + self.allow_background_playback = ::std::option::Option::Some(v); + } + + // optional bool interpret_restriction_using_geoip = 81; + + + pub fn get_interpret_restriction_using_geoip(&self) -> bool { + self.interpret_restriction_using_geoip.unwrap_or(false) + } + pub fn clear_interpret_restriction_using_geoip(&mut self) { + self.interpret_restriction_using_geoip = ::std::option::Option::None; + } + + pub fn has_interpret_restriction_using_geoip(&self) -> bool { + self.interpret_restriction_using_geoip.is_some() + } + + // Param is passed by value, moved + pub fn set_interpret_restriction_using_geoip(&mut self, v: bool) { + self.interpret_restriction_using_geoip = ::std::option::Option::Some(v); + } + + // optional string external_url = 83; + + + pub fn get_external_url(&self) -> &str { + match self.external_url.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_external_url(&mut self) { + self.external_url.clear(); + } + + pub fn has_external_url(&self) -> bool { + self.external_url.is_some() + } + + // Param is passed by value, moved + pub fn set_external_url(&mut self, v: ::std::string::String) { + self.external_url = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_external_url(&mut self) -> &mut ::std::string::String { + if self.external_url.is_none() { + self.external_url.set_default(); + } + self.external_url.as_mut().unwrap() + } + + // Take field + pub fn take_external_url(&mut self) -> ::std::string::String { + self.external_url.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // optional .OriginalAudio original_audio = 84; + + + pub fn get_original_audio(&self) -> &OriginalAudio { + self.original_audio.as_ref().unwrap_or_else(|| OriginalAudio::default_instance()) + } + pub fn clear_original_audio(&mut self) { + self.original_audio.clear(); + } + + pub fn has_original_audio(&self) -> bool { + self.original_audio.is_some() + } + + // Param is passed by value, moved + pub fn set_original_audio(&mut self, v: OriginalAudio) { + self.original_audio = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_original_audio(&mut self) -> &mut OriginalAudio { + if self.original_audio.is_none() { + self.original_audio.set_default(); + } + self.original_audio.as_mut().unwrap() + } + + // Take field + pub fn take_original_audio(&mut self) -> OriginalAudio { + self.original_audio.take().unwrap_or_else(|| OriginalAudio::new()) + } +} + +impl ::protobuf::Message for Episode { + fn is_initialized(&self) -> bool { + for v in &self.file { + if !v.is_initialized() { + return false; + } + }; + for v in &self.publish_time { + if !v.is_initialized() { + return false; + } + }; + for v in &self.covers { + if !v.is_initialized() { + return false; + } + }; + for v in &self.show { + if !v.is_initialized() { + return false; + } + }; + for v in &self.preview { + if !v.is_initialized() { + return false; + } + }; + for v in &self.restriction { + if !v.is_initialized() { + return false; + } + }; + for v in &self.original_audio { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.gid)?; + }, + 2 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?; + }, + 7 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_sint32()?; + self.duration = ::std::option::Option::Some(tmp); + }, + 8 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_sint32()?; + self.popularity = ::std::option::Option::Some(tmp); + }, + 12 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.file)?; + }, + 64 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.description)?; + }, + 66 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.publish_time)?; + }, + 68 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.covers)?; + }, + 69 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.language)?; + }, + 70 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.explicit = ::std::option::Option::Some(tmp); + }, + 71 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.show)?; + }, + 74 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.preview)?; + }, + 75 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.restriction)?; + }, + 78 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.suppress_monetization = ::std::option::Option::Some(tmp); + }, + 79 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.allow_background_playback = ::std::option::Option::Some(tmp); + }, + 81 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.interpret_restriction_using_geoip = ::std::option::Option::Some(tmp); + }, + 83 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.external_url)?; + }, + 84 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.original_audio)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.gid.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + if let Some(ref v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(2, &v); + } + if let Some(v) = self.duration { + my_size += ::protobuf::rt::value_varint_zigzag_size(7, v); + } + if let Some(v) = self.popularity { + my_size += ::protobuf::rt::value_varint_zigzag_size(8, v); + } + for value in &self.file { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(ref v) = self.description.as_ref() { + my_size += ::protobuf::rt::string_size(64, &v); + } + if let Some(ref v) = self.publish_time.as_ref() { + let len = v.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.covers.as_ref() { + let len = v.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.language.as_ref() { + my_size += ::protobuf::rt::string_size(69, &v); + } + if let Some(v) = self.explicit { + my_size += 3; + } + if let Some(ref v) = self.show.as_ref() { + let len = v.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + for value in &self.preview { + let len = value.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.restriction { + let len = value.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(v) = self.suppress_monetization { + my_size += 3; + } + if let Some(v) = self.allow_background_playback { + my_size += 3; + } + if let Some(v) = self.interpret_restriction_using_geoip { + my_size += 3; + } + if let Some(ref v) = self.external_url.as_ref() { + my_size += ::protobuf::rt::string_size(83, &v); + } + if let Some(ref v) = self.original_audio.as_ref() { + let len = v.compute_size(); + my_size += 2 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.gid.as_ref() { + os.write_bytes(1, &v)?; + } + if let Some(ref v) = self.name.as_ref() { + os.write_string(2, &v)?; + } + if let Some(v) = self.duration { + os.write_sint32(7, v)?; + } + if let Some(v) = self.popularity { + os.write_sint32(8, v)?; + } + for v in &self.file { + os.write_tag(12, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if let Some(ref v) = self.description.as_ref() { + os.write_string(64, &v)?; + } + if let Some(ref v) = self.publish_time.as_ref() { + os.write_tag(66, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.covers.as_ref() { + os.write_tag(68, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.language.as_ref() { + os.write_string(69, &v)?; + } + if let Some(v) = self.explicit { + os.write_bool(70, v)?; + } + if let Some(ref v) = self.show.as_ref() { + os.write_tag(71, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + for v in &self.preview { + os.write_tag(74, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.restriction { + os.write_tag(75, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if let Some(v) = self.suppress_monetization { + os.write_bool(78, v)?; + } + if let Some(v) = self.allow_background_playback { + os.write_bool(79, v)?; + } + if let Some(v) = self.interpret_restriction_using_geoip { + os.write_bool(81, v)?; + } + if let Some(ref v) = self.external_url.as_ref() { + os.write_string(83, &v)?; + } + if let Some(ref v) = self.original_audio.as_ref() { + os.write_tag(84, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Episode { + Episode::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "gid", + |m: &Episode| { &m.gid }, + |m: &mut Episode| { &mut m.gid }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &Episode| { &m.name }, + |m: &mut Episode| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( + "duration", + |m: &Episode| { &m.duration }, + |m: &mut Episode| { &mut m.duration }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeSint32>( + "popularity", + |m: &Episode| { &m.popularity }, + |m: &mut Episode| { &mut m.popularity }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "file", + |m: &Episode| { &m.file }, + |m: &mut Episode| { &mut m.file }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "description", + |m: &Episode| { &m.description }, + |m: &mut Episode| { &mut m.description }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "publish_time", + |m: &Episode| { &m.publish_time }, + |m: &mut Episode| { &mut m.publish_time }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "covers", + |m: &Episode| { &m.covers }, + |m: &mut Episode| { &mut m.covers }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "language", + |m: &Episode| { &m.language }, + |m: &mut Episode| { &mut m.language }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "explicit", + |m: &Episode| { &m.explicit }, + |m: &mut Episode| { &mut m.explicit }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "show", + |m: &Episode| { &m.show }, + |m: &mut Episode| { &mut m.show }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "preview", + |m: &Episode| { &m.preview }, + |m: &mut Episode| { &mut m.preview }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "restriction", + |m: &Episode| { &m.restriction }, + |m: &mut Episode| { &mut m.restriction }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "suppress_monetization", + |m: &Episode| { &m.suppress_monetization }, + |m: &mut Episode| { &mut m.suppress_monetization }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "allow_background_playback", + |m: &Episode| { &m.allow_background_playback }, + |m: &mut Episode| { &mut m.allow_background_playback }, + )); + fields.push(::protobuf::reflect::accessor::make_option_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "interpret_restriction_using_geoip", + |m: &Episode| { &m.interpret_restriction_using_geoip }, + |m: &mut Episode| { &mut m.interpret_restriction_using_geoip }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "external_url", + |m: &Episode| { &m.external_url }, + |m: &mut Episode| { &mut m.external_url }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "original_audio", + |m: &Episode| { &m.original_audio }, + |m: &mut Episode| { &mut m.original_audio }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Episode", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Episode { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Episode, + }; + unsafe { + instance.get(Episode::new) + } + } +} + +impl ::protobuf::Clear for Episode { + fn clear(&mut self) { + self.gid.clear(); + self.name.clear(); + self.duration = ::std::option::Option::None; + self.popularity = ::std::option::Option::None; + self.file.clear(); + self.description.clear(); + self.publish_time.clear(); + self.covers.clear(); + self.language.clear(); + self.explicit = ::std::option::Option::None; + self.show.clear(); + self.preview.clear(); + self.restriction.clear(); + self.suppress_monetization = ::std::option::Option::None; + self.allow_background_playback = ::std::option::Option::None; + self.interpret_restriction_using_geoip = ::std::option::Option::None; + self.external_url.clear(); + self.original_audio.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Episode { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Episode { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Category { + // message fields + name: ::protobuf::SingularField<::std::string::String>, + subcategories: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Category { + fn default() -> &'a Category { + ::default_instance() + } +} + +impl Category { + pub fn new() -> Category { + ::std::default::Default::default() + } + + // optional string name = 1; + + + pub fn get_name(&self) -> &str { + match self.name.as_ref() { + Some(v) => &v, + None => "", + } + } + pub fn clear_name(&mut self) { + self.name.clear(); + } + + pub fn has_name(&self) -> bool { + self.name.is_some() + } + + // Param is passed by value, moved + pub fn set_name(&mut self, v: ::std::string::String) { + self.name = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_name(&mut self) -> &mut ::std::string::String { + if self.name.is_none() { + self.name.set_default(); + } + self.name.as_mut().unwrap() + } + + // Take field + pub fn take_name(&mut self) -> ::std::string::String { + self.name.take().unwrap_or_else(|| ::std::string::String::new()) + } + + // repeated .Category subcategories = 2; + + + pub fn get_subcategories(&self) -> &[Category] { + &self.subcategories + } + pub fn clear_subcategories(&mut self) { + self.subcategories.clear(); + } + + // Param is passed by value, moved + pub fn set_subcategories(&mut self, v: ::protobuf::RepeatedField) { + self.subcategories = v; + } + + // Mutable pointer to the field. + pub fn mut_subcategories(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.subcategories + } + + // Take field + pub fn take_subcategories(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.subcategories, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for Category { + fn is_initialized(&self) -> bool { + for v in &self.subcategories { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_string_into(wire_type, is, &mut self.name)?; + }, + 2 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.subcategories)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.name.as_ref() { + my_size += ::protobuf::rt::string_size(1, &v); + } + for value in &self.subcategories { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.name.as_ref() { + os.write_string(1, &v)?; + } + for v in &self.subcategories { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Category { + Category::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "name", + |m: &Category| { &m.name }, + |m: &mut Category| { &mut m.name }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "subcategories", + |m: &Category| { &m.subcategories }, + |m: &mut Category| { &mut m.subcategories }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "Category", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static Category { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const Category, + }; + unsafe { + instance.get(Category::new) + } + } +} + +impl ::protobuf::Clear for Category { + fn clear(&mut self) { + self.name.clear(); + self.subcategories.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Category { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Category { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct OriginalAudio { + // message fields + uuid: ::protobuf::SingularField<::std::vec::Vec>, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a OriginalAudio { + fn default() -> &'a OriginalAudio { + ::default_instance() + } +} + +impl OriginalAudio { + pub fn new() -> OriginalAudio { + ::std::default::Default::default() + } + + // optional bytes uuid = 1; + + + pub fn get_uuid(&self) -> &[u8] { + match self.uuid.as_ref() { + Some(v) => &v, + None => &[], + } + } + pub fn clear_uuid(&mut self) { + self.uuid.clear(); + } + + pub fn has_uuid(&self) -> bool { + self.uuid.is_some() + } + + // Param is passed by value, moved + pub fn set_uuid(&mut self, v: ::std::vec::Vec) { + self.uuid = ::protobuf::SingularField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_uuid(&mut self) -> &mut ::std::vec::Vec { + if self.uuid.is_none() { + self.uuid.set_default(); + } + self.uuid.as_mut().unwrap() + } + + // Take field + pub fn take_uuid(&mut self) -> ::std::vec::Vec { + self.uuid.take().unwrap_or_else(|| ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for OriginalAudio { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_bytes_into(wire_type, is, &mut self.uuid)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.uuid.as_ref() { + my_size += ::protobuf::rt::bytes_size(1, &v); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.uuid.as_ref() { + os.write_bytes(1, &v)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> OriginalAudio { + OriginalAudio::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::MessageDescriptor, + }; + unsafe { + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "uuid", + |m: &OriginalAudio| { &m.uuid }, + |m: &mut OriginalAudio| { &mut m.uuid }, + )); + ::protobuf::reflect::MessageDescriptor::new::( + "OriginalAudio", + fields, + file_descriptor_proto() + ) + }) + } + } + + fn default_instance() -> &'static OriginalAudio { + static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const OriginalAudio, + }; + unsafe { + instance.get(OriginalAudio::new) + } + } +} + +impl ::protobuf::Clear for OriginalAudio { + fn clear(&mut self) { + self.uuid.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for OriginalAudio { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for OriginalAudio { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum ConsumptionOrder { + SEQUENTIAL = 1, + EPISODIC = 2, + RECENT = 3, +} + +impl ::protobuf::ProtobufEnum for ConsumptionOrder { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 1 => ::std::option::Option::Some(ConsumptionOrder::SEQUENTIAL), + 2 => ::std::option::Option::Some(ConsumptionOrder::EPISODIC), + 3 => ::std::option::Option::Some(ConsumptionOrder::RECENT), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [ConsumptionOrder] = &[ + ConsumptionOrder::SEQUENTIAL, + ConsumptionOrder::EPISODIC, + ConsumptionOrder::RECENT, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("ConsumptionOrder", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for ConsumptionOrder { +} + +// Note, `Default` is implemented although default value is not 0 +impl ::std::default::Default for ConsumptionOrder { + fn default() -> Self { + ConsumptionOrder::SEQUENTIAL + } +} + +impl ::protobuf::reflect::ProtobufValue for ConsumptionOrder { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum MediaType { + MIXED = 0, + AUDIO = 1, + VIDEO = 2, +} + +impl ::protobuf::ProtobufEnum for MediaType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(MediaType::MIXED), + 1 => ::std::option::Option::Some(MediaType::AUDIO), + 2 => ::std::option::Option::Some(MediaType::VIDEO), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [MediaType] = &[ + MediaType::MIXED, + MediaType::AUDIO, + MediaType::VIDEO, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("MediaType", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for MediaType { +} + +impl ::std::default::Default for MediaType { + fn default() -> Self { + MediaType::MIXED + } +} + +impl ::protobuf::reflect::ProtobufValue for MediaType { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum PassthroughEnum { + UNKNOWN = 0, + NONE = 1, +} + +impl ::protobuf::ProtobufEnum for PassthroughEnum { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(PassthroughEnum::UNKNOWN), + 1 => ::std::option::Option::Some(PassthroughEnum::NONE), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [PassthroughEnum] = &[ + PassthroughEnum::UNKNOWN, + PassthroughEnum::NONE, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy { + lock: ::protobuf::lazy::ONCE_INIT, + ptr: 0 as *const ::protobuf::reflect::EnumDescriptor, + }; + unsafe { + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new("PassthroughEnum", file_descriptor_proto()) + }) + } + } +} + +impl ::std::marker::Copy for PassthroughEnum { +} + +impl ::std::default::Default for PassthroughEnum { + fn default() -> Self { + PassthroughEnum::UNKNOWN + } +} + +impl ::protobuf::reflect::ProtobufValue for PassthroughEnum { + fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { + ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) + } +} + static file_descriptor_proto_data: &'static [u8] = b"\ \n\x0emetadata.proto\x12\0\"9\n\tTopTracks\x12\x11\n\x07country\x18\x01\ \x20\x01(\tB\0\x12\x17\n\x05track\x18\x02\x20\x03(\x0b2\x06.TrackB\0:\0\ @@ -6293,15 +9016,50 @@ static file_descriptor_proto_data: &'static [u8] = b"\ \x18\x01\x20\x03(\x0b2\x0c.RestrictionB\0\x12\x16\n\x05start\x18\x02\x20\ \x01(\x0b2\x05.DateB\0\x12\x14\n\x03end\x18\x03\x20\x01(\x0b2\x05.DateB\ \0:\0\"+\n\nExternalId\x12\r\n\x03typ\x18\x01\x20\x01(\tB\0\x12\x0c\n\ - \x02id\x18\x02\x20\x01(\tB\0:\0\"\x9b\x02\n\tAudioFile\x12\x11\n\x07file\ + \x02id\x18\x02\x20\x01(\tB\0:\0\"\xa2\x02\n\tAudioFile\x12\x11\n\x07file\ _id\x18\x01\x20\x01(\x0cB\0\x12#\n\x06format\x18\x02\x20\x01(\x0e2\x11.A\ - udioFile.FormatB\0\"\xd3\x01\n\x06Format\x12\x11\n\rOGG_VORBIS_96\x10\0\ + udioFile.FormatB\0\"\xda\x01\n\x06Format\x12\x11\n\rOGG_VORBIS_96\x10\0\ \x12\x12\n\x0eOGG_VORBIS_160\x10\x01\x12\x12\n\x0eOGG_VORBIS_320\x10\x02\ \x12\x0b\n\x07MP3_256\x10\x03\x12\x0b\n\x07MP3_320\x10\x04\x12\x0b\n\x07\ MP3_160\x10\x05\x12\n\n\x06MP3_96\x10\x06\x12\x0f\n\x0bMP3_160_ENC\x10\ - \x07\x12\n\n\x06OTHER2\x10\x08\x12\n\n\x06OTHER3\x10\t\x12\x0b\n\x07AAC_\ - 160\x10\n\x12\x0b\n\x07AAC_320\x10\x0b\x12\n\n\x06OTHER4\x10\x0c\x12\n\n\ - \x06OTHER5\x10\r\x1a\0:\0B\0b\x06proto2\ + \x07\x12\x10\n\x0cMP4_128_DUAL\x10\x08\x12\n\n\x06OTHER3\x10\t\x12\x0b\n\ + \x07AAC_160\x10\n\x12\x0b\n\x07AAC_320\x10\x0b\x12\x0b\n\x07MP4_128\x10\ + \x0c\x12\n\n\x06OTHER5\x10\r\x1a\0:\0\"a\n\x0bPublishTime\x12\x0e\n\x04y\ + ear\x18\x01\x20\x01(\x11B\0\x12\x0f\n\x05month\x18\x02\x20\x01(\x11B\0\ + \x12\r\n\x03day\x18\x03\x20\x01(\x11B\0\x12\x10\n\x06minute\x18\x05\x20\ + \x01(\x11B\0\x12\x0e\n\x04hour\x18\x04\x20\x01(\x11B\0:\0\"\xc2\x03\n\ + \x04Show\x12\r\n\x03gid\x18\x01\x20\x01(\x0cB\0\x12\x0e\n\x04name\x18\ + \x02\x20\x01(\tB\0\x12\x1b\n\x07episode\x18F\x20\x03(\x0b2\x08.EpisodeB\ + \0\x12\x15\n\x0bdescription\x18@\x20\x01(\tB\0\x12\x13\n\tpublisher\x18B\ + \x20\x01(\tB\0\x12\x12\n\x08language\x18C\x20\x01(\tB\0\x12\x12\n\x08exp\ + licit\x18D\x20\x01(\x08B\0\x12\x1d\n\x06covers\x18E\x20\x01(\x0b2\x0b.Im\ + ageGroupB\0\x12#\n\x0brestriction\x18H\x20\x03(\x0b2\x0c.RestrictionB\0\ + \x12\x20\n\nmedia_type\x18J\x20\x01(\x0e2\n.MediaTypeB\0\x12.\n\x11consu\ + mption_order\x18K\x20\x01(\x0e2\x11.ConsumptionOrderB\0\x12+\n!interpret\ + _restriction_using_geoip\x18L\x20\x01(\x08B\0\x12\x1b\n\x11country_of_or\ + igin\x18O\x20\x01(\tB\0\x12\x1f\n\ncategories\x18P\x20\x03(\x0b2\t.Categ\ + oryB\0\x12'\n\x0bpassthrough\x18Q\x20\x01(\x0e2\x10.PassthroughEnumB\0:\ + \0\"\xfd\x03\n\x07Episode\x12\r\n\x03gid\x18\x01\x20\x01(\x0cB\0\x12\x0e\ + \n\x04name\x18\x02\x20\x01(\tB\0\x12\x12\n\x08duration\x18\x07\x20\x01(\ + \x11B\0\x12\x14\n\npopularity\x18\x08\x20\x01(\x11B\0\x12\x1a\n\x04file\ + \x18\x0c\x20\x03(\x0b2\n.AudioFileB\0\x12\x15\n\x0bdescription\x18@\x20\ + \x01(\tB\0\x12\x1d\n\x0cpublish_time\x18B\x20\x01(\x0b2\x05.DateB\0\x12\ + \x1d\n\x06covers\x18D\x20\x01(\x0b2\x0b.ImageGroupB\0\x12\x12\n\x08langu\ + age\x18E\x20\x01(\tB\0\x12\x12\n\x08explicit\x18F\x20\x01(\x08B\0\x12\ + \x15\n\x04show\x18G\x20\x01(\x0b2\x05.ShowB\0\x12\x1d\n\x07preview\x18J\ + \x20\x03(\x0b2\n.AudioFileB\0\x12#\n\x0brestriction\x18K\x20\x03(\x0b2\ + \x0c.RestrictionB\0\x12\x1f\n\x15suppress_monetization\x18N\x20\x01(\x08\ + B\0\x12#\n\x19allow_background_playback\x18O\x20\x01(\x08B\0\x12+\n!inte\ + rpret_restriction_using_geoip\x18Q\x20\x01(\x08B\0\x12\x16\n\x0cexternal\ + _url\x18S\x20\x01(\tB\0\x12(\n\x0eoriginal_audio\x18T\x20\x01(\x0b2\x0e.\ + OriginalAudioB\0:\0\"@\n\x08Category\x12\x0e\n\x04name\x18\x01\x20\x01(\ + \tB\0\x12\"\n\rsubcategories\x18\x02\x20\x03(\x0b2\t.CategoryB\0:\0\"!\n\ + \rOriginalAudio\x12\x0e\n\x04uuid\x18\x01\x20\x01(\x0cB\0:\0*>\n\x10Cons\ + umptionOrder\x12\x0e\n\nSEQUENTIAL\x10\x01\x12\x0c\n\x08EPISODIC\x10\x02\ + \x12\n\n\x06RECENT\x10\x03\x1a\0*.\n\tMediaType\x12\t\n\x05MIXED\x10\0\ + \x12\t\n\x05AUDIO\x10\x01\x12\t\n\x05VIDEO\x10\x02\x1a\0**\n\x0fPassthro\ + ughEnum\x12\x0b\n\x07UNKNOWN\x10\0\x12\x08\n\x04NONE\x10\x01\x1a\0B\0b\ + \x06proto2\ "; static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy {