diff --git a/backend/generated/pb/media_set/media_set.pb.go b/backend/generated/pb/media_set/media_set.pb.go new file mode 100644 index 0000000..9d2c2f2 --- /dev/null +++ b/backend/generated/pb/media_set/media_set.pb.go @@ -0,0 +1,942 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1 +// protoc v3.17.3 +// source: media_set.proto + +package media_set + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + durationpb "google.golang.org/protobuf/types/known/durationpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type MediaSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + YoutubeId string `protobuf:"bytes,2,opt,name=youtube_id,json=youtubeId,proto3" json:"youtube_id,omitempty"` + AudioChannels int32 `protobuf:"varint,3,opt,name=audio_channels,json=audioChannels,proto3" json:"audio_channels,omitempty"` + AudioApproxFrames int64 `protobuf:"varint,4,opt,name=audio_approx_frames,json=audioApproxFrames,proto3" json:"audio_approx_frames,omitempty"` + AudioFrames int64 `protobuf:"varint,5,opt,name=audio_frames,json=audioFrames,proto3" json:"audio_frames,omitempty"` + AudioSampleRate int32 `protobuf:"varint,6,opt,name=audio_sample_rate,json=audioSampleRate,proto3" json:"audio_sample_rate,omitempty"` + AudioYoutubeItag int32 `protobuf:"varint,7,opt,name=audio_youtube_itag,json=audioYoutubeItag,proto3" json:"audio_youtube_itag,omitempty"` + AudioMimeType string `protobuf:"bytes,8,opt,name=audio_mime_type,json=audioMimeType,proto3" json:"audio_mime_type,omitempty"` + VideoDuration *durationpb.Duration `protobuf:"bytes,9,opt,name=video_duration,json=videoDuration,proto3" json:"video_duration,omitempty"` + VideoYoutubeItag int32 `protobuf:"varint,10,opt,name=video_youtube_itag,json=videoYoutubeItag,proto3" json:"video_youtube_itag,omitempty"` + VideoMimeType string `protobuf:"bytes,11,opt,name=video_mime_type,json=videoMimeType,proto3" json:"video_mime_type,omitempty"` +} + +func (x *MediaSet) Reset() { + *x = MediaSet{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MediaSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MediaSet) ProtoMessage() {} + +func (x *MediaSet) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MediaSet.ProtoReflect.Descriptor instead. +func (*MediaSet) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{0} +} + +func (x *MediaSet) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MediaSet) GetYoutubeId() string { + if x != nil { + return x.YoutubeId + } + return "" +} + +func (x *MediaSet) GetAudioChannels() int32 { + if x != nil { + return x.AudioChannels + } + return 0 +} + +func (x *MediaSet) GetAudioApproxFrames() int64 { + if x != nil { + return x.AudioApproxFrames + } + return 0 +} + +func (x *MediaSet) GetAudioFrames() int64 { + if x != nil { + return x.AudioFrames + } + return 0 +} + +func (x *MediaSet) GetAudioSampleRate() int32 { + if x != nil { + return x.AudioSampleRate + } + return 0 +} + +func (x *MediaSet) GetAudioYoutubeItag() int32 { + if x != nil { + return x.AudioYoutubeItag + } + return 0 +} + +func (x *MediaSet) GetAudioMimeType() string { + if x != nil { + return x.AudioMimeType + } + return "" +} + +func (x *MediaSet) GetVideoDuration() *durationpb.Duration { + if x != nil { + return x.VideoDuration + } + return nil +} + +func (x *MediaSet) GetVideoYoutubeItag() int32 { + if x != nil { + return x.VideoYoutubeItag + } + return 0 +} + +func (x *MediaSet) GetVideoMimeType() string { + if x != nil { + return x.VideoMimeType + } + return "" +} + +type GetAudioProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Peaks []int32 `protobuf:"varint,1,rep,packed,name=peaks,proto3" json:"peaks,omitempty"` + PercentComplete float32 `protobuf:"fixed32,2,opt,name=percent_complete,json=percentComplete,proto3" json:"percent_complete,omitempty"` + Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *GetAudioProgress) Reset() { + *x = GetAudioProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAudioProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAudioProgress) ProtoMessage() {} + +func (x *GetAudioProgress) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAudioProgress.ProtoReflect.Descriptor instead. +func (*GetAudioProgress) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{1} +} + +func (x *GetAudioProgress) GetPeaks() []int32 { + if x != nil { + return x.Peaks + } + return nil +} + +func (x *GetAudioProgress) GetPercentComplete() float32 { + if x != nil { + return x.PercentComplete + } + return 0 +} + +func (x *GetAudioProgress) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +type GetRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + YoutubeId string `protobuf:"bytes,1,opt,name=youtube_id,json=youtubeId,proto3" json:"youtube_id,omitempty"` +} + +func (x *GetRequest) Reset() { + *x = GetRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRequest) ProtoMessage() {} + +func (x *GetRequest) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRequest.ProtoReflect.Descriptor instead. +func (*GetRequest) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{2} +} + +func (x *GetRequest) GetYoutubeId() string { + if x != nil { + return x.YoutubeId + } + return "" +} + +type GetAudioRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + NumBins int32 `protobuf:"varint,2,opt,name=num_bins,json=numBins,proto3" json:"num_bins,omitempty"` +} + +func (x *GetAudioRequest) Reset() { + *x = GetAudioRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAudioRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAudioRequest) ProtoMessage() {} + +func (x *GetAudioRequest) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAudioRequest.ProtoReflect.Descriptor instead. +func (*GetAudioRequest) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{3} +} + +func (x *GetAudioRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetAudioRequest) GetNumBins() int32 { + if x != nil { + return x.NumBins + } + return 0 +} + +type GetAudioSegmentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + NumBins int32 `protobuf:"varint,2,opt,name=num_bins,json=numBins,proto3" json:"num_bins,omitempty"` + StartFrame int64 `protobuf:"varint,3,opt,name=start_frame,json=startFrame,proto3" json:"start_frame,omitempty"` + EndFrame int64 `protobuf:"varint,4,opt,name=end_frame,json=endFrame,proto3" json:"end_frame,omitempty"` +} + +func (x *GetAudioSegmentRequest) Reset() { + *x = GetAudioSegmentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAudioSegmentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAudioSegmentRequest) ProtoMessage() {} + +func (x *GetAudioSegmentRequest) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAudioSegmentRequest.ProtoReflect.Descriptor instead. +func (*GetAudioSegmentRequest) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{4} +} + +func (x *GetAudioSegmentRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GetAudioSegmentRequest) GetNumBins() int32 { + if x != nil { + return x.NumBins + } + return 0 +} + +func (x *GetAudioSegmentRequest) GetStartFrame() int64 { + if x != nil { + return x.StartFrame + } + return 0 +} + +func (x *GetAudioSegmentRequest) GetEndFrame() int64 { + if x != nil { + return x.EndFrame + } + return 0 +} + +type GetAudioSegmentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Peaks []int32 `protobuf:"varint,1,rep,packed,name=peaks,proto3" json:"peaks,omitempty"` +} + +func (x *GetAudioSegmentResponse) Reset() { + *x = GetAudioSegmentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetAudioSegmentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetAudioSegmentResponse) ProtoMessage() {} + +func (x *GetAudioSegmentResponse) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetAudioSegmentResponse.ProtoReflect.Descriptor instead. +func (*GetAudioSegmentResponse) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{5} +} + +func (x *GetAudioSegmentResponse) GetPeaks() []int32 { + if x != nil { + return x.Peaks + } + return nil +} + +type GetVideoRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetVideoRequest) Reset() { + *x = GetVideoRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVideoRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVideoRequest) ProtoMessage() {} + +func (x *GetVideoRequest) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetVideoRequest.ProtoReflect.Descriptor instead. +func (*GetVideoRequest) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{6} +} + +func (x *GetVideoRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetVideoProgress struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PercentComplete float32 `protobuf:"fixed32,1,opt,name=percent_complete,json=percentComplete,proto3" json:"percent_complete,omitempty"` + Url string `protobuf:"bytes,2,opt,name=url,proto3" json:"url,omitempty"` +} + +func (x *GetVideoProgress) Reset() { + *x = GetVideoProgress{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVideoProgress) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVideoProgress) ProtoMessage() {} + +func (x *GetVideoProgress) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetVideoProgress.ProtoReflect.Descriptor instead. +func (*GetVideoProgress) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{7} +} + +func (x *GetVideoProgress) GetPercentComplete() float32 { + if x != nil { + return x.PercentComplete + } + return 0 +} + +func (x *GetVideoProgress) GetUrl() string { + if x != nil { + return x.Url + } + return "" +} + +type GetVideoThumbnailRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *GetVideoThumbnailRequest) Reset() { + *x = GetVideoThumbnailRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVideoThumbnailRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVideoThumbnailRequest) ProtoMessage() {} + +func (x *GetVideoThumbnailRequest) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetVideoThumbnailRequest.ProtoReflect.Descriptor instead. +func (*GetVideoThumbnailRequest) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{8} +} + +func (x *GetVideoThumbnailRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type GetVideoThumbnailResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Image []byte `protobuf:"bytes,1,opt,name=image,proto3" json:"image,omitempty"` + Width int32 `protobuf:"varint,2,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` +} + +func (x *GetVideoThumbnailResponse) Reset() { + *x = GetVideoThumbnailResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_media_set_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetVideoThumbnailResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetVideoThumbnailResponse) ProtoMessage() {} + +func (x *GetVideoThumbnailResponse) ProtoReflect() protoreflect.Message { + mi := &file_media_set_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetVideoThumbnailResponse.ProtoReflect.Descriptor instead. +func (*GetVideoThumbnailResponse) Descriptor() ([]byte, []int) { + return file_media_set_proto_rawDescGZIP(), []int{9} +} + +func (x *GetVideoThumbnailResponse) GetImage() []byte { + if x != nil { + return x.Image + } + return nil +} + +func (x *GetVideoThumbnailResponse) GetWidth() int32 { + if x != nil { + return x.Width + } + return 0 +} + +func (x *GetVideoThumbnailResponse) GetHeight() int32 { + if x != nil { + return x.Height + } + return 0 +} + +var File_media_set_proto protoreflect.FileDescriptor + +var file_media_set_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x09, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x1a, 0x1e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcd, 0x03, 0x0a, + 0x08, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x79, 0x6f, 0x75, + 0x74, 0x75, 0x62, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x79, + 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x75, 0x64, 0x69, + 0x6f, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0d, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x12, + 0x2e, 0x0a, 0x13, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x5f, + 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x61, 0x75, + 0x64, 0x69, 0x6f, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x12, + 0x21, 0x0a, 0x0c, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x73, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x61, + 0x75, 0x64, 0x69, 0x6f, 0x53, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x2c, + 0x0a, 0x12, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x79, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x5f, + 0x69, 0x74, 0x61, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x61, 0x75, 0x64, 0x69, + 0x6f, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x49, 0x74, 0x61, 0x67, 0x12, 0x26, 0x0a, 0x0f, + 0x61, 0x75, 0x64, 0x69, 0x6f, 0x5f, 0x6d, 0x69, 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x4d, 0x69, 0x6d, 0x65, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, 0x0e, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x64, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0d, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x44, 0x75, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, + 0x79, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x5f, 0x69, 0x74, 0x61, 0x67, 0x18, 0x0a, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x10, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x59, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, + 0x49, 0x74, 0x61, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x6d, 0x69, + 0x6d, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x76, + 0x69, 0x64, 0x65, 0x6f, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x22, 0x65, 0x0a, 0x10, + 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x65, 0x61, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x05, 0x70, 0x65, 0x61, 0x6b, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, + 0x52, 0x0f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, + 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x75, 0x72, 0x6c, 0x22, 0x2b, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x79, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x79, 0x6f, 0x75, 0x74, 0x75, 0x62, 0x65, 0x49, 0x64, + 0x22, 0x3c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x75, 0x6d, 0x5f, 0x62, 0x69, 0x6e, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6e, 0x75, 0x6d, 0x42, 0x69, 0x6e, 0x73, 0x22, 0x81, + 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53, 0x65, 0x67, 0x6d, 0x65, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6e, 0x75, 0x6d, + 0x5f, 0x62, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6e, 0x75, 0x6d, + 0x42, 0x69, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x66, 0x72, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x5f, 0x66, 0x72, 0x61, + 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x46, 0x72, 0x61, + 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, + 0x05, 0x70, 0x65, 0x61, 0x6b, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x52, 0x05, 0x70, 0x65, + 0x61, 0x6b, 0x73, 0x22, 0x21, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x4f, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x56, 0x69, 0x64, + 0x65, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x65, + 0x72, 0x63, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x70, 0x65, 0x72, 0x63, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6d, + 0x70, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x2a, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x56, 0x69, + 0x64, 0x65, 0x6f, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x02, 0x69, 0x64, 0x22, 0x5f, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, + 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, + 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, + 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x32, 0x96, 0x03, 0x0a, 0x0f, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x65, + 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x33, 0x0a, 0x03, 0x47, 0x65, 0x74, 0x12, + 0x15, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, + 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x65, 0x74, 0x22, 0x00, 0x12, 0x47, 0x0a, + 0x08, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x12, 0x1a, 0x2e, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, + 0x73, 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, 0x5a, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, + 0x69, 0x6f, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x21, 0x2e, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x53, 0x65, + 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x75, 0x64, 0x69, + 0x6f, 0x53, 0x65, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x47, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x12, 0x1a, + 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x69, + 0x64, 0x65, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6d, 0x65, 0x64, + 0x69, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x50, + 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x00, 0x30, 0x01, 0x12, 0x60, 0x0a, 0x11, 0x47, + 0x65, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, + 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x47, 0x65, 0x74, + 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, 0x61, 0x69, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, + 0x74, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x68, 0x75, 0x6d, 0x62, 0x6e, + 0x61, 0x69, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x0e, 0x5a, + 0x0c, 0x70, 0x62, 0x2f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x5f, 0x73, 0x65, 0x74, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_media_set_proto_rawDescOnce sync.Once + file_media_set_proto_rawDescData = file_media_set_proto_rawDesc +) + +func file_media_set_proto_rawDescGZIP() []byte { + file_media_set_proto_rawDescOnce.Do(func() { + file_media_set_proto_rawDescData = protoimpl.X.CompressGZIP(file_media_set_proto_rawDescData) + }) + return file_media_set_proto_rawDescData +} + +var file_media_set_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_media_set_proto_goTypes = []interface{}{ + (*MediaSet)(nil), // 0: media_set.MediaSet + (*GetAudioProgress)(nil), // 1: media_set.GetAudioProgress + (*GetRequest)(nil), // 2: media_set.GetRequest + (*GetAudioRequest)(nil), // 3: media_set.GetAudioRequest + (*GetAudioSegmentRequest)(nil), // 4: media_set.GetAudioSegmentRequest + (*GetAudioSegmentResponse)(nil), // 5: media_set.GetAudioSegmentResponse + (*GetVideoRequest)(nil), // 6: media_set.GetVideoRequest + (*GetVideoProgress)(nil), // 7: media_set.GetVideoProgress + (*GetVideoThumbnailRequest)(nil), // 8: media_set.GetVideoThumbnailRequest + (*GetVideoThumbnailResponse)(nil), // 9: media_set.GetVideoThumbnailResponse + (*durationpb.Duration)(nil), // 10: google.protobuf.Duration +} +var file_media_set_proto_depIdxs = []int32{ + 10, // 0: media_set.MediaSet.video_duration:type_name -> google.protobuf.Duration + 2, // 1: media_set.MediaSetService.Get:input_type -> media_set.GetRequest + 3, // 2: media_set.MediaSetService.GetAudio:input_type -> media_set.GetAudioRequest + 4, // 3: media_set.MediaSetService.GetAudioSegment:input_type -> media_set.GetAudioSegmentRequest + 6, // 4: media_set.MediaSetService.GetVideo:input_type -> media_set.GetVideoRequest + 8, // 5: media_set.MediaSetService.GetVideoThumbnail:input_type -> media_set.GetVideoThumbnailRequest + 0, // 6: media_set.MediaSetService.Get:output_type -> media_set.MediaSet + 1, // 7: media_set.MediaSetService.GetAudio:output_type -> media_set.GetAudioProgress + 5, // 8: media_set.MediaSetService.GetAudioSegment:output_type -> media_set.GetAudioSegmentResponse + 7, // 9: media_set.MediaSetService.GetVideo:output_type -> media_set.GetVideoProgress + 9, // 10: media_set.MediaSetService.GetVideoThumbnail:output_type -> media_set.GetVideoThumbnailResponse + 6, // [6:11] is the sub-list for method output_type + 1, // [1:6] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_media_set_proto_init() } +func file_media_set_proto_init() { + if File_media_set_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_media_set_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MediaSet); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAudioProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAudioRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAudioSegmentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetAudioSegmentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVideoRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVideoProgress); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVideoThumbnailRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_set_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetVideoThumbnailResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_media_set_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_media_set_proto_goTypes, + DependencyIndexes: file_media_set_proto_depIdxs, + MessageInfos: file_media_set_proto_msgTypes, + }.Build() + File_media_set_proto = out.File + file_media_set_proto_rawDesc = nil + file_media_set_proto_goTypes = nil + file_media_set_proto_depIdxs = nil +} diff --git a/backend/generated/pb/media_set/media_set_grpc.pb.go b/backend/generated/pb/media_set/media_set_grpc.pb.go new file mode 100644 index 0000000..5219428 --- /dev/null +++ b/backend/generated/pb/media_set/media_set_grpc.pb.go @@ -0,0 +1,300 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. + +package media_set + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// MediaSetServiceClient is the client API for MediaSetService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MediaSetServiceClient interface { + Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*MediaSet, error) + GetAudio(ctx context.Context, in *GetAudioRequest, opts ...grpc.CallOption) (MediaSetService_GetAudioClient, error) + GetAudioSegment(ctx context.Context, in *GetAudioSegmentRequest, opts ...grpc.CallOption) (*GetAudioSegmentResponse, error) + GetVideo(ctx context.Context, in *GetVideoRequest, opts ...grpc.CallOption) (MediaSetService_GetVideoClient, error) + GetVideoThumbnail(ctx context.Context, in *GetVideoThumbnailRequest, opts ...grpc.CallOption) (*GetVideoThumbnailResponse, error) +} + +type mediaSetServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMediaSetServiceClient(cc grpc.ClientConnInterface) MediaSetServiceClient { + return &mediaSetServiceClient{cc} +} + +func (c *mediaSetServiceClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*MediaSet, error) { + out := new(MediaSet) + err := c.cc.Invoke(ctx, "/media_set.MediaSetService/Get", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mediaSetServiceClient) GetAudio(ctx context.Context, in *GetAudioRequest, opts ...grpc.CallOption) (MediaSetService_GetAudioClient, error) { + stream, err := c.cc.NewStream(ctx, &MediaSetService_ServiceDesc.Streams[0], "/media_set.MediaSetService/GetAudio", opts...) + if err != nil { + return nil, err + } + x := &mediaSetServiceGetAudioClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MediaSetService_GetAudioClient interface { + Recv() (*GetAudioProgress, error) + grpc.ClientStream +} + +type mediaSetServiceGetAudioClient struct { + grpc.ClientStream +} + +func (x *mediaSetServiceGetAudioClient) Recv() (*GetAudioProgress, error) { + m := new(GetAudioProgress) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *mediaSetServiceClient) GetAudioSegment(ctx context.Context, in *GetAudioSegmentRequest, opts ...grpc.CallOption) (*GetAudioSegmentResponse, error) { + out := new(GetAudioSegmentResponse) + err := c.cc.Invoke(ctx, "/media_set.MediaSetService/GetAudioSegment", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *mediaSetServiceClient) GetVideo(ctx context.Context, in *GetVideoRequest, opts ...grpc.CallOption) (MediaSetService_GetVideoClient, error) { + stream, err := c.cc.NewStream(ctx, &MediaSetService_ServiceDesc.Streams[1], "/media_set.MediaSetService/GetVideo", opts...) + if err != nil { + return nil, err + } + x := &mediaSetServiceGetVideoClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type MediaSetService_GetVideoClient interface { + Recv() (*GetVideoProgress, error) + grpc.ClientStream +} + +type mediaSetServiceGetVideoClient struct { + grpc.ClientStream +} + +func (x *mediaSetServiceGetVideoClient) Recv() (*GetVideoProgress, error) { + m := new(GetVideoProgress) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *mediaSetServiceClient) GetVideoThumbnail(ctx context.Context, in *GetVideoThumbnailRequest, opts ...grpc.CallOption) (*GetVideoThumbnailResponse, error) { + out := new(GetVideoThumbnailResponse) + err := c.cc.Invoke(ctx, "/media_set.MediaSetService/GetVideoThumbnail", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MediaSetServiceServer is the server API for MediaSetService service. +// All implementations must embed UnimplementedMediaSetServiceServer +// for forward compatibility +type MediaSetServiceServer interface { + Get(context.Context, *GetRequest) (*MediaSet, error) + GetAudio(*GetAudioRequest, MediaSetService_GetAudioServer) error + GetAudioSegment(context.Context, *GetAudioSegmentRequest) (*GetAudioSegmentResponse, error) + GetVideo(*GetVideoRequest, MediaSetService_GetVideoServer) error + GetVideoThumbnail(context.Context, *GetVideoThumbnailRequest) (*GetVideoThumbnailResponse, error) + mustEmbedUnimplementedMediaSetServiceServer() +} + +// UnimplementedMediaSetServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMediaSetServiceServer struct { +} + +func (UnimplementedMediaSetServiceServer) Get(context.Context, *GetRequest) (*MediaSet, error) { + return nil, status.Errorf(codes.Unimplemented, "method Get not implemented") +} +func (UnimplementedMediaSetServiceServer) GetAudio(*GetAudioRequest, MediaSetService_GetAudioServer) error { + return status.Errorf(codes.Unimplemented, "method GetAudio not implemented") +} +func (UnimplementedMediaSetServiceServer) GetAudioSegment(context.Context, *GetAudioSegmentRequest) (*GetAudioSegmentResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAudioSegment not implemented") +} +func (UnimplementedMediaSetServiceServer) GetVideo(*GetVideoRequest, MediaSetService_GetVideoServer) error { + return status.Errorf(codes.Unimplemented, "method GetVideo not implemented") +} +func (UnimplementedMediaSetServiceServer) GetVideoThumbnail(context.Context, *GetVideoThumbnailRequest) (*GetVideoThumbnailResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetVideoThumbnail not implemented") +} +func (UnimplementedMediaSetServiceServer) mustEmbedUnimplementedMediaSetServiceServer() {} + +// UnsafeMediaSetServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MediaSetServiceServer will +// result in compilation errors. +type UnsafeMediaSetServiceServer interface { + mustEmbedUnimplementedMediaSetServiceServer() +} + +func RegisterMediaSetServiceServer(s grpc.ServiceRegistrar, srv MediaSetServiceServer) { + s.RegisterService(&MediaSetService_ServiceDesc, srv) +} + +func _MediaSetService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MediaSetServiceServer).Get(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/media_set.MediaSetService/Get", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MediaSetServiceServer).Get(ctx, req.(*GetRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MediaSetService_GetAudio_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetAudioRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MediaSetServiceServer).GetAudio(m, &mediaSetServiceGetAudioServer{stream}) +} + +type MediaSetService_GetAudioServer interface { + Send(*GetAudioProgress) error + grpc.ServerStream +} + +type mediaSetServiceGetAudioServer struct { + grpc.ServerStream +} + +func (x *mediaSetServiceGetAudioServer) Send(m *GetAudioProgress) error { + return x.ServerStream.SendMsg(m) +} + +func _MediaSetService_GetAudioSegment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetAudioSegmentRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MediaSetServiceServer).GetAudioSegment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/media_set.MediaSetService/GetAudioSegment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MediaSetServiceServer).GetAudioSegment(ctx, req.(*GetAudioSegmentRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _MediaSetService_GetVideo_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetVideoRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(MediaSetServiceServer).GetVideo(m, &mediaSetServiceGetVideoServer{stream}) +} + +type MediaSetService_GetVideoServer interface { + Send(*GetVideoProgress) error + grpc.ServerStream +} + +type mediaSetServiceGetVideoServer struct { + grpc.ServerStream +} + +func (x *mediaSetServiceGetVideoServer) Send(m *GetVideoProgress) error { + return x.ServerStream.SendMsg(m) +} + +func _MediaSetService_GetVideoThumbnail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetVideoThumbnailRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MediaSetServiceServer).GetVideoThumbnail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/media_set.MediaSetService/GetVideoThumbnail", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MediaSetServiceServer).GetVideoThumbnail(ctx, req.(*GetVideoThumbnailRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MediaSetService_ServiceDesc is the grpc.ServiceDesc for MediaSetService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MediaSetService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "media_set.MediaSetService", + HandlerType: (*MediaSetServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Get", + Handler: _MediaSetService_Get_Handler, + }, + { + MethodName: "GetAudioSegment", + Handler: _MediaSetService_GetAudioSegment_Handler, + }, + { + MethodName: "GetVideoThumbnail", + Handler: _MediaSetService_GetVideoThumbnail_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "GetAudio", + Handler: _MediaSetService_GetAudio_Handler, + ServerStreams: true, + }, + { + StreamName: "GetVideo", + Handler: _MediaSetService_GetVideo_Handler, + ServerStreams: true, + }, + }, + Metadata: "media_set.proto", +} diff --git a/backend/generated/store/db.go b/backend/generated/store/db.go new file mode 100644 index 0000000..d0cb68d --- /dev/null +++ b/backend/generated/store/db.go @@ -0,0 +1,30 @@ +// Code generated by sqlc. DO NOT EDIT. + +package store + +import ( + "context" + + "github.com/jackc/pgconn" + "github.com/jackc/pgx/v4" +) + +type DBTX interface { + Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error) + Query(context.Context, string, ...interface{}) (pgx.Rows, error) + QueryRow(context.Context, string, ...interface{}) pgx.Row +} + +func New(db DBTX) *Queries { + return &Queries{db: db} +} + +type Queries struct { + db DBTX +} + +func (q *Queries) WithTx(tx pgx.Tx) *Queries { + return &Queries{ + db: tx, + } +} diff --git a/backend/generated/store/models.go b/backend/generated/store/models.go new file mode 100644 index 0000000..3b00e42 --- /dev/null +++ b/backend/generated/store/models.go @@ -0,0 +1,43 @@ +// Code generated by sqlc. DO NOT EDIT. + +package store + +import ( + "database/sql" + "time" + + "github.com/google/uuid" +) + +type MediaSet struct { + ID uuid.UUID + YoutubeID string + AudioYoutubeItag int32 + AudioChannels int32 + AudioFramesApprox int64 + AudioFrames sql.NullInt64 + AudioSampleRate int32 + AudioRawS3Bucket sql.NullString + AudioRawS3Key sql.NullString + AudioRawS3UploadedAt sql.NullTime + AudioEncodedMimeType string + VideoYoutubeItag int32 + VideoS3Bucket sql.NullString + VideoS3Key sql.NullString + VideoS3UploadedAt sql.NullTime + VideoMimeType string + VideoDurationNanos int64 + VideoThumbnailS3Bucket sql.NullString + VideoThumbnailS3Key sql.NullString + VideoThumbnailS3UploadedAt sql.NullTime + VideoThumbnailMimeType sql.NullString + VideoThumbnailWidth sql.NullInt32 + VideoThumbnailHeight sql.NullInt32 + CreatedAt time.Time + UpdatedAt time.Time + AudioContentLength int64 + VideoContentLength int64 + AudioEncodedS3Bucket sql.NullString + AudioEncodedS3Key sql.NullString + AudioEncodedS3UploadedAt sql.NullTime +} diff --git a/backend/generated/store/queries.sql.go b/backend/generated/store/queries.sql.go new file mode 100644 index 0000000..ea3729a --- /dev/null +++ b/backend/generated/store/queries.sql.go @@ -0,0 +1,385 @@ +// Code generated by sqlc. DO NOT EDIT. +// source: queries.sql + +package store + +import ( + "context" + "database/sql" + + "github.com/google/uuid" +) + +const createMediaSet = `-- name: CreateMediaSet :one +INSERT INTO media_sets (youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_sample_rate, audio_content_length, audio_encoded_mime_type, video_youtube_itag, video_content_length, video_mime_type, video_duration_nanos, created_at, updated_at) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, NOW(), NOW()) + RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at +` + +type CreateMediaSetParams struct { + YoutubeID string + AudioYoutubeItag int32 + AudioChannels int32 + AudioFramesApprox int64 + AudioSampleRate int32 + AudioContentLength int64 + AudioEncodedMimeType string + VideoYoutubeItag int32 + VideoContentLength int64 + VideoMimeType string + VideoDurationNanos int64 +} + +func (q *Queries) CreateMediaSet(ctx context.Context, arg CreateMediaSetParams) (MediaSet, error) { + row := q.db.QueryRow(ctx, createMediaSet, + arg.YoutubeID, + arg.AudioYoutubeItag, + arg.AudioChannels, + arg.AudioFramesApprox, + arg.AudioSampleRate, + arg.AudioContentLength, + arg.AudioEncodedMimeType, + arg.VideoYoutubeItag, + arg.VideoContentLength, + arg.VideoMimeType, + arg.VideoDurationNanos, + ) + var i MediaSet + err := row.Scan( + &i.ID, + &i.YoutubeID, + &i.AudioYoutubeItag, + &i.AudioChannels, + &i.AudioFramesApprox, + &i.AudioFrames, + &i.AudioSampleRate, + &i.AudioRawS3Bucket, + &i.AudioRawS3Key, + &i.AudioRawS3UploadedAt, + &i.AudioEncodedMimeType, + &i.VideoYoutubeItag, + &i.VideoS3Bucket, + &i.VideoS3Key, + &i.VideoS3UploadedAt, + &i.VideoMimeType, + &i.VideoDurationNanos, + &i.VideoThumbnailS3Bucket, + &i.VideoThumbnailS3Key, + &i.VideoThumbnailS3UploadedAt, + &i.VideoThumbnailMimeType, + &i.VideoThumbnailWidth, + &i.VideoThumbnailHeight, + &i.CreatedAt, + &i.UpdatedAt, + &i.AudioContentLength, + &i.VideoContentLength, + &i.AudioEncodedS3Bucket, + &i.AudioEncodedS3Key, + &i.AudioEncodedS3UploadedAt, + ) + return i, err +} + +const getMediaSet = `-- name: GetMediaSet :one +SELECT id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at FROM media_sets WHERE id = $1 +` + +func (q *Queries) GetMediaSet(ctx context.Context, id uuid.UUID) (MediaSet, error) { + row := q.db.QueryRow(ctx, getMediaSet, id) + var i MediaSet + err := row.Scan( + &i.ID, + &i.YoutubeID, + &i.AudioYoutubeItag, + &i.AudioChannels, + &i.AudioFramesApprox, + &i.AudioFrames, + &i.AudioSampleRate, + &i.AudioRawS3Bucket, + &i.AudioRawS3Key, + &i.AudioRawS3UploadedAt, + &i.AudioEncodedMimeType, + &i.VideoYoutubeItag, + &i.VideoS3Bucket, + &i.VideoS3Key, + &i.VideoS3UploadedAt, + &i.VideoMimeType, + &i.VideoDurationNanos, + &i.VideoThumbnailS3Bucket, + &i.VideoThumbnailS3Key, + &i.VideoThumbnailS3UploadedAt, + &i.VideoThumbnailMimeType, + &i.VideoThumbnailWidth, + &i.VideoThumbnailHeight, + &i.CreatedAt, + &i.UpdatedAt, + &i.AudioContentLength, + &i.VideoContentLength, + &i.AudioEncodedS3Bucket, + &i.AudioEncodedS3Key, + &i.AudioEncodedS3UploadedAt, + ) + return i, err +} + +const getMediaSetByYoutubeID = `-- name: GetMediaSetByYoutubeID :one +SELECT id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at FROM media_sets WHERE youtube_id = $1 +` + +func (q *Queries) GetMediaSetByYoutubeID(ctx context.Context, youtubeID string) (MediaSet, error) { + row := q.db.QueryRow(ctx, getMediaSetByYoutubeID, youtubeID) + var i MediaSet + err := row.Scan( + &i.ID, + &i.YoutubeID, + &i.AudioYoutubeItag, + &i.AudioChannels, + &i.AudioFramesApprox, + &i.AudioFrames, + &i.AudioSampleRate, + &i.AudioRawS3Bucket, + &i.AudioRawS3Key, + &i.AudioRawS3UploadedAt, + &i.AudioEncodedMimeType, + &i.VideoYoutubeItag, + &i.VideoS3Bucket, + &i.VideoS3Key, + &i.VideoS3UploadedAt, + &i.VideoMimeType, + &i.VideoDurationNanos, + &i.VideoThumbnailS3Bucket, + &i.VideoThumbnailS3Key, + &i.VideoThumbnailS3UploadedAt, + &i.VideoThumbnailMimeType, + &i.VideoThumbnailWidth, + &i.VideoThumbnailHeight, + &i.CreatedAt, + &i.UpdatedAt, + &i.AudioContentLength, + &i.VideoContentLength, + &i.AudioEncodedS3Bucket, + &i.AudioEncodedS3Key, + &i.AudioEncodedS3UploadedAt, + ) + return i, err +} + +const setEncodedAudioUploaded = `-- name: SetEncodedAudioUploaded :one +UPDATE media_sets + SET audio_encoded_s3_bucket = $2, audio_encoded_s3_key = $3, audio_encoded_s3_uploaded_at = NOW(), updated_at = NOW() + WHERE id = $1 + RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at +` + +type SetEncodedAudioUploadedParams struct { + ID uuid.UUID + AudioEncodedS3Bucket sql.NullString + AudioEncodedS3Key sql.NullString +} + +func (q *Queries) SetEncodedAudioUploaded(ctx context.Context, arg SetEncodedAudioUploadedParams) (MediaSet, error) { + row := q.db.QueryRow(ctx, setEncodedAudioUploaded, arg.ID, arg.AudioEncodedS3Bucket, arg.AudioEncodedS3Key) + var i MediaSet + err := row.Scan( + &i.ID, + &i.YoutubeID, + &i.AudioYoutubeItag, + &i.AudioChannels, + &i.AudioFramesApprox, + &i.AudioFrames, + &i.AudioSampleRate, + &i.AudioRawS3Bucket, + &i.AudioRawS3Key, + &i.AudioRawS3UploadedAt, + &i.AudioEncodedMimeType, + &i.VideoYoutubeItag, + &i.VideoS3Bucket, + &i.VideoS3Key, + &i.VideoS3UploadedAt, + &i.VideoMimeType, + &i.VideoDurationNanos, + &i.VideoThumbnailS3Bucket, + &i.VideoThumbnailS3Key, + &i.VideoThumbnailS3UploadedAt, + &i.VideoThumbnailMimeType, + &i.VideoThumbnailWidth, + &i.VideoThumbnailHeight, + &i.CreatedAt, + &i.UpdatedAt, + &i.AudioContentLength, + &i.VideoContentLength, + &i.AudioEncodedS3Bucket, + &i.AudioEncodedS3Key, + &i.AudioEncodedS3UploadedAt, + ) + return i, err +} + +const setRawAudioUploaded = `-- name: SetRawAudioUploaded :one +UPDATE media_sets + SET audio_raw_s3_bucket = $2, audio_raw_s3_key = $3, audio_frames = $4, audio_raw_s3_uploaded_at = NOW(), updated_at = NOW() + WHERE id = $1 + RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at +` + +type SetRawAudioUploadedParams struct { + ID uuid.UUID + AudioRawS3Bucket sql.NullString + AudioRawS3Key sql.NullString + AudioFrames sql.NullInt64 +} + +func (q *Queries) SetRawAudioUploaded(ctx context.Context, arg SetRawAudioUploadedParams) (MediaSet, error) { + row := q.db.QueryRow(ctx, setRawAudioUploaded, + arg.ID, + arg.AudioRawS3Bucket, + arg.AudioRawS3Key, + arg.AudioFrames, + ) + var i MediaSet + err := row.Scan( + &i.ID, + &i.YoutubeID, + &i.AudioYoutubeItag, + &i.AudioChannels, + &i.AudioFramesApprox, + &i.AudioFrames, + &i.AudioSampleRate, + &i.AudioRawS3Bucket, + &i.AudioRawS3Key, + &i.AudioRawS3UploadedAt, + &i.AudioEncodedMimeType, + &i.VideoYoutubeItag, + &i.VideoS3Bucket, + &i.VideoS3Key, + &i.VideoS3UploadedAt, + &i.VideoMimeType, + &i.VideoDurationNanos, + &i.VideoThumbnailS3Bucket, + &i.VideoThumbnailS3Key, + &i.VideoThumbnailS3UploadedAt, + &i.VideoThumbnailMimeType, + &i.VideoThumbnailWidth, + &i.VideoThumbnailHeight, + &i.CreatedAt, + &i.UpdatedAt, + &i.AudioContentLength, + &i.VideoContentLength, + &i.AudioEncodedS3Bucket, + &i.AudioEncodedS3Key, + &i.AudioEncodedS3UploadedAt, + ) + return i, err +} + +const setVideoThumbnailUploaded = `-- name: SetVideoThumbnailUploaded :one +UPDATE media_sets +SET video_thumbnail_width = $2, video_thumbnail_height = $3, video_thumbnail_mime_type = $4, video_thumbnail_s3_bucket = $5, video_thumbnail_s3_key = $6, video_thumbnail_s3_uploaded_at = NOW(), updated_at = NOW() +WHERE id = $1 +RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at +` + +type SetVideoThumbnailUploadedParams struct { + ID uuid.UUID + VideoThumbnailWidth sql.NullInt32 + VideoThumbnailHeight sql.NullInt32 + VideoThumbnailMimeType sql.NullString + VideoThumbnailS3Bucket sql.NullString + VideoThumbnailS3Key sql.NullString +} + +func (q *Queries) SetVideoThumbnailUploaded(ctx context.Context, arg SetVideoThumbnailUploadedParams) (MediaSet, error) { + row := q.db.QueryRow(ctx, setVideoThumbnailUploaded, + arg.ID, + arg.VideoThumbnailWidth, + arg.VideoThumbnailHeight, + arg.VideoThumbnailMimeType, + arg.VideoThumbnailS3Bucket, + arg.VideoThumbnailS3Key, + ) + var i MediaSet + err := row.Scan( + &i.ID, + &i.YoutubeID, + &i.AudioYoutubeItag, + &i.AudioChannels, + &i.AudioFramesApprox, + &i.AudioFrames, + &i.AudioSampleRate, + &i.AudioRawS3Bucket, + &i.AudioRawS3Key, + &i.AudioRawS3UploadedAt, + &i.AudioEncodedMimeType, + &i.VideoYoutubeItag, + &i.VideoS3Bucket, + &i.VideoS3Key, + &i.VideoS3UploadedAt, + &i.VideoMimeType, + &i.VideoDurationNanos, + &i.VideoThumbnailS3Bucket, + &i.VideoThumbnailS3Key, + &i.VideoThumbnailS3UploadedAt, + &i.VideoThumbnailMimeType, + &i.VideoThumbnailWidth, + &i.VideoThumbnailHeight, + &i.CreatedAt, + &i.UpdatedAt, + &i.AudioContentLength, + &i.VideoContentLength, + &i.AudioEncodedS3Bucket, + &i.AudioEncodedS3Key, + &i.AudioEncodedS3UploadedAt, + ) + return i, err +} + +const setVideoUploaded = `-- name: SetVideoUploaded :one +UPDATE media_sets + SET video_s3_bucket = $2, video_s3_key = $3, video_s3_uploaded_at = NOW(), updated_at = NOW() + WHERE id = $1 + RETURNING id, youtube_id, audio_youtube_itag, audio_channels, audio_frames_approx, audio_frames, audio_sample_rate, audio_raw_s3_bucket, audio_raw_s3_key, audio_raw_s3_uploaded_at, audio_encoded_mime_type, video_youtube_itag, video_s3_bucket, video_s3_key, video_s3_uploaded_at, video_mime_type, video_duration_nanos, video_thumbnail_s3_bucket, video_thumbnail_s3_key, video_thumbnail_s3_uploaded_at, video_thumbnail_mime_type, video_thumbnail_width, video_thumbnail_height, created_at, updated_at, audio_content_length, video_content_length, audio_encoded_s3_bucket, audio_encoded_s3_key, audio_encoded_s3_uploaded_at +` + +type SetVideoUploadedParams struct { + ID uuid.UUID + VideoS3Bucket sql.NullString + VideoS3Key sql.NullString +} + +func (q *Queries) SetVideoUploaded(ctx context.Context, arg SetVideoUploadedParams) (MediaSet, error) { + row := q.db.QueryRow(ctx, setVideoUploaded, arg.ID, arg.VideoS3Bucket, arg.VideoS3Key) + var i MediaSet + err := row.Scan( + &i.ID, + &i.YoutubeID, + &i.AudioYoutubeItag, + &i.AudioChannels, + &i.AudioFramesApprox, + &i.AudioFrames, + &i.AudioSampleRate, + &i.AudioRawS3Bucket, + &i.AudioRawS3Key, + &i.AudioRawS3UploadedAt, + &i.AudioEncodedMimeType, + &i.VideoYoutubeItag, + &i.VideoS3Bucket, + &i.VideoS3Key, + &i.VideoS3UploadedAt, + &i.VideoMimeType, + &i.VideoDurationNanos, + &i.VideoThumbnailS3Bucket, + &i.VideoThumbnailS3Key, + &i.VideoThumbnailS3UploadedAt, + &i.VideoThumbnailMimeType, + &i.VideoThumbnailWidth, + &i.VideoThumbnailHeight, + &i.CreatedAt, + &i.UpdatedAt, + &i.AudioContentLength, + &i.VideoContentLength, + &i.AudioEncodedS3Bucket, + &i.AudioEncodedS3Key, + &i.AudioEncodedS3UploadedAt, + ) + return i, err +} diff --git a/frontend/src/generated/google/protobuf/duration.ts b/frontend/src/generated/google/protobuf/duration.ts new file mode 100644 index 0000000..31d0723 --- /dev/null +++ b/frontend/src/generated/google/protobuf/duration.ts @@ -0,0 +1,189 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: number; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} + +const baseDuration: object = { seconds: 0, nanos: 0 }; + +export const Duration = { + encode( + message: Duration, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.seconds !== 0) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Duration { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseDuration } as Duration; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.seconds = longToNumber(reader.int64() as Long); + break; + case 2: + message.nanos = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Duration { + const message = { ...baseDuration } as Duration; + message.seconds = + object.seconds !== undefined && object.seconds !== null + ? Number(object.seconds) + : 0; + message.nanos = + object.nanos !== undefined && object.nanos !== null + ? Number(object.nanos) + : 0; + return message; + }, + + toJSON(message: Duration): unknown { + const obj: any = {}; + message.seconds !== undefined && (obj.seconds = message.seconds); + message.nanos !== undefined && (obj.nanos = message.nanos); + return obj; + }, + + fromPartial(object: DeepPartial): Duration { + const message = { ...baseDuration } as Duration; + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 0; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/frontend/src/generated/media_set.ts b/frontend/src/generated/media_set.ts new file mode 100644 index 0000000..a59c09d --- /dev/null +++ b/frontend/src/generated/media_set.ts @@ -0,0 +1,1298 @@ +/* eslint-disable */ +import Long from "long"; +import { grpc } from "@improbable-eng/grpc-web"; +import _m0 from "protobufjs/minimal"; +import { Duration } from "./google/protobuf/duration"; +import { Observable } from "rxjs"; +import { BrowserHeaders } from "browser-headers"; +import { share } from "rxjs/operators"; + +export const protobufPackage = "media_set"; + +export interface MediaSet { + id: string; + youtubeId: string; + audioChannels: number; + audioApproxFrames: number; + audioFrames: number; + audioSampleRate: number; + audioYoutubeItag: number; + audioMimeType: string; + videoDuration?: Duration; + videoYoutubeItag: number; + videoMimeType: string; +} + +export interface GetAudioProgress { + peaks: number[]; + percentComplete: number; + url: string; +} + +export interface GetRequest { + youtubeId: string; +} + +export interface GetAudioRequest { + id: string; + numBins: number; +} + +export interface GetAudioSegmentRequest { + id: string; + numBins: number; + startFrame: number; + endFrame: number; +} + +export interface GetAudioSegmentResponse { + peaks: number[]; +} + +export interface GetVideoRequest { + id: string; +} + +export interface GetVideoProgress { + percentComplete: number; + url: string; +} + +export interface GetVideoThumbnailRequest { + id: string; +} + +export interface GetVideoThumbnailResponse { + image: Uint8Array; + width: number; + height: number; +} + +const baseMediaSet: object = { + id: "", + youtubeId: "", + audioChannels: 0, + audioApproxFrames: 0, + audioFrames: 0, + audioSampleRate: 0, + audioYoutubeItag: 0, + audioMimeType: "", + videoYoutubeItag: 0, + videoMimeType: "", +}; + +export const MediaSet = { + encode( + message: MediaSet, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.youtubeId !== "") { + writer.uint32(18).string(message.youtubeId); + } + if (message.audioChannels !== 0) { + writer.uint32(24).int32(message.audioChannels); + } + if (message.audioApproxFrames !== 0) { + writer.uint32(32).int64(message.audioApproxFrames); + } + if (message.audioFrames !== 0) { + writer.uint32(40).int64(message.audioFrames); + } + if (message.audioSampleRate !== 0) { + writer.uint32(48).int32(message.audioSampleRate); + } + if (message.audioYoutubeItag !== 0) { + writer.uint32(56).int32(message.audioYoutubeItag); + } + if (message.audioMimeType !== "") { + writer.uint32(66).string(message.audioMimeType); + } + if (message.videoDuration !== undefined) { + Duration.encode(message.videoDuration, writer.uint32(74).fork()).ldelim(); + } + if (message.videoYoutubeItag !== 0) { + writer.uint32(80).int32(message.videoYoutubeItag); + } + if (message.videoMimeType !== "") { + writer.uint32(90).string(message.videoMimeType); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MediaSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseMediaSet } as MediaSet; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.youtubeId = reader.string(); + break; + case 3: + message.audioChannels = reader.int32(); + break; + case 4: + message.audioApproxFrames = longToNumber(reader.int64() as Long); + break; + case 5: + message.audioFrames = longToNumber(reader.int64() as Long); + break; + case 6: + message.audioSampleRate = reader.int32(); + break; + case 7: + message.audioYoutubeItag = reader.int32(); + break; + case 8: + message.audioMimeType = reader.string(); + break; + case 9: + message.videoDuration = Duration.decode(reader, reader.uint32()); + break; + case 10: + message.videoYoutubeItag = reader.int32(); + break; + case 11: + message.videoMimeType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MediaSet { + const message = { ...baseMediaSet } as MediaSet; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.youtubeId = + object.youtubeId !== undefined && object.youtubeId !== null + ? String(object.youtubeId) + : ""; + message.audioChannels = + object.audioChannels !== undefined && object.audioChannels !== null + ? Number(object.audioChannels) + : 0; + message.audioApproxFrames = + object.audioApproxFrames !== undefined && + object.audioApproxFrames !== null + ? Number(object.audioApproxFrames) + : 0; + message.audioFrames = + object.audioFrames !== undefined && object.audioFrames !== null + ? Number(object.audioFrames) + : 0; + message.audioSampleRate = + object.audioSampleRate !== undefined && object.audioSampleRate !== null + ? Number(object.audioSampleRate) + : 0; + message.audioYoutubeItag = + object.audioYoutubeItag !== undefined && object.audioYoutubeItag !== null + ? Number(object.audioYoutubeItag) + : 0; + message.audioMimeType = + object.audioMimeType !== undefined && object.audioMimeType !== null + ? String(object.audioMimeType) + : ""; + message.videoDuration = + object.videoDuration !== undefined && object.videoDuration !== null + ? Duration.fromJSON(object.videoDuration) + : undefined; + message.videoYoutubeItag = + object.videoYoutubeItag !== undefined && object.videoYoutubeItag !== null + ? Number(object.videoYoutubeItag) + : 0; + message.videoMimeType = + object.videoMimeType !== undefined && object.videoMimeType !== null + ? String(object.videoMimeType) + : ""; + return message; + }, + + toJSON(message: MediaSet): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.youtubeId !== undefined && (obj.youtubeId = message.youtubeId); + message.audioChannels !== undefined && + (obj.audioChannels = message.audioChannels); + message.audioApproxFrames !== undefined && + (obj.audioApproxFrames = message.audioApproxFrames); + message.audioFrames !== undefined && + (obj.audioFrames = message.audioFrames); + message.audioSampleRate !== undefined && + (obj.audioSampleRate = message.audioSampleRate); + message.audioYoutubeItag !== undefined && + (obj.audioYoutubeItag = message.audioYoutubeItag); + message.audioMimeType !== undefined && + (obj.audioMimeType = message.audioMimeType); + message.videoDuration !== undefined && + (obj.videoDuration = message.videoDuration + ? Duration.toJSON(message.videoDuration) + : undefined); + message.videoYoutubeItag !== undefined && + (obj.videoYoutubeItag = message.videoYoutubeItag); + message.videoMimeType !== undefined && + (obj.videoMimeType = message.videoMimeType); + return obj; + }, + + fromPartial(object: DeepPartial): MediaSet { + const message = { ...baseMediaSet } as MediaSet; + message.id = object.id ?? ""; + message.youtubeId = object.youtubeId ?? ""; + message.audioChannels = object.audioChannels ?? 0; + message.audioApproxFrames = object.audioApproxFrames ?? 0; + message.audioFrames = object.audioFrames ?? 0; + message.audioSampleRate = object.audioSampleRate ?? 0; + message.audioYoutubeItag = object.audioYoutubeItag ?? 0; + message.audioMimeType = object.audioMimeType ?? ""; + message.videoDuration = + object.videoDuration !== undefined && object.videoDuration !== null + ? Duration.fromPartial(object.videoDuration) + : undefined; + message.videoYoutubeItag = object.videoYoutubeItag ?? 0; + message.videoMimeType = object.videoMimeType ?? ""; + return message; + }, +}; + +const baseGetAudioProgress: object = { peaks: 0, percentComplete: 0, url: "" }; + +export const GetAudioProgress = { + encode( + message: GetAudioProgress, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.peaks) { + writer.int32(v); + } + writer.ldelim(); + if (message.percentComplete !== 0) { + writer.uint32(21).float(message.percentComplete); + } + if (message.url !== "") { + writer.uint32(26).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetAudioProgress { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetAudioProgress } as GetAudioProgress; + message.peaks = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.peaks.push(reader.int32()); + } + } else { + message.peaks.push(reader.int32()); + } + break; + case 2: + message.percentComplete = reader.float(); + break; + case 3: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetAudioProgress { + const message = { ...baseGetAudioProgress } as GetAudioProgress; + message.peaks = (object.peaks ?? []).map((e: any) => Number(e)); + message.percentComplete = + object.percentComplete !== undefined && object.percentComplete !== null + ? Number(object.percentComplete) + : 0; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: GetAudioProgress): unknown { + const obj: any = {}; + if (message.peaks) { + obj.peaks = message.peaks.map((e) => e); + } else { + obj.peaks = []; + } + message.percentComplete !== undefined && + (obj.percentComplete = message.percentComplete); + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial(object: DeepPartial): GetAudioProgress { + const message = { ...baseGetAudioProgress } as GetAudioProgress; + message.peaks = (object.peaks ?? []).map((e) => e); + message.percentComplete = object.percentComplete ?? 0; + message.url = object.url ?? ""; + return message; + }, +}; + +const baseGetRequest: object = { youtubeId: "" }; + +export const GetRequest = { + encode( + message: GetRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.youtubeId !== "") { + writer.uint32(10).string(message.youtubeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetRequest } as GetRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.youtubeId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetRequest { + const message = { ...baseGetRequest } as GetRequest; + message.youtubeId = + object.youtubeId !== undefined && object.youtubeId !== null + ? String(object.youtubeId) + : ""; + return message; + }, + + toJSON(message: GetRequest): unknown { + const obj: any = {}; + message.youtubeId !== undefined && (obj.youtubeId = message.youtubeId); + return obj; + }, + + fromPartial(object: DeepPartial): GetRequest { + const message = { ...baseGetRequest } as GetRequest; + message.youtubeId = object.youtubeId ?? ""; + return message; + }, +}; + +const baseGetAudioRequest: object = { id: "", numBins: 0 }; + +export const GetAudioRequest = { + encode( + message: GetAudioRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.numBins !== 0) { + writer.uint32(16).int32(message.numBins); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetAudioRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetAudioRequest } as GetAudioRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.numBins = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetAudioRequest { + const message = { ...baseGetAudioRequest } as GetAudioRequest; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.numBins = + object.numBins !== undefined && object.numBins !== null + ? Number(object.numBins) + : 0; + return message; + }, + + toJSON(message: GetAudioRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.numBins !== undefined && (obj.numBins = message.numBins); + return obj; + }, + + fromPartial(object: DeepPartial): GetAudioRequest { + const message = { ...baseGetAudioRequest } as GetAudioRequest; + message.id = object.id ?? ""; + message.numBins = object.numBins ?? 0; + return message; + }, +}; + +const baseGetAudioSegmentRequest: object = { + id: "", + numBins: 0, + startFrame: 0, + endFrame: 0, +}; + +export const GetAudioSegmentRequest = { + encode( + message: GetAudioSegmentRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + if (message.numBins !== 0) { + writer.uint32(16).int32(message.numBins); + } + if (message.startFrame !== 0) { + writer.uint32(24).int64(message.startFrame); + } + if (message.endFrame !== 0) { + writer.uint32(32).int64(message.endFrame); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetAudioSegmentRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetAudioSegmentRequest } as GetAudioSegmentRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.numBins = reader.int32(); + break; + case 3: + message.startFrame = longToNumber(reader.int64() as Long); + break; + case 4: + message.endFrame = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetAudioSegmentRequest { + const message = { ...baseGetAudioSegmentRequest } as GetAudioSegmentRequest; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + message.numBins = + object.numBins !== undefined && object.numBins !== null + ? Number(object.numBins) + : 0; + message.startFrame = + object.startFrame !== undefined && object.startFrame !== null + ? Number(object.startFrame) + : 0; + message.endFrame = + object.endFrame !== undefined && object.endFrame !== null + ? Number(object.endFrame) + : 0; + return message; + }, + + toJSON(message: GetAudioSegmentRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + message.numBins !== undefined && (obj.numBins = message.numBins); + message.startFrame !== undefined && (obj.startFrame = message.startFrame); + message.endFrame !== undefined && (obj.endFrame = message.endFrame); + return obj; + }, + + fromPartial( + object: DeepPartial + ): GetAudioSegmentRequest { + const message = { ...baseGetAudioSegmentRequest } as GetAudioSegmentRequest; + message.id = object.id ?? ""; + message.numBins = object.numBins ?? 0; + message.startFrame = object.startFrame ?? 0; + message.endFrame = object.endFrame ?? 0; + return message; + }, +}; + +const baseGetAudioSegmentResponse: object = { peaks: 0 }; + +export const GetAudioSegmentResponse = { + encode( + message: GetAudioSegmentResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.peaks) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetAudioSegmentResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetAudioSegmentResponse, + } as GetAudioSegmentResponse; + message.peaks = []; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.peaks.push(reader.int32()); + } + } else { + message.peaks.push(reader.int32()); + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetAudioSegmentResponse { + const message = { + ...baseGetAudioSegmentResponse, + } as GetAudioSegmentResponse; + message.peaks = (object.peaks ?? []).map((e: any) => Number(e)); + return message; + }, + + toJSON(message: GetAudioSegmentResponse): unknown { + const obj: any = {}; + if (message.peaks) { + obj.peaks = message.peaks.map((e) => e); + } else { + obj.peaks = []; + } + return obj; + }, + + fromPartial( + object: DeepPartial + ): GetAudioSegmentResponse { + const message = { + ...baseGetAudioSegmentResponse, + } as GetAudioSegmentResponse; + message.peaks = (object.peaks ?? []).map((e) => e); + return message; + }, +}; + +const baseGetVideoRequest: object = { id: "" }; + +export const GetVideoRequest = { + encode( + message: GetVideoRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetVideoRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetVideoRequest } as GetVideoRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoRequest { + const message = { ...baseGetVideoRequest } as GetVideoRequest; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + return message; + }, + + toJSON(message: GetVideoRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial(object: DeepPartial): GetVideoRequest { + const message = { ...baseGetVideoRequest } as GetVideoRequest; + message.id = object.id ?? ""; + return message; + }, +}; + +const baseGetVideoProgress: object = { percentComplete: 0, url: "" }; + +export const GetVideoProgress = { + encode( + message: GetVideoProgress, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.percentComplete !== 0) { + writer.uint32(13).float(message.percentComplete); + } + if (message.url !== "") { + writer.uint32(18).string(message.url); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetVideoProgress { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { ...baseGetVideoProgress } as GetVideoProgress; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.percentComplete = reader.float(); + break; + case 2: + message.url = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoProgress { + const message = { ...baseGetVideoProgress } as GetVideoProgress; + message.percentComplete = + object.percentComplete !== undefined && object.percentComplete !== null + ? Number(object.percentComplete) + : 0; + message.url = + object.url !== undefined && object.url !== null ? String(object.url) : ""; + return message; + }, + + toJSON(message: GetVideoProgress): unknown { + const obj: any = {}; + message.percentComplete !== undefined && + (obj.percentComplete = message.percentComplete); + message.url !== undefined && (obj.url = message.url); + return obj; + }, + + fromPartial(object: DeepPartial): GetVideoProgress { + const message = { ...baseGetVideoProgress } as GetVideoProgress; + message.percentComplete = object.percentComplete ?? 0; + message.url = object.url ?? ""; + return message; + }, +}; + +const baseGetVideoThumbnailRequest: object = { id: "" }; + +export const GetVideoThumbnailRequest = { + encode( + message: GetVideoThumbnailRequest, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.id !== "") { + writer.uint32(10).string(message.id); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetVideoThumbnailRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetVideoThumbnailRequest, + } as GetVideoThumbnailRequest; + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoThumbnailRequest { + const message = { + ...baseGetVideoThumbnailRequest, + } as GetVideoThumbnailRequest; + message.id = + object.id !== undefined && object.id !== null ? String(object.id) : ""; + return message; + }, + + toJSON(message: GetVideoThumbnailRequest): unknown { + const obj: any = {}; + message.id !== undefined && (obj.id = message.id); + return obj; + }, + + fromPartial( + object: DeepPartial + ): GetVideoThumbnailRequest { + const message = { + ...baseGetVideoThumbnailRequest, + } as GetVideoThumbnailRequest; + message.id = object.id ?? ""; + return message; + }, +}; + +const baseGetVideoThumbnailResponse: object = { width: 0, height: 0 }; + +export const GetVideoThumbnailResponse = { + encode( + message: GetVideoThumbnailResponse, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.image.length !== 0) { + writer.uint32(10).bytes(message.image); + } + if (message.width !== 0) { + writer.uint32(16).int32(message.width); + } + if (message.height !== 0) { + writer.uint32(24).int32(message.height); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GetVideoThumbnailResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = { + ...baseGetVideoThumbnailResponse, + } as GetVideoThumbnailResponse; + message.image = new Uint8Array(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.image = reader.bytes(); + break; + case 2: + message.width = reader.int32(); + break; + case 3: + message.height = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetVideoThumbnailResponse { + const message = { + ...baseGetVideoThumbnailResponse, + } as GetVideoThumbnailResponse; + message.image = + object.image !== undefined && object.image !== null + ? bytesFromBase64(object.image) + : new Uint8Array(); + message.width = + object.width !== undefined && object.width !== null + ? Number(object.width) + : 0; + message.height = + object.height !== undefined && object.height !== null + ? Number(object.height) + : 0; + return message; + }, + + toJSON(message: GetVideoThumbnailResponse): unknown { + const obj: any = {}; + message.image !== undefined && + (obj.image = base64FromBytes( + message.image !== undefined ? message.image : new Uint8Array() + )); + message.width !== undefined && (obj.width = message.width); + message.height !== undefined && (obj.height = message.height); + return obj; + }, + + fromPartial( + object: DeepPartial + ): GetVideoThumbnailResponse { + const message = { + ...baseGetVideoThumbnailResponse, + } as GetVideoThumbnailResponse; + message.image = object.image ?? new Uint8Array(); + message.width = object.width ?? 0; + message.height = object.height ?? 0; + return message; + }, +}; + +export interface MediaSetService { + Get( + request: DeepPartial, + metadata?: grpc.Metadata + ): Promise; + GetAudio( + request: DeepPartial, + metadata?: grpc.Metadata + ): Observable; + GetAudioSegment( + request: DeepPartial, + metadata?: grpc.Metadata + ): Promise; + GetVideo( + request: DeepPartial, + metadata?: grpc.Metadata + ): Observable; + GetVideoThumbnail( + request: DeepPartial, + metadata?: grpc.Metadata + ): Promise; +} + +export class MediaSetServiceClientImpl implements MediaSetService { + private readonly rpc: Rpc; + + constructor(rpc: Rpc) { + this.rpc = rpc; + this.Get = this.Get.bind(this); + this.GetAudio = this.GetAudio.bind(this); + this.GetAudioSegment = this.GetAudioSegment.bind(this); + this.GetVideo = this.GetVideo.bind(this); + this.GetVideoThumbnail = this.GetVideoThumbnail.bind(this); + } + + Get( + request: DeepPartial, + metadata?: grpc.Metadata + ): Promise { + return this.rpc.unary( + MediaSetServiceGetDesc, + GetRequest.fromPartial(request), + metadata + ); + } + + GetAudio( + request: DeepPartial, + metadata?: grpc.Metadata + ): Observable { + return this.rpc.invoke( + MediaSetServiceGetAudioDesc, + GetAudioRequest.fromPartial(request), + metadata + ); + } + + GetAudioSegment( + request: DeepPartial, + metadata?: grpc.Metadata + ): Promise { + return this.rpc.unary( + MediaSetServiceGetAudioSegmentDesc, + GetAudioSegmentRequest.fromPartial(request), + metadata + ); + } + + GetVideo( + request: DeepPartial, + metadata?: grpc.Metadata + ): Observable { + return this.rpc.invoke( + MediaSetServiceGetVideoDesc, + GetVideoRequest.fromPartial(request), + metadata + ); + } + + GetVideoThumbnail( + request: DeepPartial, + metadata?: grpc.Metadata + ): Promise { + return this.rpc.unary( + MediaSetServiceGetVideoThumbnailDesc, + GetVideoThumbnailRequest.fromPartial(request), + metadata + ); + } +} + +export const MediaSetServiceDesc = { + serviceName: "media_set.MediaSetService", +}; + +export const MediaSetServiceGetDesc: UnaryMethodDefinitionish = { + methodName: "Get", + service: MediaSetServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return GetRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...MediaSet.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +export const MediaSetServiceGetAudioDesc: UnaryMethodDefinitionish = { + methodName: "GetAudio", + service: MediaSetServiceDesc, + requestStream: false, + responseStream: true, + requestType: { + serializeBinary() { + return GetAudioRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...GetAudioProgress.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +export const MediaSetServiceGetAudioSegmentDesc: UnaryMethodDefinitionish = { + methodName: "GetAudioSegment", + service: MediaSetServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return GetAudioSegmentRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...GetAudioSegmentResponse.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +export const MediaSetServiceGetVideoDesc: UnaryMethodDefinitionish = { + methodName: "GetVideo", + service: MediaSetServiceDesc, + requestStream: false, + responseStream: true, + requestType: { + serializeBinary() { + return GetVideoRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...GetVideoProgress.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +export const MediaSetServiceGetVideoThumbnailDesc: UnaryMethodDefinitionish = { + methodName: "GetVideoThumbnail", + service: MediaSetServiceDesc, + requestStream: false, + responseStream: false, + requestType: { + serializeBinary() { + return GetVideoThumbnailRequest.encode(this).finish(); + }, + } as any, + responseType: { + deserializeBinary(data: Uint8Array) { + return { + ...GetVideoThumbnailResponse.decode(data), + toObject() { + return this; + }, + }; + }, + } as any, +}; + +interface UnaryMethodDefinitionishR + extends grpc.UnaryMethodDefinition { + requestStream: any; + responseStream: any; +} + +type UnaryMethodDefinitionish = UnaryMethodDefinitionishR; + +interface Rpc { + unary( + methodDesc: T, + request: any, + metadata: grpc.Metadata | undefined + ): Promise; + invoke( + methodDesc: T, + request: any, + metadata: grpc.Metadata | undefined + ): Observable; +} + +export class GrpcWebImpl { + private host: string; + private options: { + transport?: grpc.TransportFactory; + streamingTransport?: grpc.TransportFactory; + debug?: boolean; + metadata?: grpc.Metadata; + }; + + constructor( + host: string, + options: { + transport?: grpc.TransportFactory; + streamingTransport?: grpc.TransportFactory; + debug?: boolean; + metadata?: grpc.Metadata; + } + ) { + this.host = host; + this.options = options; + } + + unary( + methodDesc: T, + _request: any, + metadata: grpc.Metadata | undefined + ): Promise { + const request = { ..._request, ...methodDesc.requestType }; + const maybeCombinedMetadata = + metadata && this.options.metadata + ? new BrowserHeaders({ + ...this.options?.metadata.headersMap, + ...metadata?.headersMap, + }) + : metadata || this.options.metadata; + return new Promise((resolve, reject) => { + grpc.unary(methodDesc, { + request, + host: this.host, + metadata: maybeCombinedMetadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (response.status === grpc.Code.OK) { + resolve(response.message); + } else { + const err = new Error(response.statusMessage) as any; + err.code = response.status; + err.metadata = response.trailers; + reject(err); + } + }, + }); + }); + } + + invoke( + methodDesc: T, + _request: any, + metadata: grpc.Metadata | undefined + ): Observable { + // Status Response Codes (https://developers.google.com/maps-booking/reference/grpc-api/status_codes) + const upStreamCodes = [2, 4, 8, 9, 10, 13, 14, 15]; + const DEFAULT_TIMEOUT_TIME: number = 3_000; + const request = { ..._request, ...methodDesc.requestType }; + const maybeCombinedMetadata = + metadata && this.options.metadata + ? new BrowserHeaders({ + ...this.options?.metadata.headersMap, + ...metadata?.headersMap, + }) + : metadata || this.options.metadata; + return new Observable((observer) => { + const upStream = () => { + const client = grpc.invoke(methodDesc, { + host: this.host, + request, + transport: this.options.streamingTransport || this.options.transport, + metadata: maybeCombinedMetadata, + debug: this.options.debug, + onMessage: (next) => observer.next(next), + onEnd: (code: grpc.Code, message: string) => { + if (code === 0) { + observer.complete(); + } else if (upStreamCodes.includes(code)) { + setTimeout(upStream, DEFAULT_TIMEOUT_TIME); + } else { + observer.error(new Error(`Error ${code} ${message}`)); + } + }, + }); + observer.add(() => client.close()); + }; + upStream(); + }).pipe(share()); + } +} + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var globalThis: any = (() => { + if (typeof globalThis !== "undefined") return globalThis; + if (typeof self !== "undefined") return self; + if (typeof window !== "undefined") return window; + if (typeof global !== "undefined") return global; + throw "Unable to locate global object"; +})(); + +const atob: (b64: string) => string = + globalThis.atob || + ((b64) => globalThis.Buffer.from(b64, "base64").toString("binary")); +function bytesFromBase64(b64: string): Uint8Array { + const bin = atob(b64); + const arr = new Uint8Array(bin.length); + for (let i = 0; i < bin.length; ++i) { + arr[i] = bin.charCodeAt(i); + } + return arr; +} + +const btoa: (bin: string) => string = + globalThis.btoa || + ((bin) => globalThis.Buffer.from(bin, "binary").toString("base64")); +function base64FromBytes(arr: Uint8Array): string { + const bin: string[] = []; + for (const byte of arr) { + bin.push(String.fromCharCode(byte)); + } + return btoa(bin.join("")); +} + +type Builtin = + | Date + | Function + | Uint8Array + | string + | number + | boolean + | undefined; +export type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/frontend/src/generated/media_set_pb.js b/frontend/src/generated/media_set_pb.js new file mode 100644 index 0000000..11c8a9f --- /dev/null +++ b/frontend/src/generated/media_set_pb.js @@ -0,0 +1,2211 @@ +// source: media_set.proto +/** + * @fileoverview + * @enhanceable + * @suppress {missingRequire} reports error on implicit type usages. + * @suppress {messageConventions} JS Compiler reports an error if a variable or + * field starts with 'MSG_' and isn't a translatable message. + * @public + */ +// GENERATED CODE -- DO NOT EDIT! +/* eslint-disable */ +// @ts-nocheck + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); +goog.object.extend(proto, google_protobuf_duration_pb); +goog.exportSymbol('proto.media_set.GetAudioProgress', null, global); +goog.exportSymbol('proto.media_set.GetAudioRequest', null, global); +goog.exportSymbol('proto.media_set.GetAudioSegmentRequest', null, global); +goog.exportSymbol('proto.media_set.GetAudioSegmentResponse', null, global); +goog.exportSymbol('proto.media_set.GetRequest', null, global); +goog.exportSymbol('proto.media_set.GetVideoProgress', null, global); +goog.exportSymbol('proto.media_set.GetVideoRequest', null, global); +goog.exportSymbol('proto.media_set.GetVideoThumbnailRequest', null, global); +goog.exportSymbol('proto.media_set.GetVideoThumbnailResponse', null, global); +goog.exportSymbol('proto.media_set.MediaSet', null, global); +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.MediaSet = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.media_set.MediaSet, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.MediaSet.displayName = 'proto.media_set.MediaSet'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetAudioProgress = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.media_set.GetAudioProgress.repeatedFields_, null); +}; +goog.inherits(proto.media_set.GetAudioProgress, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetAudioProgress.displayName = 'proto.media_set.GetAudioProgress'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.media_set.GetRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetRequest.displayName = 'proto.media_set.GetRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetAudioRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.media_set.GetAudioRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetAudioRequest.displayName = 'proto.media_set.GetAudioRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetAudioSegmentRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.media_set.GetAudioSegmentRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetAudioSegmentRequest.displayName = 'proto.media_set.GetAudioSegmentRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetAudioSegmentResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.media_set.GetAudioSegmentResponse.repeatedFields_, null); +}; +goog.inherits(proto.media_set.GetAudioSegmentResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetAudioSegmentResponse.displayName = 'proto.media_set.GetAudioSegmentResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetVideoRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.media_set.GetVideoRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetVideoRequest.displayName = 'proto.media_set.GetVideoRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetVideoProgress = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.media_set.GetVideoProgress, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetVideoProgress.displayName = 'proto.media_set.GetVideoProgress'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetVideoThumbnailRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.media_set.GetVideoThumbnailRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetVideoThumbnailRequest.displayName = 'proto.media_set.GetVideoThumbnailRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.media_set.GetVideoThumbnailResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.media_set.GetVideoThumbnailResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.media_set.GetVideoThumbnailResponse.displayName = 'proto.media_set.GetVideoThumbnailResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.MediaSet.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.MediaSet.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.MediaSet} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.MediaSet.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + youtubeId: jspb.Message.getFieldWithDefault(msg, 2, ""), + audioChannels: jspb.Message.getFieldWithDefault(msg, 3, 0), + audioApproxFrames: jspb.Message.getFieldWithDefault(msg, 4, 0), + audioFrames: jspb.Message.getFieldWithDefault(msg, 5, 0), + audioSampleRate: jspb.Message.getFieldWithDefault(msg, 6, 0), + audioYoutubeItag: jspb.Message.getFieldWithDefault(msg, 7, 0), + audioMimeType: jspb.Message.getFieldWithDefault(msg, 8, ""), + videoDuration: (f = msg.getVideoDuration()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f), + videoYoutubeItag: jspb.Message.getFieldWithDefault(msg, 10, 0), + videoMimeType: jspb.Message.getFieldWithDefault(msg, 11, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.MediaSet} + */ +proto.media_set.MediaSet.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.MediaSet; + return proto.media_set.MediaSet.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.MediaSet} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.MediaSet} + */ +proto.media_set.MediaSet.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setYoutubeId(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAudioChannels(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setAudioApproxFrames(value); + break; + case 5: + var value = /** @type {number} */ (reader.readInt64()); + msg.setAudioFrames(value); + break; + case 6: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAudioSampleRate(value); + break; + case 7: + var value = /** @type {number} */ (reader.readInt32()); + msg.setAudioYoutubeItag(value); + break; + case 8: + var value = /** @type {string} */ (reader.readString()); + msg.setAudioMimeType(value); + break; + case 9: + var value = new google_protobuf_duration_pb.Duration; + reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); + msg.setVideoDuration(value); + break; + case 10: + var value = /** @type {number} */ (reader.readInt32()); + msg.setVideoYoutubeItag(value); + break; + case 11: + var value = /** @type {string} */ (reader.readString()); + msg.setVideoMimeType(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.MediaSet.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.MediaSet.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.MediaSet} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.MediaSet.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getYoutubeId(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getAudioChannels(); + if (f !== 0) { + writer.writeInt32( + 3, + f + ); + } + f = message.getAudioApproxFrames(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } + f = message.getAudioFrames(); + if (f !== 0) { + writer.writeInt64( + 5, + f + ); + } + f = message.getAudioSampleRate(); + if (f !== 0) { + writer.writeInt32( + 6, + f + ); + } + f = message.getAudioYoutubeItag(); + if (f !== 0) { + writer.writeInt32( + 7, + f + ); + } + f = message.getAudioMimeType(); + if (f.length > 0) { + writer.writeString( + 8, + f + ); + } + f = message.getVideoDuration(); + if (f != null) { + writer.writeMessage( + 9, + f, + google_protobuf_duration_pb.Duration.serializeBinaryToWriter + ); + } + f = message.getVideoYoutubeItag(); + if (f !== 0) { + writer.writeInt32( + 10, + f + ); + } + f = message.getVideoMimeType(); + if (f.length > 0) { + writer.writeString( + 11, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.media_set.MediaSet.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional string youtube_id = 2; + * @return {string} + */ +proto.media_set.MediaSet.prototype.getYoutubeId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setYoutubeId = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional int32 audio_channels = 3; + * @return {number} + */ +proto.media_set.MediaSet.prototype.getAudioChannels = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setAudioChannels = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 audio_approx_frames = 4; + * @return {number} + */ +proto.media_set.MediaSet.prototype.getAudioApproxFrames = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setAudioApproxFrames = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + +/** + * optional int64 audio_frames = 5; + * @return {number} + */ +proto.media_set.MediaSet.prototype.getAudioFrames = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setAudioFrames = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); +}; + + +/** + * optional int32 audio_sample_rate = 6; + * @return {number} + */ +proto.media_set.MediaSet.prototype.getAudioSampleRate = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setAudioSampleRate = function(value) { + return jspb.Message.setProto3IntField(this, 6, value); +}; + + +/** + * optional int32 audio_youtube_itag = 7; + * @return {number} + */ +proto.media_set.MediaSet.prototype.getAudioYoutubeItag = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setAudioYoutubeItag = function(value) { + return jspb.Message.setProto3IntField(this, 7, value); +}; + + +/** + * optional string audio_mime_type = 8; + * @return {string} + */ +proto.media_set.MediaSet.prototype.getAudioMimeType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setAudioMimeType = function(value) { + return jspb.Message.setProto3StringField(this, 8, value); +}; + + +/** + * optional google.protobuf.Duration video_duration = 9; + * @return {?proto.google.protobuf.Duration} + */ +proto.media_set.MediaSet.prototype.getVideoDuration = function() { + return /** @type{?proto.google.protobuf.Duration} */ ( + jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 9)); +}; + + +/** + * @param {?proto.google.protobuf.Duration|undefined} value + * @return {!proto.media_set.MediaSet} returns this +*/ +proto.media_set.MediaSet.prototype.setVideoDuration = function(value) { + return jspb.Message.setWrapperField(this, 9, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.clearVideoDuration = function() { + return this.setVideoDuration(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.media_set.MediaSet.prototype.hasVideoDuration = function() { + return jspb.Message.getField(this, 9) != null; +}; + + +/** + * optional int32 video_youtube_itag = 10; + * @return {number} + */ +proto.media_set.MediaSet.prototype.getVideoYoutubeItag = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setVideoYoutubeItag = function(value) { + return jspb.Message.setProto3IntField(this, 10, value); +}; + + +/** + * optional string video_mime_type = 11; + * @return {string} + */ +proto.media_set.MediaSet.prototype.getVideoMimeType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.MediaSet} returns this + */ +proto.media_set.MediaSet.prototype.setVideoMimeType = function(value) { + return jspb.Message.setProto3StringField(this, 11, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.media_set.GetAudioProgress.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetAudioProgress.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetAudioProgress.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetAudioProgress} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetAudioProgress.toObject = function(includeInstance, msg) { + var f, obj = { + peaksList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f, + percentComplete: jspb.Message.getFloatingPointFieldWithDefault(msg, 2, 0.0), + url: jspb.Message.getFieldWithDefault(msg, 3, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetAudioProgress} + */ +proto.media_set.GetAudioProgress.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetAudioProgress; + return proto.media_set.GetAudioProgress.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetAudioProgress} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetAudioProgress} + */ +proto.media_set.GetAudioProgress.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt32() : [reader.readInt32()]); + for (var i = 0; i < values.length; i++) { + msg.addPeaks(values[i]); + } + break; + case 2: + var value = /** @type {number} */ (reader.readFloat()); + msg.setPercentComplete(value); + break; + case 3: + var value = /** @type {string} */ (reader.readString()); + msg.setUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetAudioProgress.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetAudioProgress.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetAudioProgress} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetAudioProgress.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPeaksList(); + if (f.length > 0) { + writer.writePackedInt32( + 1, + f + ); + } + f = message.getPercentComplete(); + if (f !== 0.0) { + writer.writeFloat( + 2, + f + ); + } + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 3, + f + ); + } +}; + + +/** + * repeated int32 peaks = 1; + * @return {!Array} + */ +proto.media_set.GetAudioProgress.prototype.getPeaksList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.media_set.GetAudioProgress} returns this + */ +proto.media_set.GetAudioProgress.prototype.setPeaksList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.media_set.GetAudioProgress} returns this + */ +proto.media_set.GetAudioProgress.prototype.addPeaks = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.media_set.GetAudioProgress} returns this + */ +proto.media_set.GetAudioProgress.prototype.clearPeaksList = function() { + return this.setPeaksList([]); +}; + + +/** + * optional float percent_complete = 2; + * @return {number} + */ +proto.media_set.GetAudioProgress.prototype.getPercentComplete = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 2, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.GetAudioProgress} returns this + */ +proto.media_set.GetAudioProgress.prototype.setPercentComplete = function(value) { + return jspb.Message.setProto3FloatField(this, 2, value); +}; + + +/** + * optional string url = 3; + * @return {string} + */ +proto.media_set.GetAudioProgress.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.GetAudioProgress} returns this + */ +proto.media_set.GetAudioProgress.prototype.setUrl = function(value) { + return jspb.Message.setProto3StringField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetRequest.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetRequest.toObject = function(includeInstance, msg) { + var f, obj = { + youtubeId: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetRequest} + */ +proto.media_set.GetRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetRequest; + return proto.media_set.GetRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetRequest} + */ +proto.media_set.GetRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setYoutubeId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getYoutubeId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string youtube_id = 1; + * @return {string} + */ +proto.media_set.GetRequest.prototype.getYoutubeId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.GetRequest} returns this + */ +proto.media_set.GetRequest.prototype.setYoutubeId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetAudioRequest.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetAudioRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetAudioRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetAudioRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + numBins: jspb.Message.getFieldWithDefault(msg, 2, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetAudioRequest} + */ +proto.media_set.GetAudioRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetAudioRequest; + return proto.media_set.GetAudioRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetAudioRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetAudioRequest} + */ +proto.media_set.GetAudioRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setNumBins(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetAudioRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetAudioRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetAudioRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetAudioRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getNumBins(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.media_set.GetAudioRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.GetAudioRequest} returns this + */ +proto.media_set.GetAudioRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional int32 num_bins = 2; + * @return {number} + */ +proto.media_set.GetAudioRequest.prototype.getNumBins = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.GetAudioRequest} returns this + */ +proto.media_set.GetAudioRequest.prototype.setNumBins = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetAudioSegmentRequest.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetAudioSegmentRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetAudioSegmentRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetAudioSegmentRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, ""), + numBins: jspb.Message.getFieldWithDefault(msg, 2, 0), + startFrame: jspb.Message.getFieldWithDefault(msg, 3, 0), + endFrame: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetAudioSegmentRequest} + */ +proto.media_set.GetAudioSegmentRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetAudioSegmentRequest; + return proto.media_set.GetAudioSegmentRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetAudioSegmentRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetAudioSegmentRequest} + */ +proto.media_set.GetAudioSegmentRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setNumBins(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt64()); + msg.setStartFrame(value); + break; + case 4: + var value = /** @type {number} */ (reader.readInt64()); + msg.setEndFrame(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetAudioSegmentRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetAudioSegmentRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetAudioSegmentRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetAudioSegmentRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } + f = message.getNumBins(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } + f = message.getStartFrame(); + if (f !== 0) { + writer.writeInt64( + 3, + f + ); + } + f = message.getEndFrame(); + if (f !== 0) { + writer.writeInt64( + 4, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.media_set.GetAudioSegmentRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.GetAudioSegmentRequest} returns this + */ +proto.media_set.GetAudioSegmentRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + +/** + * optional int32 num_bins = 2; + * @return {number} + */ +proto.media_set.GetAudioSegmentRequest.prototype.getNumBins = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.GetAudioSegmentRequest} returns this + */ +proto.media_set.GetAudioSegmentRequest.prototype.setNumBins = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int64 start_frame = 3; + * @return {number} + */ +proto.media_set.GetAudioSegmentRequest.prototype.getStartFrame = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.GetAudioSegmentRequest} returns this + */ +proto.media_set.GetAudioSegmentRequest.prototype.setStartFrame = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional int64 end_frame = 4; + * @return {number} + */ +proto.media_set.GetAudioSegmentRequest.prototype.getEndFrame = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.GetAudioSegmentRequest} returns this + */ +proto.media_set.GetAudioSegmentRequest.prototype.setEndFrame = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.media_set.GetAudioSegmentResponse.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetAudioSegmentResponse.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetAudioSegmentResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetAudioSegmentResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetAudioSegmentResponse.toObject = function(includeInstance, msg) { + var f, obj = { + peaksList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetAudioSegmentResponse} + */ +proto.media_set.GetAudioSegmentResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetAudioSegmentResponse; + return proto.media_set.GetAudioSegmentResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetAudioSegmentResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetAudioSegmentResponse} + */ +proto.media_set.GetAudioSegmentResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedInt32() : [reader.readInt32()]); + for (var i = 0; i < values.length; i++) { + msg.addPeaks(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetAudioSegmentResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetAudioSegmentResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetAudioSegmentResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetAudioSegmentResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPeaksList(); + if (f.length > 0) { + writer.writePackedInt32( + 1, + f + ); + } +}; + + +/** + * repeated int32 peaks = 1; + * @return {!Array} + */ +proto.media_set.GetAudioSegmentResponse.prototype.getPeaksList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.media_set.GetAudioSegmentResponse} returns this + */ +proto.media_set.GetAudioSegmentResponse.prototype.setPeaksList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.media_set.GetAudioSegmentResponse} returns this + */ +proto.media_set.GetAudioSegmentResponse.prototype.addPeaks = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.media_set.GetAudioSegmentResponse} returns this + */ +proto.media_set.GetAudioSegmentResponse.prototype.clearPeaksList = function() { + return this.setPeaksList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetVideoRequest.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetVideoRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetVideoRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetVideoRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetVideoRequest} + */ +proto.media_set.GetVideoRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetVideoRequest; + return proto.media_set.GetVideoRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetVideoRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetVideoRequest} + */ +proto.media_set.GetVideoRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetVideoRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetVideoRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetVideoRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetVideoRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.media_set.GetVideoRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.GetVideoRequest} returns this + */ +proto.media_set.GetVideoRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetVideoProgress.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetVideoProgress.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetVideoProgress} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetVideoProgress.toObject = function(includeInstance, msg) { + var f, obj = { + percentComplete: jspb.Message.getFloatingPointFieldWithDefault(msg, 1, 0.0), + url: jspb.Message.getFieldWithDefault(msg, 2, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetVideoProgress} + */ +proto.media_set.GetVideoProgress.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetVideoProgress; + return proto.media_set.GetVideoProgress.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetVideoProgress} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetVideoProgress} + */ +proto.media_set.GetVideoProgress.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readFloat()); + msg.setPercentComplete(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setUrl(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetVideoProgress.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetVideoProgress.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetVideoProgress} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetVideoProgress.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPercentComplete(); + if (f !== 0.0) { + writer.writeFloat( + 1, + f + ); + } + f = message.getUrl(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional float percent_complete = 1; + * @return {number} + */ +proto.media_set.GetVideoProgress.prototype.getPercentComplete = function() { + return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 1, 0.0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.GetVideoProgress} returns this + */ +proto.media_set.GetVideoProgress.prototype.setPercentComplete = function(value) { + return jspb.Message.setProto3FloatField(this, 1, value); +}; + + +/** + * optional string url = 2; + * @return {string} + */ +proto.media_set.GetVideoProgress.prototype.getUrl = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.GetVideoProgress} returns this + */ +proto.media_set.GetVideoProgress.prototype.setUrl = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetVideoThumbnailRequest.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetVideoThumbnailRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetVideoThumbnailRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetVideoThumbnailRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: jspb.Message.getFieldWithDefault(msg, 1, "") + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetVideoThumbnailRequest} + */ +proto.media_set.GetVideoThumbnailRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetVideoThumbnailRequest; + return proto.media_set.GetVideoThumbnailRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetVideoThumbnailRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetVideoThumbnailRequest} + */ +proto.media_set.GetVideoThumbnailRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {string} */ (reader.readString()); + msg.setId(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetVideoThumbnailRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetVideoThumbnailRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetVideoThumbnailRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetVideoThumbnailRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId(); + if (f.length > 0) { + writer.writeString( + 1, + f + ); + } +}; + + +/** + * optional string id = 1; + * @return {string} + */ +proto.media_set.GetVideoThumbnailRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * @param {string} value + * @return {!proto.media_set.GetVideoThumbnailRequest} returns this + */ +proto.media_set.GetVideoThumbnailRequest.prototype.setId = function(value) { + return jspb.Message.setProto3StringField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.media_set.GetVideoThumbnailResponse.prototype.toObject = function(opt_includeInstance) { + return proto.media_set.GetVideoThumbnailResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.media_set.GetVideoThumbnailResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetVideoThumbnailResponse.toObject = function(includeInstance, msg) { + var f, obj = { + image: msg.getImage_asB64(), + width: jspb.Message.getFieldWithDefault(msg, 2, 0), + height: jspb.Message.getFieldWithDefault(msg, 3, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.media_set.GetVideoThumbnailResponse} + */ +proto.media_set.GetVideoThumbnailResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.media_set.GetVideoThumbnailResponse; + return proto.media_set.GetVideoThumbnailResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.media_set.GetVideoThumbnailResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.media_set.GetVideoThumbnailResponse} + */ +proto.media_set.GetVideoThumbnailResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setImage(value); + break; + case 2: + var value = /** @type {number} */ (reader.readInt32()); + msg.setWidth(value); + break; + case 3: + var value = /** @type {number} */ (reader.readInt32()); + msg.setHeight(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.media_set.GetVideoThumbnailResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.media_set.GetVideoThumbnailResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.media_set.GetVideoThumbnailResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.media_set.GetVideoThumbnailResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getImage_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getWidth(); + if (f !== 0) { + writer.writeInt32( + 2, + f + ); + } + f = message.getHeight(); + if (f !== 0) { + writer.writeInt32( + 3, + f + ); + } +}; + + +/** + * optional bytes image = 1; + * @return {!(string|Uint8Array)} + */ +proto.media_set.GetVideoThumbnailResponse.prototype.getImage = function() { + return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes image = 1; + * This is a type-conversion wrapper around `getImage()` + * @return {string} + */ +proto.media_set.GetVideoThumbnailResponse.prototype.getImage_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getImage())); +}; + + +/** + * optional bytes image = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getImage()` + * @return {!Uint8Array} + */ +proto.media_set.GetVideoThumbnailResponse.prototype.getImage_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getImage())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.media_set.GetVideoThumbnailResponse} returns this + */ +proto.media_set.GetVideoThumbnailResponse.prototype.setImage = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional int32 width = 2; + * @return {number} + */ +proto.media_set.GetVideoThumbnailResponse.prototype.getWidth = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.GetVideoThumbnailResponse} returns this + */ +proto.media_set.GetVideoThumbnailResponse.prototype.setWidth = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional int32 height = 3; + * @return {number} + */ +proto.media_set.GetVideoThumbnailResponse.prototype.getHeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.media_set.GetVideoThumbnailResponse} returns this + */ +proto.media_set.GetVideoThumbnailResponse.prototype.setHeight = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +goog.object.extend(exports, proto.media_set);