Adding scale cover art option

This commit is contained in:
emeric
2014-06-12 13:45:48 +02:00
parent 650945b5c4
commit eda92b8508
4 changed files with 123 additions and 46 deletions
+3 -1
View File
@@ -1,7 +1,7 @@
[Users] [Users]
- Do the feature - Do the feature
- Admin account to add/remove users, add path to watch for Audio/Video - Admin account to add/remove users, add path to watch for Audio/Video files
[Database] [Database]
- When removing a track, make sure to remove genre/artist/release if last of it - When removing a track, make sure to remove genre/artist/release if last of it
@@ -11,6 +11,8 @@
- Create a new type: "share", that handles every other types in a directory based share? - Create a new type: "share", that handles every other types in a directory based share?
- Group video in "video groups". Each video may has sub groups (current "Path" class) - Group video in "video groups". Each video may has sub groups (current "Path" class)
- Simplify database and remove the Path class - Simplify database and remove the Path class
- Use limits for strings?
- Filter non valid UTF-8 data in strings?
[Audio] [Audio]
- ReleaseView/ArtistView/GenreView: <All> -> Track count for this special category. Easier: add a special entry '<All>' that contains everything? - ReleaseView/ArtistView/GenreView: <All> -> Track count for this special category. Easier: add a special entry '<All>' that contains everything?
+85 -43
View File
@@ -190,10 +190,11 @@ void protobuf_AssignDesc_collection_2eproto() {
::google::protobuf::MessageFactory::generated_factory(), ::google::protobuf::MessageFactory::generated_factory(),
sizeof(AudioCollectionRequest_GetTrackList)); sizeof(AudioCollectionRequest_GetTrackList));
AudioCollectionRequest_GetCoverArt_descriptor_ = AudioCollectionRequest_descriptor_->nested_type(5); AudioCollectionRequest_GetCoverArt_descriptor_ = AudioCollectionRequest_descriptor_->nested_type(5);
static const int AudioCollectionRequest_GetCoverArt_offsets_[3] = { static const int AudioCollectionRequest_GetCoverArt_offsets_[4] = {
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionRequest_GetCoverArt, type_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionRequest_GetCoverArt, type_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionRequest_GetCoverArt, release_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionRequest_GetCoverArt, release_id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionRequest_GetCoverArt, track_id_), GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionRequest_GetCoverArt, track_id_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AudioCollectionRequest_GetCoverArt, size_),
}; };
AudioCollectionRequest_GetCoverArt_reflection_ = AudioCollectionRequest_GetCoverArt_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection( new ::google::protobuf::internal::GeneratedMessageReflection(
@@ -498,7 +499,7 @@ void protobuf_AddDesc_collection_2eproto() {
::Remote::protobuf_AddDesc_common_2eproto(); ::Remote::protobuf_AddDesc_common_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile( ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\020collection.proto\022\006Remote\032\014common.proto" "\n\020collection.proto\022\006Remote\032\014common.proto"
"\"\342\t\n\026AudioCollectionRequest\0221\n\004type\030\001 \002(" "\"\360\t\n\026AudioCollectionRequest\0221\n\004type\030\001 \002("
"\0162#.Remote.AudioCollectionRequest.Type\022\?" "\0162#.Remote.AudioCollectionRequest.Type\022\?"
"\n\nget_genres\030\002 \001(\0132+.Remote.AudioCollect" "\n\nget_genres\030\002 \001(\0132+.Remote.AudioCollect"
"ionRequest.GetGenreList\022A\n\013get_artists\030\003" "ionRequest.GetGenreList\022A\n\013get_artists\030\003"
@@ -521,49 +522,50 @@ void protobuf_AddDesc_collection_2eproto() {
"ist\022F\n\017batch_parameter\030\001 \002(\0132-.Remote.Au" "ist\022F\n\017batch_parameter\030\001 \002(\0132-.Remote.Au"
"dioCollectionRequest.BatchParameter\022\021\n\ta" "dioCollectionRequest.BatchParameter\022\021\n\ta"
"rtist_id\030\002 \003(\004\022\022\n\nrelease_id\030\003 \003(\004\022\020\n\010ge" "rtist_id\030\002 \003(\004\022\022\n\nrelease_id\030\003 \003(\004\022\020\n\010ge"
"nre_id\030\004 \003(\004\032\260\001\n\013GetCoverArt\022=\n\004type\030\001 \002" "nre_id\030\004 \003(\004\032\276\001\n\013GetCoverArt\022=\n\004type\030\001 \002"
"(\0162/.Remote.AudioCollectionRequest.GetCo" "(\0162/.Remote.AudioCollectionRequest.GetCo"
"verArt.Type\022\022\n\nrelease_id\030\002 \001(\004\022\020\n\010track" "verArt.Type\022\022\n\nrelease_id\030\002 \001(\004\022\020\n\010track"
"_id\030\003 \001(\004\"<\n\004Type\022\032\n\026TypeGetCoverArtRele" "_id\030\003 \001(\004\022\014\n\004size\030\004 \001(\r\"<\n\004Type\022\032\n\026TypeG"
"ase\020\001\022\030\n\024TypeGetCoverArtTrack\020\002\"\213\001\n\004Type" "etCoverArtRelease\020\001\022\030\n\024TypeGetCoverArtTr"
"\022\023\n\017TypeGetRevision\020\001\022\024\n\020TypeGetGenreLis" "ack\020\002\"\213\001\n\004Type\022\023\n\017TypeGetRevision\020\001\022\024\n\020T"
"t\020\002\022\025\n\021TypeGetArtistList\020\003\022\026\n\022TypeGetRel" "ypeGetGenreList\020\002\022\025\n\021TypeGetArtistList\020\003"
"easeList\020\004\022\024\n\020TypeGetTrackList\020\005\022\023\n\017Type" "\022\026\n\022TypeGetReleaseList\020\004\022\024\n\020TypeGetTrack"
"GetCoverArt\020\006\"\345\n\n\027AudioCollectionRespons" "List\020\005\022\023\n\017TypeGetCoverArt\020\006\"\345\n\n\027AudioCol"
"e\0222\n\004type\030\001 \001(\0162$.Remote.AudioCollection" "lectionResponse\0222\n\004type\030\001 \001(\0162$.Remote.A"
"Response.Type\022\034\n\005error\030\002 \001(\0132\r.Remote.Er" "udioCollectionResponse.Type\022\034\n\005error\030\002 \001"
"ror\022:\n\010revision\030\003 \001(\0132(.Remote.AudioColl" "(\0132\r.Remote.Error\022:\n\010revision\030\003 \001(\0132(.Re"
"ectionResponse.Revision\022=\n\ngenre_list\030\004 " "mote.AudioCollectionResponse.Revision\022=\n"
"\001(\0132).Remote.AudioCollectionResponse.Gen" "\ngenre_list\030\004 \001(\0132).Remote.AudioCollecti"
"reList\022\?\n\013artist_list\030\005 \001(\0132*.Remote.Aud" "onResponse.GenreList\022\?\n\013artist_list\030\005 \001("
"ioCollectionResponse.ArtistList\022A\n\014relea" "\0132*.Remote.AudioCollectionResponse.Artis"
"se_list\030\006 \001(\0132+.Remote.AudioCollectionRe" "tList\022A\n\014release_list\030\006 \001(\0132+.Remote.Aud"
"sponse.ReleaseList\022=\n\ntrack_list\030\007 \001(\0132)" "ioCollectionResponse.ReleaseList\022=\n\ntrac"
".Remote.AudioCollectionResponse.TrackLis" "k_list\030\007 \001(\0132).Remote.AudioCollectionRes"
"t\022;\n\tcover_art\030\010 \003(\0132(.Remote.AudioColle" "ponse.TrackList\022;\n\tcover_art\030\010 \003(\0132(.Rem"
"ctionResponse.CoverArt\032\027\n\010Revision\022\013\n\003re" "ote.AudioCollectionResponse.CoverArt\032\027\n\010"
"v\030\001 \002(\004\032B\n\tGenreList\0225\n\006genres\030\002 \003(\0132%.R" "Revision\022\013\n\003rev\030\001 \002(\004\032B\n\tGenreList\0225\n\006ge"
"emote.AudioCollectionResponse.Genre\032E\n\nA" "nres\030\002 \003(\0132%.Remote.AudioCollectionRespo"
"rtistList\0227\n\007artists\030\002 \003(\0132&.Remote.Audi" "nse.Genre\032E\n\nArtistList\0227\n\007artists\030\002 \003(\013"
"oCollectionResponse.Artist\032H\n\013ReleaseLis" "2&.Remote.AudioCollectionResponse.Artist"
"t\0229\n\010releases\030\002 \003(\0132\'.Remote.AudioCollec" "\032H\n\013ReleaseList\0229\n\010releases\030\002 \003(\0132\'.Remo"
"tionResponse.Release\032B\n\tTrackList\0225\n\006tra" "te.AudioCollectionResponse.Release\032B\n\tTr"
"cks\030\002 \003(\0132%.Remote.AudioCollectionRespon" "ackList\0225\n\006tracks\030\002 \003(\0132%.Remote.AudioCo"
"se.Track\032+\n\010CoverArt\022\021\n\tmime_type\030\001 \001(\t\022" "llectionResponse.Track\032+\n\010CoverArt\022\021\n\tmi"
"\014\n\004data\030\002 \002(\014\032!\n\005Genre\022\n\n\002id\030\001 \002(\004\022\014\n\004na" "me_type\030\001 \001(\t\022\014\n\004data\030\002 \002(\014\032!\n\005Genre\022\n\n\002"
"me\030\002 \002(\t\0327\n\006Artist\022\n\n\002id\030\001 \002(\004\022\014\n\004name\030\002" "id\030\001 \002(\004\022\014\n\004name\030\002 \002(\t\0327\n\006Artist\022\n\n\002id\030\001"
" \002(\t\022\023\n\013nb_releases\030\003 \002(\r\032c\n\007Release\022\n\n\002" " \002(\004\022\014\n\004name\030\002 \002(\t\022\023\n\013nb_releases\030\003 \002(\r\032"
"id\030\001 \002(\004\022\014\n\004name\030\002 \002(\t\022\021\n\tnb_tracks\030\003 \002(" "c\n\007Release\022\n\n\002id\030\001 \002(\004\022\014\n\004name\030\002 \002(\t\022\021\n\t"
"\r\022\025\n\rduration_secs\030\004 \002(\r\022\024\n\014release_date" "nb_tracks\030\003 \002(\r\022\025\n\rduration_secs\030\004 \002(\r\022\024"
"\030\005 \001(\t\032\321\001\n\005Track\022\n\n\002id\030\001 \002(\004\022\021\n\tartist_i" "\n\014release_date\030\005 \001(\t\032\321\001\n\005Track\022\n\n\002id\030\001 \002"
"d\030\002 \002(\004\022\022\n\nrelease_id\030\003 \002(\004\022\020\n\010genre_id\030" "(\004\022\021\n\tartist_id\030\002 \002(\004\022\022\n\nrelease_id\030\003 \002("
"\004 \003(\004\022\023\n\013disc_number\030\005 \001(\r\022\024\n\014track_numb" "\004\022\020\n\010genre_id\030\004 \003(\004\022\023\n\013disc_number\030\005 \001(\r"
"er\030\006 \001(\r\022\014\n\004name\030\007 \002(\t\022\025\n\rduration_secs\030" "\022\024\n\014track_number\030\006 \001(\r\022\014\n\004name\030\007 \002(\t\022\025\n\r"
"\010 \002(\r\022\024\n\014release_date\030\t \001(\t\022\035\n\025original_" "duration_secs\030\010 \002(\r\022\024\n\014release_date\030\t \001("
"release_date\030\n \001(\t\"\210\001\n\004Type\022\r\n\tTypeError" "\t\022\035\n\025original_release_date\030\n \001(\t\"\210\001\n\004Typ"
"\020\001\022\020\n\014TypeRevision\020\002\022\021\n\rTypeGenreList\020\003\022" "e\022\r\n\tTypeError\020\001\022\020\n\014TypeRevision\020\002\022\021\n\rTy"
"\022\n\016TypeArtistList\020\004\022\023\n\017TypeReleaseList\020\005" "peGenreList\020\003\022\022\n\016TypeArtistList\020\004\022\023\n\017Typ"
"\022\021\n\rTypeTrackList\020\006\022\020\n\014TypeCoverArt\020\007", 2677); "eReleaseList\020\005\022\021\n\rTypeTrackList\020\006\022\020\n\014Typ"
"eCoverArt\020\007", 2691);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile( ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"collection.proto", &protobuf_RegisterTypes); "collection.proto", &protobuf_RegisterTypes);
AudioCollectionRequest::default_instance_ = new AudioCollectionRequest(); AudioCollectionRequest::default_instance_ = new AudioCollectionRequest();
@@ -2073,6 +2075,7 @@ const int AudioCollectionRequest_GetCoverArt::Type_ARRAYSIZE;
const int AudioCollectionRequest_GetCoverArt::kTypeFieldNumber; const int AudioCollectionRequest_GetCoverArt::kTypeFieldNumber;
const int AudioCollectionRequest_GetCoverArt::kReleaseIdFieldNumber; const int AudioCollectionRequest_GetCoverArt::kReleaseIdFieldNumber;
const int AudioCollectionRequest_GetCoverArt::kTrackIdFieldNumber; const int AudioCollectionRequest_GetCoverArt::kTrackIdFieldNumber;
const int AudioCollectionRequest_GetCoverArt::kSizeFieldNumber;
#endif // !_MSC_VER #endif // !_MSC_VER
AudioCollectionRequest_GetCoverArt::AudioCollectionRequest_GetCoverArt() AudioCollectionRequest_GetCoverArt::AudioCollectionRequest_GetCoverArt()
@@ -2094,6 +2097,7 @@ void AudioCollectionRequest_GetCoverArt::SharedCtor() {
type_ = 1; type_ = 1;
release_id_ = GOOGLE_ULONGLONG(0); release_id_ = GOOGLE_ULONGLONG(0);
track_id_ = GOOGLE_ULONGLONG(0); track_id_ = GOOGLE_ULONGLONG(0);
size_ = 0u;
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
} }
@@ -2132,6 +2136,7 @@ void AudioCollectionRequest_GetCoverArt::Clear() {
type_ = 1; type_ = 1;
release_id_ = GOOGLE_ULONGLONG(0); release_id_ = GOOGLE_ULONGLONG(0);
track_id_ = GOOGLE_ULONGLONG(0); track_id_ = GOOGLE_ULONGLONG(0);
size_ = 0u;
} }
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear(); mutable_unknown_fields()->Clear();
@@ -2191,6 +2196,22 @@ bool AudioCollectionRequest_GetCoverArt::MergePartialFromCodedStream(
} else { } else {
goto handle_uninterpreted; goto handle_uninterpreted;
} }
if (input->ExpectTag(32)) goto parse_size;
break;
}
// optional uint32 size = 4;
case 4: {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) {
parse_size:
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
input, &size_)));
set_has_size();
} else {
goto handle_uninterpreted;
}
if (input->ExpectAtEnd()) return true; if (input->ExpectAtEnd()) return true;
break; break;
} }
@@ -2229,6 +2250,11 @@ void AudioCollectionRequest_GetCoverArt::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->track_id(), output); ::google::protobuf::internal::WireFormatLite::WriteUInt64(3, this->track_id(), output);
} }
// optional uint32 size = 4;
if (has_size()) {
::google::protobuf::internal::WireFormatLite::WriteUInt32(4, this->size(), output);
}
if (!unknown_fields().empty()) { if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields( ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output); unknown_fields(), output);
@@ -2253,6 +2279,11 @@ void AudioCollectionRequest_GetCoverArt::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->track_id(), target); target = ::google::protobuf::internal::WireFormatLite::WriteUInt64ToArray(3, this->track_id(), target);
} }
// optional uint32 size = 4;
if (has_size()) {
target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(4, this->size(), target);
}
if (!unknown_fields().empty()) { if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray( target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target); unknown_fields(), target);
@@ -2284,6 +2315,13 @@ int AudioCollectionRequest_GetCoverArt::ByteSize() const {
this->track_id()); this->track_id());
} }
// optional uint32 size = 4;
if (has_size()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::UInt32Size(
this->size());
}
} }
if (!unknown_fields().empty()) { if (!unknown_fields().empty()) {
total_size += total_size +=
@@ -2320,6 +2358,9 @@ void AudioCollectionRequest_GetCoverArt::MergeFrom(const AudioCollectionRequest_
if (from.has_track_id()) { if (from.has_track_id()) {
set_track_id(from.track_id()); set_track_id(from.track_id());
} }
if (from.has_size()) {
set_size(from.size());
}
} }
mutable_unknown_fields()->MergeFrom(from.unknown_fields()); mutable_unknown_fields()->MergeFrom(from.unknown_fields());
} }
@@ -2347,6 +2388,7 @@ void AudioCollectionRequest_GetCoverArt::Swap(AudioCollectionRequest_GetCoverArt
std::swap(type_, other->type_); std::swap(type_, other->type_);
std::swap(release_id_, other->release_id_); std::swap(release_id_, other->release_id_);
std::swap(track_id_, other->track_id_); std::swap(track_id_, other->track_id_);
std::swap(size_, other->size_);
std::swap(_has_bits_[0], other->_has_bits_[0]); std::swap(_has_bits_[0], other->_has_bits_[0]);
_unknown_fields_.Swap(&other->_unknown_fields_); _unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_); std::swap(_cached_size_, other->_cached_size_);
+34 -2
View File
@@ -727,6 +727,13 @@ class AudioCollectionRequest_GetCoverArt : public ::google::protobuf::Message {
inline ::google::protobuf::uint64 track_id() const; inline ::google::protobuf::uint64 track_id() const;
inline void set_track_id(::google::protobuf::uint64 value); inline void set_track_id(::google::protobuf::uint64 value);
// optional uint32 size = 4;
inline bool has_size() const;
inline void clear_size();
static const int kSizeFieldNumber = 4;
inline ::google::protobuf::uint32 size() const;
inline void set_size(::google::protobuf::uint32 value);
// @@protoc_insertion_point(class_scope:Remote.AudioCollectionRequest.GetCoverArt) // @@protoc_insertion_point(class_scope:Remote.AudioCollectionRequest.GetCoverArt)
private: private:
inline void set_has_type(); inline void set_has_type();
@@ -735,15 +742,18 @@ class AudioCollectionRequest_GetCoverArt : public ::google::protobuf::Message {
inline void clear_has_release_id(); inline void clear_has_release_id();
inline void set_has_track_id(); inline void set_has_track_id();
inline void clear_has_track_id(); inline void clear_has_track_id();
inline void set_has_size();
inline void clear_has_size();
::google::protobuf::UnknownFieldSet _unknown_fields_; ::google::protobuf::UnknownFieldSet _unknown_fields_;
::google::protobuf::uint64 release_id_; ::google::protobuf::uint64 release_id_;
::google::protobuf::uint64 track_id_;
int type_; int type_;
::google::protobuf::uint32 size_;
::google::protobuf::uint64 track_id_;
mutable int _cached_size_; mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; ::google::protobuf::uint32 _has_bits_[(4 + 31) / 32];
friend void protobuf_AddDesc_collection_2eproto(); friend void protobuf_AddDesc_collection_2eproto();
friend void protobuf_AssignDesc_collection_2eproto(); friend void protobuf_AssignDesc_collection_2eproto();
@@ -2626,6 +2636,28 @@ inline void AudioCollectionRequest_GetCoverArt::set_track_id(::google::protobuf:
track_id_ = value; track_id_ = value;
} }
// optional uint32 size = 4;
inline bool AudioCollectionRequest_GetCoverArt::has_size() const {
return (_has_bits_[0] & 0x00000008u) != 0;
}
inline void AudioCollectionRequest_GetCoverArt::set_has_size() {
_has_bits_[0] |= 0x00000008u;
}
inline void AudioCollectionRequest_GetCoverArt::clear_has_size() {
_has_bits_[0] &= ~0x00000008u;
}
inline void AudioCollectionRequest_GetCoverArt::clear_size() {
size_ = 0u;
clear_has_size();
}
inline ::google::protobuf::uint32 AudioCollectionRequest_GetCoverArt::size() const {
return size_;
}
inline void AudioCollectionRequest_GetCoverArt::set_size(::google::protobuf::uint32 value) {
set_has_size();
size_ = value;
}
// ------------------------------------------------------------------- // -------------------------------------------------------------------
// AudioCollectionRequest // AudioCollectionRequest
+1
View File
@@ -53,6 +53,7 @@ message AudioCollectionRequest
optional uint64 release_id = 2; // Release that owns the cover art optional uint64 release_id = 2; // Release that owns the cover art
optional uint64 track_id = 3; // Track that owns the cover art optional uint64 track_id = 3; // Track that owns the cover art
optional uint32 size = 4; // Scale image to this size
} }
enum Type enum Type