WIP, Remote Client/Server, fist working track list
This commit is contained in:
+194
-227
@@ -336,15 +336,15 @@ void protobuf_AssignDesc_collection_2eproto() {
|
||||
AudioCollectionResponse_Track_descriptor_ = AudioCollectionResponse_descriptor_->nested_type(8);
|
||||
static const int AudioCollectionResponse_Track_offsets_[11] = {
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, id_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, artist_id_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, release_id_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, genre_id_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, disc_number_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, track_number_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, artist_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, release_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, name_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, duration_secs_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, release_date_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, original_release_date_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, genres_),
|
||||
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionResponse_Track, coverart_),
|
||||
};
|
||||
AudioCollectionResponse_Track_reflection_ =
|
||||
@@ -476,7 +476,7 @@ void protobuf_AddDesc_collection_2eproto() {
|
||||
"nRequest.BatchParameter\"a\n\004Type\022\024\n\020TypeG"
|
||||
"etGenreList\020\001\022\025\n\021TypeGetArtistList\020\002\022\026\n\022"
|
||||
"TypeGetReleaseList\020\003\022\024\n\020TypeGetTrackList"
|
||||
"\020\004\"\365\t\n\027AudioCollectionResponse\0222\n\004type\030\001"
|
||||
"\020\004\"\375\t\n\027AudioCollectionResponse\0222\n\004type\030\001"
|
||||
" \001(\0162$.Remote.AudioCollectionResponse.Ty"
|
||||
"pe\022\034\n\005error\030\002 \001(\0132\r.Remote.Error\022=\n\ngenr"
|
||||
"e_list\030\003 \001(\0132).Remote.AudioCollectionRes"
|
||||
@@ -499,15 +499,16 @@ void protobuf_AddDesc_collection_2eproto() {
|
||||
"\022\n\n\002id\030\001 \002(\004\022\014\n\004name\030\002 \002(\t\022\021\n\tnb_tracks\030"
|
||||
"\003 \002(\r\022\025\n\rduration_secs\030\004 \002(\r\022\024\n\014release_"
|
||||
"date\030\005 \001(\t\022:\n\010coverArt\030\006 \001(\0132(.Remote.Au"
|
||||
"dioCollectionResponse.CoverArt\032\333\001\n\005Track"
|
||||
"\022\n\n\002id\030\001 \002(\004\022\023\n\013disc_number\030\002 \001(\r\022\024\n\014tra"
|
||||
"ck_number\030\003 \001(\r\022\016\n\006artist\030\004 \001(\t\022\017\n\007relea"
|
||||
"se\030\005 \001(\t\022\014\n\004name\030\006 \002(\t\022\025\n\rduration_secs\030"
|
||||
"\007 \002(\r\022\024\n\014release_date\030\010 \001(\t\022\035\n\025original_"
|
||||
"release_date\030\t \001(\t\022\016\n\006genres\030\n \003(\t\022\020\n\010co"
|
||||
"verArt\030\013 \001(\014\"d\n\004Type\022\r\n\tTypeError\020\001\022\021\n\rT"
|
||||
"ypeGenreList\020\002\022\022\n\016TypeArtistList\020\003\022\023\n\017Ty"
|
||||
"peReleaseList\020\004\022\021\n\rTypeTrackList\020\005", 2314);
|
||||
"dioCollectionResponse.CoverArt\032\343\001\n\005Track"
|
||||
"\022\n\n\002id\030\001 \002(\004\022\021\n\tartist_id\030\002 \002(\004\022\022\n\nrelea"
|
||||
"se_id\030\003 \002(\004\022\020\n\010genre_id\030\004 \003(\004\022\023\n\013disc_nu"
|
||||
"mber\030\005 \001(\r\022\024\n\014track_number\030\006 \001(\r\022\014\n\004name"
|
||||
"\030\007 \002(\t\022\025\n\rduration_secs\030\010 \002(\r\022\024\n\014release"
|
||||
"_date\030\t \001(\t\022\035\n\025original_release_date\030\n \001"
|
||||
"(\t\022\020\n\010coverArt\030\013 \001(\014\"d\n\004Type\022\r\n\tTypeErro"
|
||||
"r\020\001\022\021\n\rTypeGenreList\020\002\022\022\n\016TypeArtistList"
|
||||
"\020\003\022\023\n\017TypeReleaseList\020\004\022\021\n\rTypeTrackList"
|
||||
"\020\005", 2322);
|
||||
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
|
||||
"collection.proto", &protobuf_RegisterTypes);
|
||||
AudioCollectionRequest::default_instance_ = new AudioCollectionRequest();
|
||||
@@ -4606,15 +4607,15 @@ void AudioCollectionResponse_Release::Swap(AudioCollectionResponse_Release* othe
|
||||
|
||||
#ifndef _MSC_VER
|
||||
const int AudioCollectionResponse_Track::kIdFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kArtistIdFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kReleaseIdFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kGenreIdFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kDiscNumberFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kTrackNumberFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kArtistFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kReleaseFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kNameFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kDurationSecsFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kReleaseDateFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kOriginalReleaseDateFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kGenresFieldNumber;
|
||||
const int AudioCollectionResponse_Track::kCoverArtFieldNumber;
|
||||
#endif // !_MSC_VER
|
||||
|
||||
@@ -4635,10 +4636,10 @@ AudioCollectionResponse_Track::AudioCollectionResponse_Track(const AudioCollecti
|
||||
void AudioCollectionResponse_Track::SharedCtor() {
|
||||
_cached_size_ = 0;
|
||||
id_ = GOOGLE_ULONGLONG(0);
|
||||
artist_id_ = GOOGLE_ULONGLONG(0);
|
||||
release_id_ = GOOGLE_ULONGLONG(0);
|
||||
disc_number_ = 0u;
|
||||
track_number_ = 0u;
|
||||
artist_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
|
||||
release_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
|
||||
name_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
|
||||
duration_secs_ = 0u;
|
||||
release_date_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
|
||||
@@ -4652,12 +4653,6 @@ AudioCollectionResponse_Track::~AudioCollectionResponse_Track() {
|
||||
}
|
||||
|
||||
void AudioCollectionResponse_Track::SharedDtor() {
|
||||
if (artist_ != &::google::protobuf::internal::kEmptyString) {
|
||||
delete artist_;
|
||||
}
|
||||
if (release_ != &::google::protobuf::internal::kEmptyString) {
|
||||
delete release_;
|
||||
}
|
||||
if (name_ != &::google::protobuf::internal::kEmptyString) {
|
||||
delete name_;
|
||||
}
|
||||
@@ -4698,31 +4693,23 @@ AudioCollectionResponse_Track* AudioCollectionResponse_Track::New() const {
|
||||
void AudioCollectionResponse_Track::Clear() {
|
||||
if (_has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
id_ = GOOGLE_ULONGLONG(0);
|
||||
artist_id_ = GOOGLE_ULONGLONG(0);
|
||||
release_id_ = GOOGLE_ULONGLONG(0);
|
||||
disc_number_ = 0u;
|
||||
track_number_ = 0u;
|
||||
if (has_artist()) {
|
||||
if (artist_ != &::google::protobuf::internal::kEmptyString) {
|
||||
artist_->clear();
|
||||
}
|
||||
}
|
||||
if (has_release()) {
|
||||
if (release_ != &::google::protobuf::internal::kEmptyString) {
|
||||
release_->clear();
|
||||
}
|
||||
}
|
||||
if (has_name()) {
|
||||
if (name_ != &::google::protobuf::internal::kEmptyString) {
|
||||
name_->clear();
|
||||
}
|
||||
}
|
||||
duration_secs_ = 0u;
|
||||
}
|
||||
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
|
||||
if (has_release_date()) {
|
||||
if (release_date_ != &::google::protobuf::internal::kEmptyString) {
|
||||
release_date_->clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
|
||||
if (has_original_release_date()) {
|
||||
if (original_release_date_ != &::google::protobuf::internal::kEmptyString) {
|
||||
original_release_date_->clear();
|
||||
@@ -4734,7 +4721,7 @@ void AudioCollectionResponse_Track::Clear() {
|
||||
}
|
||||
}
|
||||
}
|
||||
genres_.Clear();
|
||||
genre_id_.Clear();
|
||||
::memset(_has_bits_, 0, sizeof(_has_bits_));
|
||||
mutable_unknown_fields()->Clear();
|
||||
}
|
||||
@@ -4756,12 +4743,66 @@ bool AudioCollectionResponse_Track::MergePartialFromCodedStream(
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(16)) goto parse_disc_number;
|
||||
if (input->ExpectTag(16)) goto parse_artist_id;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 2;
|
||||
// required uint64 artist_id = 2;
|
||||
case 2: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
parse_artist_id:
|
||||
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
||||
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
|
||||
input, &artist_id_)));
|
||||
set_has_artist_id();
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(24)) goto parse_release_id;
|
||||
break;
|
||||
}
|
||||
|
||||
// required uint64 release_id = 3;
|
||||
case 3: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
parse_release_id:
|
||||
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
|
||||
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
|
||||
input, &release_id_)));
|
||||
set_has_release_id();
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(32)) goto parse_genre_id;
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated uint64 genre_id = 4;
|
||||
case 4: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
parse_genre_id:
|
||||
DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
|
||||
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
|
||||
1, 32, input, this->mutable_genre_id())));
|
||||
} else if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag)
|
||||
== ::google::protobuf::internal::WireFormatLite::
|
||||
WIRETYPE_LENGTH_DELIMITED) {
|
||||
DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
|
||||
::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
|
||||
input, this->mutable_genre_id())));
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(32)) goto parse_genre_id;
|
||||
if (input->ExpectTag(40)) goto parse_disc_number;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 5;
|
||||
case 5: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
parse_disc_number:
|
||||
@@ -4772,12 +4813,12 @@ bool AudioCollectionResponse_Track::MergePartialFromCodedStream(
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(24)) goto parse_track_number;
|
||||
if (input->ExpectTag(48)) goto parse_track_number;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional uint32 track_number = 3;
|
||||
case 3: {
|
||||
// optional uint32 track_number = 6;
|
||||
case 6: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
parse_track_number:
|
||||
@@ -4788,46 +4829,12 @@ bool AudioCollectionResponse_Track::MergePartialFromCodedStream(
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(34)) goto parse_artist;
|
||||
if (input->ExpectTag(58)) goto parse_name;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional string artist = 4;
|
||||
case 4: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_artist:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
|
||||
input, this->mutable_artist()));
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->artist().data(), this->artist().length(),
|
||||
::google::protobuf::internal::WireFormat::PARSE);
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(42)) goto parse_release;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional string release = 5;
|
||||
case 5: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_release:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
|
||||
input, this->mutable_release()));
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->release().data(), this->release().length(),
|
||||
::google::protobuf::internal::WireFormat::PARSE);
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(50)) goto parse_name;
|
||||
break;
|
||||
}
|
||||
|
||||
// required string name = 6;
|
||||
case 6: {
|
||||
// required string name = 7;
|
||||
case 7: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_name:
|
||||
@@ -4839,12 +4846,12 @@ bool AudioCollectionResponse_Track::MergePartialFromCodedStream(
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(56)) goto parse_duration_secs;
|
||||
if (input->ExpectTag(64)) goto parse_duration_secs;
|
||||
break;
|
||||
}
|
||||
|
||||
// required uint32 duration_secs = 7;
|
||||
case 7: {
|
||||
// required uint32 duration_secs = 8;
|
||||
case 8: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
|
||||
parse_duration_secs:
|
||||
@@ -4855,12 +4862,12 @@ bool AudioCollectionResponse_Track::MergePartialFromCodedStream(
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(66)) goto parse_release_date;
|
||||
if (input->ExpectTag(74)) goto parse_release_date;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional string release_date = 8;
|
||||
case 8: {
|
||||
// optional string release_date = 9;
|
||||
case 9: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_release_date:
|
||||
@@ -4872,12 +4879,12 @@ bool AudioCollectionResponse_Track::MergePartialFromCodedStream(
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(74)) goto parse_original_release_date;
|
||||
if (input->ExpectTag(82)) goto parse_original_release_date;
|
||||
break;
|
||||
}
|
||||
|
||||
// optional string original_release_date = 9;
|
||||
case 9: {
|
||||
// optional string original_release_date = 10;
|
||||
case 10: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_original_release_date:
|
||||
@@ -4889,25 +4896,6 @@ bool AudioCollectionResponse_Track::MergePartialFromCodedStream(
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(82)) goto parse_genres;
|
||||
break;
|
||||
}
|
||||
|
||||
// repeated string genres = 10;
|
||||
case 10: {
|
||||
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
|
||||
::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) {
|
||||
parse_genres:
|
||||
DO_(::google::protobuf::internal::WireFormatLite::ReadString(
|
||||
input, this->add_genres()));
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->genres(this->genres_size() - 1).data(),
|
||||
this->genres(this->genres_size() - 1).length(),
|
||||
::google::protobuf::internal::WireFormat::PARSE);
|
||||
} else {
|
||||
goto handle_uninterpreted;
|
||||
}
|
||||
if (input->ExpectTag(82)) goto parse_genres;
|
||||
if (input->ExpectTag(90)) goto parse_coverArt;
|
||||
break;
|
||||
}
|
||||
@@ -4949,73 +4937,62 @@ void AudioCollectionResponse_Track::SerializeWithCachedSizes(
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt64(1, this->id(), output);
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 2;
|
||||
// required uint64 artist_id = 2;
|
||||
if (has_artist_id()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt64(2, this->artist_id(), output);
|
||||
}
|
||||
|
||||
// required uint64 release_id = 3;
|
||||
if (has_release_id()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->release_id(), output);
|
||||
}
|
||||
|
||||
// repeated uint64 genre_id = 4;
|
||||
for (int i = 0; i < this->genre_id_size(); i++) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt64(
|
||||
4, this->genre_id(i), output);
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 5;
|
||||
if (has_disc_number()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->disc_number(), output);
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->disc_number(), output);
|
||||
}
|
||||
|
||||
// optional uint32 track_number = 3;
|
||||
// optional uint32 track_number = 6;
|
||||
if (has_track_number()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->track_number(), output);
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->track_number(), output);
|
||||
}
|
||||
|
||||
// optional string artist = 4;
|
||||
if (has_artist()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->artist().data(), this->artist().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
::google::protobuf::internal::WireFormatLite::WriteString(
|
||||
4, this->artist(), output);
|
||||
}
|
||||
|
||||
// optional string release = 5;
|
||||
if (has_release()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->release().data(), this->release().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
::google::protobuf::internal::WireFormatLite::WriteString(
|
||||
5, this->release(), output);
|
||||
}
|
||||
|
||||
// required string name = 6;
|
||||
// required string name = 7;
|
||||
if (has_name()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->name().data(), this->name().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
::google::protobuf::internal::WireFormatLite::WriteString(
|
||||
6, this->name(), output);
|
||||
7, this->name(), output);
|
||||
}
|
||||
|
||||
// required uint32 duration_secs = 7;
|
||||
// required uint32 duration_secs = 8;
|
||||
if (has_duration_secs()) {
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->duration_secs(), output);
|
||||
::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->duration_secs(), output);
|
||||
}
|
||||
|
||||
// optional string release_date = 8;
|
||||
// optional string release_date = 9;
|
||||
if (has_release_date()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->release_date().data(), this->release_date().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
::google::protobuf::internal::WireFormatLite::WriteString(
|
||||
8, this->release_date(), output);
|
||||
9, this->release_date(), output);
|
||||
}
|
||||
|
||||
// optional string original_release_date = 9;
|
||||
// optional string original_release_date = 10;
|
||||
if (has_original_release_date()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->original_release_date().data(), this->original_release_date().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
::google::protobuf::internal::WireFormatLite::WriteString(
|
||||
9, this->original_release_date(), output);
|
||||
}
|
||||
|
||||
// repeated string genres = 10;
|
||||
for (int i = 0; i < this->genres_size(); i++) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->genres(i).data(), this->genres(i).length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
::google::protobuf::internal::WireFormatLite::WriteString(
|
||||
10, this->genres(i), output);
|
||||
10, this->original_release_date(), output);
|
||||
}
|
||||
|
||||
// optional bytes coverArt = 11;
|
||||
@@ -5037,78 +5014,65 @@ void AudioCollectionResponse_Track::SerializeWithCachedSizes(
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(1, this->id(), target);
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 2;
|
||||
// required uint64 artist_id = 2;
|
||||
if (has_artist_id()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(2, this->artist_id(), target);
|
||||
}
|
||||
|
||||
// required uint64 release_id = 3;
|
||||
if (has_release_id()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->release_id(), target);
|
||||
}
|
||||
|
||||
// repeated uint64 genre_id = 4;
|
||||
for (int i = 0; i < this->genre_id_size(); i++) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
WriteUInt64ToArray(4, this->genre_id(i), target);
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 5;
|
||||
if (has_disc_number()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->disc_number(), target);
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->disc_number(), target);
|
||||
}
|
||||
|
||||
// optional uint32 track_number = 3;
|
||||
// optional uint32 track_number = 6;
|
||||
if (has_track_number()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->track_number(), target);
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->track_number(), target);
|
||||
}
|
||||
|
||||
// optional string artist = 4;
|
||||
if (has_artist()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->artist().data(), this->artist().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
|
||||
4, this->artist(), target);
|
||||
}
|
||||
|
||||
// optional string release = 5;
|
||||
if (has_release()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->release().data(), this->release().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
|
||||
5, this->release(), target);
|
||||
}
|
||||
|
||||
// required string name = 6;
|
||||
// required string name = 7;
|
||||
if (has_name()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->name().data(), this->name().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
|
||||
6, this->name(), target);
|
||||
7, this->name(), target);
|
||||
}
|
||||
|
||||
// required uint32 duration_secs = 7;
|
||||
// required uint32 duration_secs = 8;
|
||||
if (has_duration_secs()) {
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->duration_secs(), target);
|
||||
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->duration_secs(), target);
|
||||
}
|
||||
|
||||
// optional string release_date = 8;
|
||||
// optional string release_date = 9;
|
||||
if (has_release_date()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->release_date().data(), this->release_date().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
|
||||
8, this->release_date(), target);
|
||||
9, this->release_date(), target);
|
||||
}
|
||||
|
||||
// optional string original_release_date = 9;
|
||||
// optional string original_release_date = 10;
|
||||
if (has_original_release_date()) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->original_release_date().data(), this->original_release_date().length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
target =
|
||||
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
|
||||
9, this->original_release_date(), target);
|
||||
}
|
||||
|
||||
// repeated string genres = 10;
|
||||
for (int i = 0; i < this->genres_size(); i++) {
|
||||
::google::protobuf::internal::WireFormat::VerifyUTF8String(
|
||||
this->genres(i).data(), this->genres(i).length(),
|
||||
::google::protobuf::internal::WireFormat::SERIALIZE);
|
||||
target = ::google::protobuf::internal::WireFormatLite::
|
||||
WriteStringToArray(10, this->genres(i), target);
|
||||
10, this->original_release_date(), target);
|
||||
}
|
||||
|
||||
// optional bytes coverArt = 11;
|
||||
@@ -5136,58 +5100,58 @@ int AudioCollectionResponse_Track::ByteSize() const {
|
||||
this->id());
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 2;
|
||||
// required uint64 artist_id = 2;
|
||||
if (has_artist_id()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::UInt64Size(
|
||||
this->artist_id());
|
||||
}
|
||||
|
||||
// required uint64 release_id = 3;
|
||||
if (has_release_id()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::UInt64Size(
|
||||
this->release_id());
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 5;
|
||||
if (has_disc_number()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::UInt32Size(
|
||||
this->disc_number());
|
||||
}
|
||||
|
||||
// optional uint32 track_number = 3;
|
||||
// optional uint32 track_number = 6;
|
||||
if (has_track_number()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::UInt32Size(
|
||||
this->track_number());
|
||||
}
|
||||
|
||||
// optional string artist = 4;
|
||||
if (has_artist()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::StringSize(
|
||||
this->artist());
|
||||
}
|
||||
|
||||
// optional string release = 5;
|
||||
if (has_release()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::StringSize(
|
||||
this->release());
|
||||
}
|
||||
|
||||
// required string name = 6;
|
||||
// required string name = 7;
|
||||
if (has_name()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::StringSize(
|
||||
this->name());
|
||||
}
|
||||
|
||||
// required uint32 duration_secs = 7;
|
||||
// required uint32 duration_secs = 8;
|
||||
if (has_duration_secs()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::UInt32Size(
|
||||
this->duration_secs());
|
||||
}
|
||||
|
||||
// optional string release_date = 8;
|
||||
}
|
||||
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
|
||||
// optional string release_date = 9;
|
||||
if (has_release_date()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::StringSize(
|
||||
this->release_date());
|
||||
}
|
||||
|
||||
}
|
||||
if (_has_bits_[8 / 32] & (0xffu << (8 % 32))) {
|
||||
// optional string original_release_date = 9;
|
||||
// optional string original_release_date = 10;
|
||||
if (has_original_release_date()) {
|
||||
total_size += 1 +
|
||||
::google::protobuf::internal::WireFormatLite::StringSize(
|
||||
@@ -5202,11 +5166,14 @@ int AudioCollectionResponse_Track::ByteSize() const {
|
||||
}
|
||||
|
||||
}
|
||||
// repeated string genres = 10;
|
||||
total_size += 1 * this->genres_size();
|
||||
for (int i = 0; i < this->genres_size(); i++) {
|
||||
total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
|
||||
this->genres(i));
|
||||
// repeated uint64 genre_id = 4;
|
||||
{
|
||||
int data_size = 0;
|
||||
for (int i = 0; i < this->genre_id_size(); i++) {
|
||||
data_size += ::google::protobuf::internal::WireFormatLite::
|
||||
UInt64Size(this->genre_id(i));
|
||||
}
|
||||
total_size += 1 * this->genre_id_size() + data_size;
|
||||
}
|
||||
|
||||
if (!unknown_fields().empty()) {
|
||||
@@ -5234,34 +5201,34 @@ void AudioCollectionResponse_Track::MergeFrom(const ::google::protobuf::Message&
|
||||
|
||||
void AudioCollectionResponse_Track::MergeFrom(const AudioCollectionResponse_Track& from) {
|
||||
GOOGLE_CHECK_NE(&from, this);
|
||||
genres_.MergeFrom(from.genres_);
|
||||
genre_id_.MergeFrom(from.genre_id_);
|
||||
if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
|
||||
if (from.has_id()) {
|
||||
set_id(from.id());
|
||||
}
|
||||
if (from.has_artist_id()) {
|
||||
set_artist_id(from.artist_id());
|
||||
}
|
||||
if (from.has_release_id()) {
|
||||
set_release_id(from.release_id());
|
||||
}
|
||||
if (from.has_disc_number()) {
|
||||
set_disc_number(from.disc_number());
|
||||
}
|
||||
if (from.has_track_number()) {
|
||||
set_track_number(from.track_number());
|
||||
}
|
||||
if (from.has_artist()) {
|
||||
set_artist(from.artist());
|
||||
}
|
||||
if (from.has_release()) {
|
||||
set_release(from.release());
|
||||
}
|
||||
if (from.has_name()) {
|
||||
set_name(from.name());
|
||||
}
|
||||
if (from.has_duration_secs()) {
|
||||
set_duration_secs(from.duration_secs());
|
||||
}
|
||||
}
|
||||
if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
|
||||
if (from.has_release_date()) {
|
||||
set_release_date(from.release_date());
|
||||
}
|
||||
}
|
||||
if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
|
||||
if (from.has_original_release_date()) {
|
||||
set_original_release_date(from.original_release_date());
|
||||
}
|
||||
@@ -5285,7 +5252,7 @@ void AudioCollectionResponse_Track::CopyFrom(const AudioCollectionResponse_Track
|
||||
}
|
||||
|
||||
bool AudioCollectionResponse_Track::IsInitialized() const {
|
||||
if ((_has_bits_[0] & 0x00000061) != 0x00000061) return false;
|
||||
if ((_has_bits_[0] & 0x000000c7) != 0x000000c7) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -5293,15 +5260,15 @@ bool AudioCollectionResponse_Track::IsInitialized() const {
|
||||
void AudioCollectionResponse_Track::Swap(AudioCollectionResponse_Track* other) {
|
||||
if (other != this) {
|
||||
std::swap(id_, other->id_);
|
||||
std::swap(artist_id_, other->artist_id_);
|
||||
std::swap(release_id_, other->release_id_);
|
||||
genre_id_.Swap(&other->genre_id_);
|
||||
std::swap(disc_number_, other->disc_number_);
|
||||
std::swap(track_number_, other->track_number_);
|
||||
std::swap(artist_, other->artist_);
|
||||
std::swap(release_, other->release_);
|
||||
std::swap(name_, other->name_);
|
||||
std::swap(duration_secs_, other->duration_secs_);
|
||||
std::swap(release_date_, other->release_date_);
|
||||
std::swap(original_release_date_, other->original_release_date_);
|
||||
genres_.Swap(&other->genres_);
|
||||
std::swap(coverart_, other->coverart_);
|
||||
std::swap(_has_bits_[0], other->_has_bits_[0]);
|
||||
_unknown_fields_.Swap(&other->_unknown_fields_);
|
||||
|
||||
+138
-267
@@ -1638,48 +1638,50 @@ class AudioCollectionResponse_Track : public ::google::protobuf::Message {
|
||||
inline ::google::protobuf::uint64 id() const;
|
||||
inline void set_id(::google::protobuf::uint64 value);
|
||||
|
||||
// optional uint32 disc_number = 2;
|
||||
// required uint64 artist_id = 2;
|
||||
inline bool has_artist_id() const;
|
||||
inline void clear_artist_id();
|
||||
static const int kArtistIdFieldNumber = 2;
|
||||
inline ::google::protobuf::uint64 artist_id() const;
|
||||
inline void set_artist_id(::google::protobuf::uint64 value);
|
||||
|
||||
// required uint64 release_id = 3;
|
||||
inline bool has_release_id() const;
|
||||
inline void clear_release_id();
|
||||
static const int kReleaseIdFieldNumber = 3;
|
||||
inline ::google::protobuf::uint64 release_id() const;
|
||||
inline void set_release_id(::google::protobuf::uint64 value);
|
||||
|
||||
// repeated uint64 genre_id = 4;
|
||||
inline int genre_id_size() const;
|
||||
inline void clear_genre_id();
|
||||
static const int kGenreIdFieldNumber = 4;
|
||||
inline ::google::protobuf::uint64 genre_id(int index) const;
|
||||
inline void set_genre_id(int index, ::google::protobuf::uint64 value);
|
||||
inline void add_genre_id(::google::protobuf::uint64 value);
|
||||
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
|
||||
genre_id() const;
|
||||
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
|
||||
mutable_genre_id();
|
||||
|
||||
// optional uint32 disc_number = 5;
|
||||
inline bool has_disc_number() const;
|
||||
inline void clear_disc_number();
|
||||
static const int kDiscNumberFieldNumber = 2;
|
||||
static const int kDiscNumberFieldNumber = 5;
|
||||
inline ::google::protobuf::uint32 disc_number() const;
|
||||
inline void set_disc_number(::google::protobuf::uint32 value);
|
||||
|
||||
// optional uint32 track_number = 3;
|
||||
// optional uint32 track_number = 6;
|
||||
inline bool has_track_number() const;
|
||||
inline void clear_track_number();
|
||||
static const int kTrackNumberFieldNumber = 3;
|
||||
static const int kTrackNumberFieldNumber = 6;
|
||||
inline ::google::protobuf::uint32 track_number() const;
|
||||
inline void set_track_number(::google::protobuf::uint32 value);
|
||||
|
||||
// optional string artist = 4;
|
||||
inline bool has_artist() const;
|
||||
inline void clear_artist();
|
||||
static const int kArtistFieldNumber = 4;
|
||||
inline const ::std::string& artist() const;
|
||||
inline void set_artist(const ::std::string& value);
|
||||
inline void set_artist(const char* value);
|
||||
inline void set_artist(const char* value, size_t size);
|
||||
inline ::std::string* mutable_artist();
|
||||
inline ::std::string* release_artist();
|
||||
inline void set_allocated_artist(::std::string* artist);
|
||||
|
||||
// optional string release = 5;
|
||||
inline bool has_release() const;
|
||||
inline void clear_release();
|
||||
static const int kReleaseFieldNumber = 5;
|
||||
inline const ::std::string& release() const;
|
||||
inline void set_release(const ::std::string& value);
|
||||
inline void set_release(const char* value);
|
||||
inline void set_release(const char* value, size_t size);
|
||||
inline ::std::string* mutable_release();
|
||||
inline ::std::string* release_release();
|
||||
inline void set_allocated_release(::std::string* release);
|
||||
|
||||
// required string name = 6;
|
||||
// required string name = 7;
|
||||
inline bool has_name() const;
|
||||
inline void clear_name();
|
||||
static const int kNameFieldNumber = 6;
|
||||
static const int kNameFieldNumber = 7;
|
||||
inline const ::std::string& name() const;
|
||||
inline void set_name(const ::std::string& value);
|
||||
inline void set_name(const char* value);
|
||||
@@ -1688,17 +1690,17 @@ class AudioCollectionResponse_Track : public ::google::protobuf::Message {
|
||||
inline ::std::string* release_name();
|
||||
inline void set_allocated_name(::std::string* name);
|
||||
|
||||
// required uint32 duration_secs = 7;
|
||||
// required uint32 duration_secs = 8;
|
||||
inline bool has_duration_secs() const;
|
||||
inline void clear_duration_secs();
|
||||
static const int kDurationSecsFieldNumber = 7;
|
||||
static const int kDurationSecsFieldNumber = 8;
|
||||
inline ::google::protobuf::uint32 duration_secs() const;
|
||||
inline void set_duration_secs(::google::protobuf::uint32 value);
|
||||
|
||||
// optional string release_date = 8;
|
||||
// optional string release_date = 9;
|
||||
inline bool has_release_date() const;
|
||||
inline void clear_release_date();
|
||||
static const int kReleaseDateFieldNumber = 8;
|
||||
static const int kReleaseDateFieldNumber = 9;
|
||||
inline const ::std::string& release_date() const;
|
||||
inline void set_release_date(const ::std::string& value);
|
||||
inline void set_release_date(const char* value);
|
||||
@@ -1707,10 +1709,10 @@ class AudioCollectionResponse_Track : public ::google::protobuf::Message {
|
||||
inline ::std::string* release_release_date();
|
||||
inline void set_allocated_release_date(::std::string* release_date);
|
||||
|
||||
// optional string original_release_date = 9;
|
||||
// optional string original_release_date = 10;
|
||||
inline bool has_original_release_date() const;
|
||||
inline void clear_original_release_date();
|
||||
static const int kOriginalReleaseDateFieldNumber = 9;
|
||||
static const int kOriginalReleaseDateFieldNumber = 10;
|
||||
inline const ::std::string& original_release_date() const;
|
||||
inline void set_original_release_date(const ::std::string& value);
|
||||
inline void set_original_release_date(const char* value);
|
||||
@@ -1719,22 +1721,6 @@ class AudioCollectionResponse_Track : public ::google::protobuf::Message {
|
||||
inline ::std::string* release_original_release_date();
|
||||
inline void set_allocated_original_release_date(::std::string* original_release_date);
|
||||
|
||||
// repeated string genres = 10;
|
||||
inline int genres_size() const;
|
||||
inline void clear_genres();
|
||||
static const int kGenresFieldNumber = 10;
|
||||
inline const ::std::string& genres(int index) const;
|
||||
inline ::std::string* mutable_genres(int index);
|
||||
inline void set_genres(int index, const ::std::string& value);
|
||||
inline void set_genres(int index, const char* value);
|
||||
inline void set_genres(int index, const char* value, size_t size);
|
||||
inline ::std::string* add_genres();
|
||||
inline void add_genres(const ::std::string& value);
|
||||
inline void add_genres(const char* value);
|
||||
inline void add_genres(const char* value, size_t size);
|
||||
inline const ::google::protobuf::RepeatedPtrField< ::std::string>& genres() const;
|
||||
inline ::google::protobuf::RepeatedPtrField< ::std::string>* mutable_genres();
|
||||
|
||||
// optional bytes coverArt = 11;
|
||||
inline bool has_coverart() const;
|
||||
inline void clear_coverart();
|
||||
@@ -1751,14 +1737,14 @@ class AudioCollectionResponse_Track : public ::google::protobuf::Message {
|
||||
private:
|
||||
inline void set_has_id();
|
||||
inline void clear_has_id();
|
||||
inline void set_has_artist_id();
|
||||
inline void clear_has_artist_id();
|
||||
inline void set_has_release_id();
|
||||
inline void clear_has_release_id();
|
||||
inline void set_has_disc_number();
|
||||
inline void clear_has_disc_number();
|
||||
inline void set_has_track_number();
|
||||
inline void clear_has_track_number();
|
||||
inline void set_has_artist();
|
||||
inline void clear_has_artist();
|
||||
inline void set_has_release();
|
||||
inline void clear_has_release();
|
||||
inline void set_has_name();
|
||||
inline void clear_has_name();
|
||||
inline void set_has_duration_secs();
|
||||
@@ -1773,14 +1759,14 @@ class AudioCollectionResponse_Track : public ::google::protobuf::Message {
|
||||
::google::protobuf::UnknownFieldSet _unknown_fields_;
|
||||
|
||||
::google::protobuf::uint64 id_;
|
||||
::google::protobuf::uint64 artist_id_;
|
||||
::google::protobuf::uint64 release_id_;
|
||||
::google::protobuf::RepeatedField< ::google::protobuf::uint64 > genre_id_;
|
||||
::google::protobuf::uint32 disc_number_;
|
||||
::google::protobuf::uint32 track_number_;
|
||||
::std::string* artist_;
|
||||
::std::string* release_;
|
||||
::std::string* name_;
|
||||
::std::string* release_date_;
|
||||
::std::string* original_release_date_;
|
||||
::google::protobuf::RepeatedPtrField< ::std::string> genres_;
|
||||
::std::string* coverart_;
|
||||
::google::protobuf::uint32 duration_secs_;
|
||||
|
||||
@@ -3287,16 +3273,85 @@ inline void AudioCollectionResponse_Track::set_id(::google::protobuf::uint64 val
|
||||
id_ = value;
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 2;
|
||||
inline bool AudioCollectionResponse_Track::has_disc_number() const {
|
||||
// required uint64 artist_id = 2;
|
||||
inline bool AudioCollectionResponse_Track::has_artist_id() const {
|
||||
return (_has_bits_[0] & 0x00000002u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_disc_number() {
|
||||
inline void AudioCollectionResponse_Track::set_has_artist_id() {
|
||||
_has_bits_[0] |= 0x00000002u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_disc_number() {
|
||||
inline void AudioCollectionResponse_Track::clear_has_artist_id() {
|
||||
_has_bits_[0] &= ~0x00000002u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_artist_id() {
|
||||
artist_id_ = GOOGLE_ULONGLONG(0);
|
||||
clear_has_artist_id();
|
||||
}
|
||||
inline ::google::protobuf::uint64 AudioCollectionResponse_Track::artist_id() const {
|
||||
return artist_id_;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_artist_id(::google::protobuf::uint64 value) {
|
||||
set_has_artist_id();
|
||||
artist_id_ = value;
|
||||
}
|
||||
|
||||
// required uint64 release_id = 3;
|
||||
inline bool AudioCollectionResponse_Track::has_release_id() const {
|
||||
return (_has_bits_[0] & 0x00000004u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_release_id() {
|
||||
_has_bits_[0] |= 0x00000004u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_release_id() {
|
||||
_has_bits_[0] &= ~0x00000004u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_release_id() {
|
||||
release_id_ = GOOGLE_ULONGLONG(0);
|
||||
clear_has_release_id();
|
||||
}
|
||||
inline ::google::protobuf::uint64 AudioCollectionResponse_Track::release_id() const {
|
||||
return release_id_;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_release_id(::google::protobuf::uint64 value) {
|
||||
set_has_release_id();
|
||||
release_id_ = value;
|
||||
}
|
||||
|
||||
// repeated uint64 genre_id = 4;
|
||||
inline int AudioCollectionResponse_Track::genre_id_size() const {
|
||||
return genre_id_.size();
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_genre_id() {
|
||||
genre_id_.Clear();
|
||||
}
|
||||
inline ::google::protobuf::uint64 AudioCollectionResponse_Track::genre_id(int index) const {
|
||||
return genre_id_.Get(index);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_genre_id(int index, ::google::protobuf::uint64 value) {
|
||||
genre_id_.Set(index, value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::add_genre_id(::google::protobuf::uint64 value) {
|
||||
genre_id_.Add(value);
|
||||
}
|
||||
inline const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
|
||||
AudioCollectionResponse_Track::genre_id() const {
|
||||
return genre_id_;
|
||||
}
|
||||
inline ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
|
||||
AudioCollectionResponse_Track::mutable_genre_id() {
|
||||
return &genre_id_;
|
||||
}
|
||||
|
||||
// optional uint32 disc_number = 5;
|
||||
inline bool AudioCollectionResponse_Track::has_disc_number() const {
|
||||
return (_has_bits_[0] & 0x00000010u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_disc_number() {
|
||||
_has_bits_[0] |= 0x00000010u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_disc_number() {
|
||||
_has_bits_[0] &= ~0x00000010u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_disc_number() {
|
||||
disc_number_ = 0u;
|
||||
clear_has_disc_number();
|
||||
@@ -3309,15 +3364,15 @@ inline void AudioCollectionResponse_Track::set_disc_number(::google::protobuf::u
|
||||
disc_number_ = value;
|
||||
}
|
||||
|
||||
// optional uint32 track_number = 3;
|
||||
// optional uint32 track_number = 6;
|
||||
inline bool AudioCollectionResponse_Track::has_track_number() const {
|
||||
return (_has_bits_[0] & 0x00000004u) != 0;
|
||||
return (_has_bits_[0] & 0x00000020u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_track_number() {
|
||||
_has_bits_[0] |= 0x00000004u;
|
||||
_has_bits_[0] |= 0x00000020u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_track_number() {
|
||||
_has_bits_[0] &= ~0x00000004u;
|
||||
_has_bits_[0] &= ~0x00000020u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_track_number() {
|
||||
track_number_ = 0u;
|
||||
@@ -3331,155 +3386,15 @@ inline void AudioCollectionResponse_Track::set_track_number(::google::protobuf::
|
||||
track_number_ = value;
|
||||
}
|
||||
|
||||
// optional string artist = 4;
|
||||
inline bool AudioCollectionResponse_Track::has_artist() const {
|
||||
return (_has_bits_[0] & 0x00000008u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_artist() {
|
||||
_has_bits_[0] |= 0x00000008u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_artist() {
|
||||
_has_bits_[0] &= ~0x00000008u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_artist() {
|
||||
if (artist_ != &::google::protobuf::internal::kEmptyString) {
|
||||
artist_->clear();
|
||||
}
|
||||
clear_has_artist();
|
||||
}
|
||||
inline const ::std::string& AudioCollectionResponse_Track::artist() const {
|
||||
return *artist_;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_artist(const ::std::string& value) {
|
||||
set_has_artist();
|
||||
if (artist_ == &::google::protobuf::internal::kEmptyString) {
|
||||
artist_ = new ::std::string;
|
||||
}
|
||||
artist_->assign(value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_artist(const char* value) {
|
||||
set_has_artist();
|
||||
if (artist_ == &::google::protobuf::internal::kEmptyString) {
|
||||
artist_ = new ::std::string;
|
||||
}
|
||||
artist_->assign(value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_artist(const char* value, size_t size) {
|
||||
set_has_artist();
|
||||
if (artist_ == &::google::protobuf::internal::kEmptyString) {
|
||||
artist_ = new ::std::string;
|
||||
}
|
||||
artist_->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* AudioCollectionResponse_Track::mutable_artist() {
|
||||
set_has_artist();
|
||||
if (artist_ == &::google::protobuf::internal::kEmptyString) {
|
||||
artist_ = new ::std::string;
|
||||
}
|
||||
return artist_;
|
||||
}
|
||||
inline ::std::string* AudioCollectionResponse_Track::release_artist() {
|
||||
clear_has_artist();
|
||||
if (artist_ == &::google::protobuf::internal::kEmptyString) {
|
||||
return NULL;
|
||||
} else {
|
||||
::std::string* temp = artist_;
|
||||
artist_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_allocated_artist(::std::string* artist) {
|
||||
if (artist_ != &::google::protobuf::internal::kEmptyString) {
|
||||
delete artist_;
|
||||
}
|
||||
if (artist) {
|
||||
set_has_artist();
|
||||
artist_ = artist;
|
||||
} else {
|
||||
clear_has_artist();
|
||||
artist_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
|
||||
}
|
||||
}
|
||||
|
||||
// optional string release = 5;
|
||||
inline bool AudioCollectionResponse_Track::has_release() const {
|
||||
return (_has_bits_[0] & 0x00000010u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_release() {
|
||||
_has_bits_[0] |= 0x00000010u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_release() {
|
||||
_has_bits_[0] &= ~0x00000010u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_release() {
|
||||
if (release_ != &::google::protobuf::internal::kEmptyString) {
|
||||
release_->clear();
|
||||
}
|
||||
clear_has_release();
|
||||
}
|
||||
inline const ::std::string& AudioCollectionResponse_Track::release() const {
|
||||
return *release_;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_release(const ::std::string& value) {
|
||||
set_has_release();
|
||||
if (release_ == &::google::protobuf::internal::kEmptyString) {
|
||||
release_ = new ::std::string;
|
||||
}
|
||||
release_->assign(value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_release(const char* value) {
|
||||
set_has_release();
|
||||
if (release_ == &::google::protobuf::internal::kEmptyString) {
|
||||
release_ = new ::std::string;
|
||||
}
|
||||
release_->assign(value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_release(const char* value, size_t size) {
|
||||
set_has_release();
|
||||
if (release_ == &::google::protobuf::internal::kEmptyString) {
|
||||
release_ = new ::std::string;
|
||||
}
|
||||
release_->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* AudioCollectionResponse_Track::mutable_release() {
|
||||
set_has_release();
|
||||
if (release_ == &::google::protobuf::internal::kEmptyString) {
|
||||
release_ = new ::std::string;
|
||||
}
|
||||
return release_;
|
||||
}
|
||||
inline ::std::string* AudioCollectionResponse_Track::release_release() {
|
||||
clear_has_release();
|
||||
if (release_ == &::google::protobuf::internal::kEmptyString) {
|
||||
return NULL;
|
||||
} else {
|
||||
::std::string* temp = release_;
|
||||
release_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
|
||||
return temp;
|
||||
}
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_allocated_release(::std::string* release) {
|
||||
if (release_ != &::google::protobuf::internal::kEmptyString) {
|
||||
delete release_;
|
||||
}
|
||||
if (release) {
|
||||
set_has_release();
|
||||
release_ = release;
|
||||
} else {
|
||||
clear_has_release();
|
||||
release_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
|
||||
}
|
||||
}
|
||||
|
||||
// required string name = 6;
|
||||
// required string name = 7;
|
||||
inline bool AudioCollectionResponse_Track::has_name() const {
|
||||
return (_has_bits_[0] & 0x00000020u) != 0;
|
||||
return (_has_bits_[0] & 0x00000040u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_name() {
|
||||
_has_bits_[0] |= 0x00000020u;
|
||||
_has_bits_[0] |= 0x00000040u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_name() {
|
||||
_has_bits_[0] &= ~0x00000020u;
|
||||
_has_bits_[0] &= ~0x00000040u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_name() {
|
||||
if (name_ != &::google::protobuf::internal::kEmptyString) {
|
||||
@@ -3541,15 +3456,15 @@ inline void AudioCollectionResponse_Track::set_allocated_name(::std::string* nam
|
||||
}
|
||||
}
|
||||
|
||||
// required uint32 duration_secs = 7;
|
||||
// required uint32 duration_secs = 8;
|
||||
inline bool AudioCollectionResponse_Track::has_duration_secs() const {
|
||||
return (_has_bits_[0] & 0x00000040u) != 0;
|
||||
return (_has_bits_[0] & 0x00000080u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_duration_secs() {
|
||||
_has_bits_[0] |= 0x00000040u;
|
||||
_has_bits_[0] |= 0x00000080u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_duration_secs() {
|
||||
_has_bits_[0] &= ~0x00000040u;
|
||||
_has_bits_[0] &= ~0x00000080u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_duration_secs() {
|
||||
duration_secs_ = 0u;
|
||||
@@ -3563,15 +3478,15 @@ inline void AudioCollectionResponse_Track::set_duration_secs(::google::protobuf:
|
||||
duration_secs_ = value;
|
||||
}
|
||||
|
||||
// optional string release_date = 8;
|
||||
// optional string release_date = 9;
|
||||
inline bool AudioCollectionResponse_Track::has_release_date() const {
|
||||
return (_has_bits_[0] & 0x00000080u) != 0;
|
||||
return (_has_bits_[0] & 0x00000100u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_release_date() {
|
||||
_has_bits_[0] |= 0x00000080u;
|
||||
_has_bits_[0] |= 0x00000100u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_release_date() {
|
||||
_has_bits_[0] &= ~0x00000080u;
|
||||
_has_bits_[0] &= ~0x00000100u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_release_date() {
|
||||
if (release_date_ != &::google::protobuf::internal::kEmptyString) {
|
||||
@@ -3633,15 +3548,15 @@ inline void AudioCollectionResponse_Track::set_allocated_release_date(::std::str
|
||||
}
|
||||
}
|
||||
|
||||
// optional string original_release_date = 9;
|
||||
// optional string original_release_date = 10;
|
||||
inline bool AudioCollectionResponse_Track::has_original_release_date() const {
|
||||
return (_has_bits_[0] & 0x00000100u) != 0;
|
||||
return (_has_bits_[0] & 0x00000200u) != 0;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_has_original_release_date() {
|
||||
_has_bits_[0] |= 0x00000100u;
|
||||
_has_bits_[0] |= 0x00000200u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_has_original_release_date() {
|
||||
_has_bits_[0] &= ~0x00000100u;
|
||||
_has_bits_[0] &= ~0x00000200u;
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_original_release_date() {
|
||||
if (original_release_date_ != &::google::protobuf::internal::kEmptyString) {
|
||||
@@ -3703,50 +3618,6 @@ inline void AudioCollectionResponse_Track::set_allocated_original_release_date(:
|
||||
}
|
||||
}
|
||||
|
||||
// repeated string genres = 10;
|
||||
inline int AudioCollectionResponse_Track::genres_size() const {
|
||||
return genres_.size();
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::clear_genres() {
|
||||
genres_.Clear();
|
||||
}
|
||||
inline const ::std::string& AudioCollectionResponse_Track::genres(int index) const {
|
||||
return genres_.Get(index);
|
||||
}
|
||||
inline ::std::string* AudioCollectionResponse_Track::mutable_genres(int index) {
|
||||
return genres_.Mutable(index);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_genres(int index, const ::std::string& value) {
|
||||
genres_.Mutable(index)->assign(value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_genres(int index, const char* value) {
|
||||
genres_.Mutable(index)->assign(value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::set_genres(int index, const char* value, size_t size) {
|
||||
genres_.Mutable(index)->assign(
|
||||
reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline ::std::string* AudioCollectionResponse_Track::add_genres() {
|
||||
return genres_.Add();
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::add_genres(const ::std::string& value) {
|
||||
genres_.Add()->assign(value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::add_genres(const char* value) {
|
||||
genres_.Add()->assign(value);
|
||||
}
|
||||
inline void AudioCollectionResponse_Track::add_genres(const char* value, size_t size) {
|
||||
genres_.Add()->assign(reinterpret_cast<const char*>(value), size);
|
||||
}
|
||||
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
|
||||
AudioCollectionResponse_Track::genres() const {
|
||||
return genres_;
|
||||
}
|
||||
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
|
||||
AudioCollectionResponse_Track::mutable_genres() {
|
||||
return &genres_;
|
||||
}
|
||||
|
||||
// optional bytes coverArt = 11;
|
||||
inline bool AudioCollectionResponse_Track::has_coverart() const {
|
||||
return (_has_bits_[0] & 0x00000400u) != 0;
|
||||
|
||||
@@ -126,21 +126,16 @@ message AudioCollectionResponse
|
||||
{
|
||||
required uint64 id = 1;
|
||||
|
||||
optional uint32 disc_number = 2;
|
||||
optional uint32 track_number = 3;
|
||||
|
||||
optional string artist = 4;
|
||||
optional string release = 5;
|
||||
|
||||
required string name = 6;
|
||||
|
||||
required uint32 duration_secs = 7;
|
||||
|
||||
optional string release_date = 8;
|
||||
optional string original_release_date = 9;
|
||||
|
||||
repeated string genres = 10;
|
||||
required uint64 artist_id = 2;
|
||||
required uint64 release_id = 3;
|
||||
repeated uint64 genre_id = 4;
|
||||
|
||||
optional uint32 disc_number = 5;
|
||||
optional uint32 track_number = 6;
|
||||
required string name = 7;
|
||||
required uint32 duration_secs = 8;
|
||||
optional string release_date = 9;
|
||||
optional string original_release_date = 10;
|
||||
optional bytes coverArt = 11;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#include <algorithm> // std::max
|
||||
#include <algorithm> // std::min
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
#include "AudioCollectionRequestHandler.hpp"
|
||||
|
||||
@@ -44,9 +46,27 @@ AudioCollectionRequestHandler::process(const AudioCollectionRequest& request, Au
|
||||
break;
|
||||
|
||||
case AudioCollectionRequest_Type_TypeGetReleaseList:
|
||||
if (request.has_get_releases())
|
||||
{
|
||||
res = processGetReleases(request.get_releases(), *response.mutable_release_list());
|
||||
if (res)
|
||||
response.set_type(AudioCollectionResponse_Type_TypeReleaseList);
|
||||
|
||||
}
|
||||
else
|
||||
std::cerr << "Bad AudioCollectionRequest_Type_TypeGetReleaseList" << std::endl;
|
||||
break;
|
||||
|
||||
case AudioCollectionRequest_Type_TypeGetTrackList:
|
||||
if (request.has_get_tracks())
|
||||
{
|
||||
res = processGetTracks(request.get_tracks(), *response.mutable_track_list());
|
||||
if (res)
|
||||
response.set_type(AudioCollectionResponse_Type_TypeTrackList);
|
||||
|
||||
}
|
||||
else
|
||||
std::cerr << "Bad AudioCollectionRequest_Type_TypeGetTrackList" << std::endl;
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -67,16 +87,18 @@ AudioCollectionRequestHandler::processGetGenres(const AudioCollectionRequest::Ge
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cout << "Offset = " << request.batch_parameter().offset() << std::endl;
|
||||
std::cout << "Size = " << request.batch_parameter().size() << std::endl;
|
||||
std::size_t size = request.batch_parameter().size();
|
||||
if (!size)
|
||||
size = _maxListArtists;
|
||||
size = std::min(size, _maxListArtists);
|
||||
|
||||
Wt::Dbo::Transaction transaction( _db.getSession() );
|
||||
|
||||
Wt::Dbo::collection<Genre::pointer> genres = Genre::getAll( _db.getSession(), request.batch_parameter().offset(), std::max(static_cast<std::size_t>(request.batch_parameter().size()), _maxListGenres) );
|
||||
Wt::Dbo::collection<Genre::pointer> genres = Genre::getAll( _db.getSession(), request.batch_parameter().offset(), static_cast<int>(size));
|
||||
|
||||
typedef Wt::Dbo::collection< Genre::pointer > Genres;
|
||||
|
||||
for (Genres::iterator it = genres.begin(); it != genres.end(); ++it)
|
||||
for (Genres::const_iterator it = genres.begin(); it != genres.end(); ++it)
|
||||
{
|
||||
AudioCollectionResponse_Genre* genre = response.add_genres();
|
||||
|
||||
@@ -90,7 +112,6 @@ AudioCollectionRequestHandler::processGetGenres(const AudioCollectionRequest::Ge
|
||||
bool
|
||||
AudioCollectionRequestHandler::processGetArtists(const AudioCollectionRequest::GetArtistList& request, AudioCollectionResponse::ArtistList& response)
|
||||
{
|
||||
|
||||
// sanity checks
|
||||
if (!request.has_batch_parameter())
|
||||
{
|
||||
@@ -98,31 +119,20 @@ AudioCollectionRequestHandler::processGetArtists(const AudioCollectionRequest::G
|
||||
return false;
|
||||
}
|
||||
|
||||
std::cout << "Offset = " << request.batch_parameter().offset() << std::endl;
|
||||
std::cout << "Size = " << request.batch_parameter().size() << std::endl;
|
||||
if (request.batch_parameter().size() > _maxListArtists)
|
||||
std::cerr << "Warning: batch parameter size too high (" << request.batch_parameter().size() << ")" << std::endl;
|
||||
|
||||
|
||||
for (int id = 0; id < request.genre_id_size(); ++id)
|
||||
{
|
||||
std::cout << "Genre id " << id << " = '" << request.genre_id(id) << "'" << std::endl;
|
||||
}
|
||||
|
||||
std::size_t size = request.batch_parameter().size();
|
||||
if (!size)
|
||||
size = _maxListArtists;
|
||||
size = std::min(size, _maxListArtists);
|
||||
|
||||
// Now fetch requested data...
|
||||
|
||||
std::cout << "Getting artists..." << std::endl;
|
||||
|
||||
Wt::Dbo::Transaction transaction( _db.getSession() );
|
||||
|
||||
Wt::Dbo::collection<Artist::pointer> artists = Artist::getAll( _db.getSession(), request.batch_parameter().offset(), std::max(static_cast<std::size_t>(request.batch_parameter().size()), _maxListArtists) );
|
||||
|
||||
std::cout << "size = " << artists.size() << std::endl;
|
||||
Wt::Dbo::collection<Artist::pointer> artists = Artist::getAll( _db.getSession(), request.batch_parameter().offset(), static_cast<int>(size) );
|
||||
|
||||
typedef Wt::Dbo::collection< Artist::pointer > Artists;
|
||||
|
||||
for (Artists::iterator it = artists.begin(); it != artists.end(); ++it)
|
||||
for (Artists::const_iterator it = artists.begin(); it != artists.end(); ++it)
|
||||
{
|
||||
AudioCollectionResponse_Artist* artist = response.add_artists();
|
||||
|
||||
@@ -131,7 +141,105 @@ AudioCollectionRequestHandler::processGetArtists(const AudioCollectionRequest::G
|
||||
artist->set_id(it->id());
|
||||
}
|
||||
|
||||
std::cout << "Getting artists DONE" << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
AudioCollectionRequestHandler::processGetReleases(const AudioCollectionRequest::GetReleaseList& request, AudioCollectionResponse::ReleaseList& response)
|
||||
{
|
||||
// sanity checks
|
||||
if (!request.has_batch_parameter())
|
||||
{
|
||||
std::cerr << "No batch parameters found!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::size_t size = request.batch_parameter().size();
|
||||
if (!size)
|
||||
size = _maxListReleases;
|
||||
size = std::min(size, _maxListReleases);
|
||||
|
||||
std::vector<Artist::id_type> artistIds;
|
||||
for (int id = 0; id < request.artist_id_size(); ++id)
|
||||
artistIds.push_back( request.artist_id(id) );
|
||||
|
||||
Wt::Dbo::Transaction transaction( _db.getSession() );
|
||||
|
||||
Wt::Dbo::collection<Release::pointer> releases = Release::getAll( _db.getSession(), artistIds, request.batch_parameter().offset(), static_cast<int>(size));
|
||||
|
||||
typedef Wt::Dbo::collection< Release::pointer > Releases;
|
||||
|
||||
for (Releases::const_iterator it = releases.begin(); it != releases.end(); ++it)
|
||||
{
|
||||
AudioCollectionResponse_Release* release = response.add_releases();
|
||||
|
||||
release->set_name((*it)->getName());
|
||||
release->set_id(it->id());
|
||||
// WARNING: next two lines are very time consuming!
|
||||
release->set_nb_tracks( (*it)->getTracks().size() );
|
||||
release->set_duration_secs( (*it)->getDuration().total_seconds() );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
AudioCollectionRequestHandler::processGetTracks(const AudioCollectionRequest::GetTrackList& request, AudioCollectionResponse::TrackList& response)
|
||||
{
|
||||
// sanity checks
|
||||
if (!request.has_batch_parameter())
|
||||
{
|
||||
std::cerr << "No batch parameters found!" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::size_t size = request.batch_parameter().size();
|
||||
if (!size)
|
||||
size = _maxListTracks;
|
||||
size = std::min(size, _maxListTracks);
|
||||
|
||||
// Get filters
|
||||
std::vector<Artist::id_type> artistIds;
|
||||
for (int id = 0; id < request.artist_id_size(); ++id)
|
||||
artistIds.push_back( request.artist_id(id) );
|
||||
|
||||
std::vector<Release::id_type> releaseIds;
|
||||
for (int id = 0; id < request.release_id_size(); ++id)
|
||||
releaseIds.push_back( request.release_id(id) );
|
||||
|
||||
std::vector<Release::id_type> genreIds;
|
||||
for (int id = 0; id < request.genre_id_size(); ++id)
|
||||
genreIds.push_back( request.genre_id(id) );
|
||||
|
||||
Wt::Dbo::Transaction transaction( _db.getSession() );
|
||||
|
||||
Wt::Dbo::collection<Track::pointer> tracks = Track::getAll( _db.getSession(),
|
||||
artistIds, releaseIds, genreIds,
|
||||
request.batch_parameter().offset(), static_cast<int>(size));
|
||||
|
||||
typedef Wt::Dbo::collection< Track::pointer > Tracks;
|
||||
|
||||
for (Tracks::const_iterator it = tracks.begin(); it != tracks.end(); ++it)
|
||||
{
|
||||
AudioCollectionResponse_Track* track = response.add_tracks();
|
||||
|
||||
track->set_id(it->id());
|
||||
track->set_disc_number( (*it)->getDiscNumber() );
|
||||
track->set_track_number( (*it)->getTrackNumber() );
|
||||
track->set_artist_id( (*it)->getArtist().id() );
|
||||
track->set_release_id( (*it)->getRelease().id() );
|
||||
|
||||
track->set_name( (*it)->getName() );
|
||||
track->set_duration_secs( (*it)->getDuration().total_seconds() );
|
||||
// if (!(*it)->getCreationTime().is_special())
|
||||
// track->set_release_date( boost::posix_time::to_simple_string((*it)->getCreationTime()) );
|
||||
|
||||
BOOST_FOREACH(Genre::pointer genre, (*it)->getGenres())
|
||||
track->add_genre_id( genre.id() );
|
||||
|
||||
// if (!(*it)->getCoverArt().empty)
|
||||
// track->set_coverart( (*it)->getCoverArt() );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -19,13 +19,15 @@ class AudioCollectionRequestHandler
|
||||
|
||||
bool processGetArtists(const AudioCollectionRequest::GetArtistList& request, AudioCollectionResponse::ArtistList& response);
|
||||
bool processGetGenres(const AudioCollectionRequest::GetGenreList& request, AudioCollectionResponse::GenreList& response);
|
||||
bool processGetReleases(const AudioCollectionRequest::GetReleaseList& request, AudioCollectionResponse::ReleaseList& response);
|
||||
bool processGetTracks(const AudioCollectionRequest::GetTrackList& request, AudioCollectionResponse::TrackList& response);
|
||||
|
||||
DatabaseHandler& _db;
|
||||
|
||||
static const std::size_t _maxListArtists = 128;
|
||||
static const std::size_t _maxListGenres = 128;
|
||||
static const std::size_t _maxListReleases = 128;
|
||||
static const std::size_t _maxListTracks = 32;
|
||||
static const std::size_t _maxListArtists = 256;
|
||||
static const std::size_t _maxListGenres = 256;
|
||||
static const std::size_t _maxListReleases = 256;
|
||||
static const std::size_t _maxListTracks = 256;
|
||||
};
|
||||
|
||||
} // namespace Remote
|
||||
|
||||
@@ -75,8 +75,6 @@ Connection::handleReadHeader(const boost::system::error_code& error, std::size_t
|
||||
return;
|
||||
}
|
||||
|
||||
std::cout << "Header received. Size = " << header.getSize() << std::endl;
|
||||
|
||||
// Now read the real message
|
||||
boost::asio::streambuf::mutable_buffers_type bufs = _inputStreamBuf.prepare(header.getSize());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user