From d49375c9fa9ab3a85cf7b200b8acaa99ba5a88fd Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Mon, 14 Jan 2019 16:25:39 +0100 Subject: [PATCH] feat: port soundcloud calls --- Makefile | 3 +- api/api.pb.go | 405 +-- api/api.pb.gw.go | 4 +- api/api.proto | 22 +- go.mod | 1 + main.go | 35 +- pkg/soundcloud/soundcloud.go | 198 +- pkg/soundcloud/soundcloud.pb.go | 5120 +++++++++++++++++++++++++++++++ pkg/soundcloud/soundcloud.proto | 126 + svc/svc.go | 149 +- 10 files changed, 5606 insertions(+), 457 deletions(-) create mode 100644 pkg/soundcloud/soundcloud.pb.go create mode 100644 pkg/soundcloud/soundcloud.proto diff --git a/Makefile b/Makefile index d07638df..3e33446a 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ PROTOS = $(call rwildcard, ./, *.proto) OUR_PROTOS = $(filter-out $(call rwildcard,vendor//,*.proto),$(PROTOS)) GENERATED_FILES = \ $(patsubst %.proto,%.pb.go,$(PROTOS)) \ - $(call rwildcard ./, *.gen.go) + $(call rwildcard .//, *.gen.go) \ + $(call rwildcard .//, *.pb.gw.go) PROTOC_OPTS = -I/protobuf:vendor:. RUN_OPTS ?= diff --git a/api/api.pb.go b/api/api.pb.go index d76b53c5..b197fecd 100644 --- a/api/api.pb.go +++ b/api/api.pb.go @@ -9,6 +9,7 @@ import math "math" import _ "github.com/gogo/protobuf/gogoproto" import _ "google.golang.org/genproto/googleapis/api/annotations" import crew "ultre.me/calcbiz/pkg/crew" +import soundcloud "ultre.me/calcbiz/pkg/soundcloud" import ( context "golang.org/x/net/context" @@ -35,7 +36,7 @@ func (m *Void) Reset() { *m = Void{} } func (m *Void) String() string { return proto.CompactTextString(m) } func (*Void) ProtoMessage() {} func (*Void) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{0} + return fileDescriptor_api_1182541e4358e084, []int{0} } func (m *Void) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -72,7 +73,7 @@ func (m *Pong) Reset() { *m = Pong{} } func (m *Pong) String() string { return proto.CompactTextString(m) } func (*Pong) ProtoMessage() {} func (*Pong) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{1} + return fileDescriptor_api_1182541e4358e084, []int{1} } func (m *Pong) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -116,7 +117,7 @@ func (m *KryptosInput) Reset() { *m = KryptosInput{} } func (m *KryptosInput) String() string { return proto.CompactTextString(m) } func (*KryptosInput) ProtoMessage() {} func (*KryptosInput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{2} + return fileDescriptor_api_1182541e4358e084, []int{2} } func (m *KryptosInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -160,7 +161,7 @@ func (m *KryptosOutput) Reset() { *m = KryptosOutput{} } func (m *KryptosOutput) String() string { return proto.CompactTextString(m) } func (*KryptosOutput) ProtoMessage() {} func (*KryptosOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{3} + return fileDescriptor_api_1182541e4358e084, []int{3} } func (m *KryptosOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -204,7 +205,7 @@ func (m *TpyoEnocdeIpunt) Reset() { *m = TpyoEnocdeIpunt{} } func (m *TpyoEnocdeIpunt) String() string { return proto.CompactTextString(m) } func (*TpyoEnocdeIpunt) ProtoMessage() {} func (*TpyoEnocdeIpunt) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{4} + return fileDescriptor_api_1182541e4358e084, []int{4} } func (m *TpyoEnocdeIpunt) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -248,7 +249,7 @@ func (m *TpyoEnocdeOuptut) Reset() { *m = TpyoEnocdeOuptut{} } func (m *TpyoEnocdeOuptut) String() string { return proto.CompactTextString(m) } func (*TpyoEnocdeOuptut) ProtoMessage() {} func (*TpyoEnocdeOuptut) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{5} + return fileDescriptor_api_1182541e4358e084, []int{5} } func (m *TpyoEnocdeOuptut) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -291,7 +292,7 @@ func (m *DahsboardRandomOutput) Reset() { *m = DahsboardRandomOutput{} } func (m *DahsboardRandomOutput) String() string { return proto.CompactTextString(m) } func (*DahsboardRandomOutput) ProtoMessage() {} func (*DahsboardRandomOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{6} + return fileDescriptor_api_1182541e4358e084, []int{6} } func (m *DahsboardRandomOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -328,7 +329,7 @@ func (m *NumberinfoInput) Reset() { *m = NumberinfoInput{} } func (m *NumberinfoInput) String() string { return proto.CompactTextString(m) } func (*NumberinfoInput) ProtoMessage() {} func (*NumberinfoInput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{7} + return fileDescriptor_api_1182541e4358e084, []int{7} } func (m *NumberinfoInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -371,7 +372,7 @@ func (m *NumberinfoOutput) Reset() { *m = NumberinfoOutput{} } func (m *NumberinfoOutput) String() string { return proto.CompactTextString(m) } func (*NumberinfoOutput) ProtoMessage() {} func (*NumberinfoOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{8} + return fileDescriptor_api_1182541e4358e084, []int{8} } func (m *NumberinfoOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -408,7 +409,7 @@ func (m *MoijaimeOutput) Reset() { *m = MoijaimeOutput{} } func (m *MoijaimeOutput) String() string { return proto.CompactTextString(m) } func (*MoijaimeOutput) ProtoMessage() {} func (*MoijaimeOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{9} + return fileDescriptor_api_1182541e4358e084, []int{9} } func (m *MoijaimeOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -452,7 +453,7 @@ func (m *WotdOutput) Reset() { *m = WotdOutput{} } func (m *WotdOutput) String() string { return proto.CompactTextString(m) } func (*WotdOutput) ProtoMessage() {} func (*WotdOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{10} + return fileDescriptor_api_1182541e4358e084, []int{10} } func (m *WotdOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -496,7 +497,7 @@ func (m *AlternateLogoOutput) Reset() { *m = AlternateLogoOutput{} } func (m *AlternateLogoOutput) String() string { return proto.CompactTextString(m) } func (*AlternateLogoOutput) ProtoMessage() {} func (*AlternateLogoOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{11} + return fileDescriptor_api_1182541e4358e084, []int{11} } func (m *AlternateLogoOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -539,7 +540,7 @@ func (m *DahsboardOutput) Reset() { *m = DahsboardOutput{} } func (m *DahsboardOutput) String() string { return proto.CompactTextString(m) } func (*DahsboardOutput) ProtoMessage() {} func (*DahsboardOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{12} + return fileDescriptor_api_1182541e4358e084, []int{12} } func (m *DahsboardOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -576,7 +577,7 @@ func (m *RecettatorInput) Reset() { *m = RecettatorInput{} } func (m *RecettatorInput) String() string { return proto.CompactTextString(m) } func (*RecettatorInput) ProtoMessage() {} func (*RecettatorInput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{13} + return fileDescriptor_api_1182541e4358e084, []int{13} } func (m *RecettatorInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -619,7 +620,7 @@ func (m *RecettatorOutput) Reset() { *m = RecettatorOutput{} } func (m *RecettatorOutput) String() string { return proto.CompactTextString(m) } func (*RecettatorOutput) ProtoMessage() {} func (*RecettatorOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{14} + return fileDescriptor_api_1182541e4358e084, []int{14} } func (m *RecettatorOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -655,7 +656,7 @@ func (m *DashboardOutput) Reset() { *m = DashboardOutput{} } func (m *DashboardOutput) String() string { return proto.CompactTextString(m) } func (*DashboardOutput) ProtoMessage() {} func (*DashboardOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{15} + return fileDescriptor_api_1182541e4358e084, []int{15} } func (m *DashboardOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -691,7 +692,7 @@ func (m *SpreadshirtRandomOutput) Reset() { *m = SpreadshirtRandomOutput func (m *SpreadshirtRandomOutput) String() string { return proto.CompactTextString(m) } func (*SpreadshirtRandomOutput) ProtoMessage() {} func (*SpreadshirtRandomOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{16} + return fileDescriptor_api_1182541e4358e084, []int{16} } func (m *SpreadshirtRandomOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -727,7 +728,7 @@ func (m *SpreadshirtAllOutput) Reset() { *m = SpreadshirtAllOutput{} } func (m *SpreadshirtAllOutput) String() string { return proto.CompactTextString(m) } func (*SpreadshirtAllOutput) ProtoMessage() {} func (*SpreadshirtAllOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{17} + return fileDescriptor_api_1182541e4358e084, []int{17} } func (m *SpreadshirtAllOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -756,42 +757,6 @@ func (m *SpreadshirtAllOutput) XXX_DiscardUnknown() { var xxx_messageInfo_SpreadshirtAllOutput proto.InternalMessageInfo -type SoundcloudMeOutput struct { -} - -func (m *SoundcloudMeOutput) Reset() { *m = SoundcloudMeOutput{} } -func (m *SoundcloudMeOutput) String() string { return proto.CompactTextString(m) } -func (*SoundcloudMeOutput) ProtoMessage() {} -func (*SoundcloudMeOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{18} -} -func (m *SoundcloudMeOutput) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SoundcloudMeOutput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SoundcloudMeOutput.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalTo(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (dst *SoundcloudMeOutput) XXX_Merge(src proto.Message) { - xxx_messageInfo_SoundcloudMeOutput.Merge(dst, src) -} -func (m *SoundcloudMeOutput) XXX_Size() int { - return m.Size() -} -func (m *SoundcloudMeOutput) XXX_DiscardUnknown() { - xxx_messageInfo_SoundcloudMeOutput.DiscardUnknown(m) -} - -var xxx_messageInfo_SoundcloudMeOutput proto.InternalMessageInfo - type SoundcloudPlaylistsOutput struct { } @@ -799,7 +764,7 @@ func (m *SoundcloudPlaylistsOutput) Reset() { *m = SoundcloudPlaylistsOu func (m *SoundcloudPlaylistsOutput) String() string { return proto.CompactTextString(m) } func (*SoundcloudPlaylistsOutput) ProtoMessage() {} func (*SoundcloudPlaylistsOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{19} + return fileDescriptor_api_1182541e4358e084, []int{18} } func (m *SoundcloudPlaylistsOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -835,7 +800,7 @@ func (m *SoundcloudPlaylistOutput) Reset() { *m = SoundcloudPlaylistOutp func (m *SoundcloudPlaylistOutput) String() string { return proto.CompactTextString(m) } func (*SoundcloudPlaylistOutput) ProtoMessage() {} func (*SoundcloudPlaylistOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{20} + return fileDescriptor_api_1182541e4358e084, []int{19} } func (m *SoundcloudPlaylistOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -871,7 +836,7 @@ func (m *SoundcloudTracksOutput) Reset() { *m = SoundcloudTracksOutput{} func (m *SoundcloudTracksOutput) String() string { return proto.CompactTextString(m) } func (*SoundcloudTracksOutput) ProtoMessage() {} func (*SoundcloudTracksOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{21} + return fileDescriptor_api_1182541e4358e084, []int{20} } func (m *SoundcloudTracksOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -907,7 +872,7 @@ func (m *SoundcloudTrackOutput) Reset() { *m = SoundcloudTrackOutput{} } func (m *SoundcloudTrackOutput) String() string { return proto.CompactTextString(m) } func (*SoundcloudTrackOutput) ProtoMessage() {} func (*SoundcloudTrackOutput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{22} + return fileDescriptor_api_1182541e4358e084, []int{21} } func (m *SoundcloudTrackOutput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -937,14 +902,14 @@ func (m *SoundcloudTrackOutput) XXX_DiscardUnknown() { var xxx_messageInfo_SoundcloudTrackOutput proto.InternalMessageInfo type SoundcloudPlaylistInput struct { - PlaylistId string `protobuf:"bytes,1,opt,name=playlist_id,json=playlistId,proto3" json:"playlist_id,omitempty"` + PlaylistId uint64 `protobuf:"varint,1,opt,name=playlist_id,json=playlistId,proto3" json:"playlist_id,omitempty"` } func (m *SoundcloudPlaylistInput) Reset() { *m = SoundcloudPlaylistInput{} } func (m *SoundcloudPlaylistInput) String() string { return proto.CompactTextString(m) } func (*SoundcloudPlaylistInput) ProtoMessage() {} func (*SoundcloudPlaylistInput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{23} + return fileDescriptor_api_1182541e4358e084, []int{22} } func (m *SoundcloudPlaylistInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -973,22 +938,22 @@ func (m *SoundcloudPlaylistInput) XXX_DiscardUnknown() { var xxx_messageInfo_SoundcloudPlaylistInput proto.InternalMessageInfo -func (m *SoundcloudPlaylistInput) GetPlaylistId() string { +func (m *SoundcloudPlaylistInput) GetPlaylistId() uint64 { if m != nil { return m.PlaylistId } - return "" + return 0 } type SoundcloudTrackInput struct { - TrackId string `protobuf:"bytes,1,opt,name=track_id,json=trackId,proto3" json:"track_id,omitempty"` + TrackId uint64 `protobuf:"varint,1,opt,name=track_id,json=trackId,proto3" json:"track_id,omitempty"` } func (m *SoundcloudTrackInput) Reset() { *m = SoundcloudTrackInput{} } func (m *SoundcloudTrackInput) String() string { return proto.CompactTextString(m) } func (*SoundcloudTrackInput) ProtoMessage() {} func (*SoundcloudTrackInput) Descriptor() ([]byte, []int) { - return fileDescriptor_api_a60198e59ba81f1d, []int{24} + return fileDescriptor_api_1182541e4358e084, []int{23} } func (m *SoundcloudTrackInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1017,11 +982,11 @@ func (m *SoundcloudTrackInput) XXX_DiscardUnknown() { var xxx_messageInfo_SoundcloudTrackInput proto.InternalMessageInfo -func (m *SoundcloudTrackInput) GetTrackId() string { +func (m *SoundcloudTrackInput) GetTrackId() uint64 { if m != nil { return m.TrackId } - return "" + return 0 } func init() { @@ -1043,7 +1008,6 @@ func init() { proto.RegisterType((*DashboardOutput)(nil), "calcbiz.server.DashboardOutput") proto.RegisterType((*SpreadshirtRandomOutput)(nil), "calcbiz.server.SpreadshirtRandomOutput") proto.RegisterType((*SpreadshirtAllOutput)(nil), "calcbiz.server.SpreadshirtAllOutput") - proto.RegisterType((*SoundcloudMeOutput)(nil), "calcbiz.server.SoundcloudMeOutput") proto.RegisterType((*SoundcloudPlaylistsOutput)(nil), "calcbiz.server.SoundcloudPlaylistsOutput") proto.RegisterType((*SoundcloudPlaylistOutput)(nil), "calcbiz.server.SoundcloudPlaylistOutput") proto.RegisterType((*SoundcloudTracksOutput)(nil), "calcbiz.server.SoundcloudTracksOutput") @@ -1077,11 +1041,11 @@ type ServerClient interface { SpreadshirtAll(ctx context.Context, in *Void, opts ...grpc.CallOption) (*SpreadshirtAllOutput, error) Wotd(ctx context.Context, in *Void, opts ...grpc.CallOption) (*WotdOutput, error) AlternateLogo(ctx context.Context, in *Void, opts ...grpc.CallOption) (*AlternateLogoOutput, error) - SoundcloudMe(ctx context.Context, in *Void, opts ...grpc.CallOption) (*SoundcloudMeOutput, error) - SoundcloudPlaylists(ctx context.Context, in *Void, opts ...grpc.CallOption) (*SoundcloudPlaylistsOutput, error) - SoundcloudPlaylist(ctx context.Context, in *SoundcloudPlaylistInput, opts ...grpc.CallOption) (*SoundcloudPlaylistOutput, error) - SoundcloudTracks(ctx context.Context, in *Void, opts ...grpc.CallOption) (*SoundcloudTracksOutput, error) - SoundcloudTrack(ctx context.Context, in *SoundcloudTrackInput, opts ...grpc.CallOption) (*SoundcloudTrackOutput, error) + SoundcloudMe(ctx context.Context, in *Void, opts ...grpc.CallOption) (*soundcloud.User, error) + SoundcloudPlaylists(ctx context.Context, in *Void, opts ...grpc.CallOption) (*soundcloud.Playlists, error) + SoundcloudPlaylist(ctx context.Context, in *SoundcloudPlaylistInput, opts ...grpc.CallOption) (*soundcloud.Playlist, error) + SoundcloudTracks(ctx context.Context, in *Void, opts ...grpc.CallOption) (*soundcloud.Tracks, error) + SoundcloudTrack(ctx context.Context, in *SoundcloudTrackInput, opts ...grpc.CallOption) (*soundcloud.Track, error) } type serverClient struct { @@ -1209,8 +1173,8 @@ func (c *serverClient) AlternateLogo(ctx context.Context, in *Void, opts ...grpc return out, nil } -func (c *serverClient) SoundcloudMe(ctx context.Context, in *Void, opts ...grpc.CallOption) (*SoundcloudMeOutput, error) { - out := new(SoundcloudMeOutput) +func (c *serverClient) SoundcloudMe(ctx context.Context, in *Void, opts ...grpc.CallOption) (*soundcloud.User, error) { + out := new(soundcloud.User) err := c.cc.Invoke(ctx, "/calcbiz.server.Server/SoundcloudMe", in, out, opts...) if err != nil { return nil, err @@ -1218,8 +1182,8 @@ func (c *serverClient) SoundcloudMe(ctx context.Context, in *Void, opts ...grpc. return out, nil } -func (c *serverClient) SoundcloudPlaylists(ctx context.Context, in *Void, opts ...grpc.CallOption) (*SoundcloudPlaylistsOutput, error) { - out := new(SoundcloudPlaylistsOutput) +func (c *serverClient) SoundcloudPlaylists(ctx context.Context, in *Void, opts ...grpc.CallOption) (*soundcloud.Playlists, error) { + out := new(soundcloud.Playlists) err := c.cc.Invoke(ctx, "/calcbiz.server.Server/SoundcloudPlaylists", in, out, opts...) if err != nil { return nil, err @@ -1227,8 +1191,8 @@ func (c *serverClient) SoundcloudPlaylists(ctx context.Context, in *Void, opts . return out, nil } -func (c *serverClient) SoundcloudPlaylist(ctx context.Context, in *SoundcloudPlaylistInput, opts ...grpc.CallOption) (*SoundcloudPlaylistOutput, error) { - out := new(SoundcloudPlaylistOutput) +func (c *serverClient) SoundcloudPlaylist(ctx context.Context, in *SoundcloudPlaylistInput, opts ...grpc.CallOption) (*soundcloud.Playlist, error) { + out := new(soundcloud.Playlist) err := c.cc.Invoke(ctx, "/calcbiz.server.Server/SoundcloudPlaylist", in, out, opts...) if err != nil { return nil, err @@ -1236,8 +1200,8 @@ func (c *serverClient) SoundcloudPlaylist(ctx context.Context, in *SoundcloudPla return out, nil } -func (c *serverClient) SoundcloudTracks(ctx context.Context, in *Void, opts ...grpc.CallOption) (*SoundcloudTracksOutput, error) { - out := new(SoundcloudTracksOutput) +func (c *serverClient) SoundcloudTracks(ctx context.Context, in *Void, opts ...grpc.CallOption) (*soundcloud.Tracks, error) { + out := new(soundcloud.Tracks) err := c.cc.Invoke(ctx, "/calcbiz.server.Server/SoundcloudTracks", in, out, opts...) if err != nil { return nil, err @@ -1245,8 +1209,8 @@ func (c *serverClient) SoundcloudTracks(ctx context.Context, in *Void, opts ...g return out, nil } -func (c *serverClient) SoundcloudTrack(ctx context.Context, in *SoundcloudTrackInput, opts ...grpc.CallOption) (*SoundcloudTrackOutput, error) { - out := new(SoundcloudTrackOutput) +func (c *serverClient) SoundcloudTrack(ctx context.Context, in *SoundcloudTrackInput, opts ...grpc.CallOption) (*soundcloud.Track, error) { + out := new(soundcloud.Track) err := c.cc.Invoke(ctx, "/calcbiz.server.Server/SoundcloudTrack", in, out, opts...) if err != nil { return nil, err @@ -1269,11 +1233,11 @@ type ServerServer interface { SpreadshirtAll(context.Context, *Void) (*SpreadshirtAllOutput, error) Wotd(context.Context, *Void) (*WotdOutput, error) AlternateLogo(context.Context, *Void) (*AlternateLogoOutput, error) - SoundcloudMe(context.Context, *Void) (*SoundcloudMeOutput, error) - SoundcloudPlaylists(context.Context, *Void) (*SoundcloudPlaylistsOutput, error) - SoundcloudPlaylist(context.Context, *SoundcloudPlaylistInput) (*SoundcloudPlaylistOutput, error) - SoundcloudTracks(context.Context, *Void) (*SoundcloudTracksOutput, error) - SoundcloudTrack(context.Context, *SoundcloudTrackInput) (*SoundcloudTrackOutput, error) + SoundcloudMe(context.Context, *Void) (*soundcloud.User, error) + SoundcloudPlaylists(context.Context, *Void) (*soundcloud.Playlists, error) + SoundcloudPlaylist(context.Context, *SoundcloudPlaylistInput) (*soundcloud.Playlist, error) + SoundcloudTracks(context.Context, *Void) (*soundcloud.Tracks, error) + SoundcloudTrack(context.Context, *SoundcloudTrackInput) (*soundcloud.Track, error) } func RegisterServerServer(s *grpc.Server, srv ServerServer) { @@ -2077,24 +2041,6 @@ func (m *SpreadshirtAllOutput) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *SoundcloudMeOutput) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SoundcloudMeOutput) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil -} - func (m *SoundcloudPlaylistsOutput) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2182,11 +2128,10 @@ func (m *SoundcloudPlaylistInput) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.PlaylistId) > 0 { - dAtA[i] = 0xa + if m.PlaylistId != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintApi(dAtA, i, uint64(len(m.PlaylistId))) - i += copy(dAtA[i:], m.PlaylistId) + i = encodeVarintApi(dAtA, i, uint64(m.PlaylistId)) } return i, nil } @@ -2206,11 +2151,10 @@ func (m *SoundcloudTrackInput) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.TrackId) > 0 { - dAtA[i] = 0xa + if m.TrackId != 0 { + dAtA[i] = 0x8 i++ - i = encodeVarintApi(dAtA, i, uint64(len(m.TrackId))) - i += copy(dAtA[i:], m.TrackId) + i = encodeVarintApi(dAtA, i, uint64(m.TrackId)) } return i, nil } @@ -2427,15 +2371,6 @@ func (m *SpreadshirtAllOutput) Size() (n int) { return n } -func (m *SoundcloudMeOutput) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *SoundcloudPlaylistsOutput) Size() (n int) { if m == nil { return 0 @@ -2478,9 +2413,8 @@ func (m *SoundcloudPlaylistInput) Size() (n int) { } var l int _ = l - l = len(m.PlaylistId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.PlaylistId != 0 { + n += 1 + sovApi(uint64(m.PlaylistId)) } return n } @@ -2491,9 +2425,8 @@ func (m *SoundcloudTrackInput) Size() (n int) { } var l int _ = l - l = len(m.TrackId) - if l > 0 { - n += 1 + l + sovApi(uint64(l)) + if m.TrackId != 0 { + n += 1 + sovApi(uint64(m.TrackId)) } return n } @@ -3691,56 +3624,6 @@ func (m *SpreadshirtAllOutput) Unmarshal(dAtA []byte) error { } return nil } -func (m *SoundcloudMeOutput) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApi - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SoundcloudMeOutput: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SoundcloudMeOutput: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipApi(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthApi - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *SoundcloudPlaylistsOutput) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3971,10 +3854,10 @@ func (m *SoundcloudPlaylistInput) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field PlaylistId", wireType) } - var stringLen uint64 + m.PlaylistId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -3984,21 +3867,11 @@ func (m *SoundcloudPlaylistInput) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + m.PlaylistId |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PlaylistId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -4050,10 +3923,10 @@ func (m *SoundcloudTrackInput) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field TrackId", wireType) } - var stringLen uint64 + m.TrackId = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowApi @@ -4063,21 +3936,11 @@ func (m *SoundcloudTrackInput) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + m.TrackId |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthApi - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TrackId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipApi(dAtA[iNdEx:]) @@ -4204,71 +4067,71 @@ var ( ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("api/api.proto", fileDescriptor_api_a60198e59ba81f1d) } - -var fileDescriptor_api_a60198e59ba81f1d = []byte{ - // 1001 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4d, 0x6f, 0xdb, 0x46, - 0x10, 0xb5, 0x1c, 0xd5, 0x8d, 0x27, 0xb1, 0x64, 0xaf, 0x65, 0x7d, 0xd0, 0xae, 0xac, 0x6c, 0xe2, - 0xd8, 0x2e, 0x10, 0x11, 0x6d, 0x6f, 0xb9, 0xa5, 0x89, 0x0f, 0x46, 0x9a, 0xc6, 0x90, 0x83, 0x06, - 0xc8, 0xa5, 0xa0, 0xc4, 0x15, 0xc5, 0x98, 0xe2, 0xb2, 0xcb, 0x65, 0x0d, 0xd7, 0xf0, 0xa5, 0xb7, - 0xde, 0x02, 0xf4, 0xd2, 0x9f, 0xd4, 0x63, 0x80, 0x5e, 0x7a, 0x2c, 0xec, 0xfe, 0x90, 0x62, 0x3f, - 0x48, 0x4a,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, - 0xff, 0xf4, 0x58, 0x71, 0x4c, 0x52, 0x0b, 0x00, 0x00, +func init() { proto.RegisterFile("api/api.proto", fileDescriptor_api_1182541e4358e084) } + +var fileDescriptor_api_1182541e4358e084 = []byte{ + // 1004 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xdb, 0xb6, + 0x17, 0x8f, 0x53, 0x7f, 0xf3, 0x6d, 0x5e, 0x1b, 0x3b, 0x61, 0x1c, 0xff, 0x50, 0x52, 0xdb, 0x65, + 0xdb, 0xb5, 0x19, 0x50, 0x0b, 0xdb, 0x6e, 0xbd, 0x75, 0x6d, 0x0e, 0x41, 0xd7, 0x35, 0x70, 0xba, + 0x15, 0xc8, 0x65, 0x90, 0x2d, 0x5a, 0x56, 0x23, 0x89, 0x1a, 0x45, 0x2d, 0xc8, 0x02, 0x5f, 0x76, + 0xde, 0x61, 0xc0, 0xfe, 0xa9, 0x1d, 0x0b, 0x0c, 0x03, 0x76, 0x1c, 0x92, 0xfd, 0x21, 0x03, 0x29, + 0x5a, 0xb4, 0x29, 0xab, 0x3b, 0xed, 0x62, 0x90, 0xef, 0x7d, 0xf8, 0xf9, 0xf0, 0xd1, 0xef, 0x87, + 0x60, 0xcb, 0x89, 0x7d, 0xdb, 0x89, 0xfd, 0x41, 0xcc, 0x28, 0xa7, 0xa8, 0x36, 0x76, 0x82, 0xf1, + 0xc8, 0xff, 0x71, 0x90, 0x10, 0xf6, 0x03, 0x61, 0xd6, 0x81, 0x47, 0xa9, 0x17, 0x10, 0x5b, 0xa2, + 0xa2, 0x88, 0x72, 0x87, 0xfb, 0x34, 0x4a, 0x32, 0xb4, 0xf5, 0xd4, 0xf3, 0xf9, 0x34, 0x1d, 0x0d, + 0xc6, 0x34, 0xb4, 0x3d, 0xea, 0x51, 0x5b, 0x9a, 0x47, 0xe9, 0x44, 0xee, 0xe4, 0x46, 0xae, 0x14, + 0x7c, 0x37, 0x3e, 0xf7, 0xec, 0x31, 0x23, 0x17, 0xf2, 0x47, 0x19, 0x7b, 0xc2, 0x98, 0xd0, 0x34, + 0x72, 0xc7, 0x01, 0x4d, 0xdd, 0x85, 0x65, 0x06, 0xc0, 0x1b, 0x50, 0xfd, 0x96, 0xfa, 0x2e, 0xb6, + 0xa0, 0x7a, 0x42, 0x23, 0x0f, 0x21, 0xa8, 0xc6, 0x34, 0xf2, 0xda, 0x95, 0x7e, 0xe5, 0xc9, 0xe6, + 0x50, 0xae, 0x31, 0x86, 0xbb, 0xaf, 0xd8, 0x65, 0xcc, 0x69, 0x72, 0x1c, 0xc5, 0x29, 0x17, 0x98, + 0x09, 0xa3, 0xe1, 0x1c, 0x23, 0xd6, 0xb8, 0x07, 0x5b, 0x0a, 0xf3, 0x26, 0xe5, 0x02, 0x54, 0x83, + 0x75, 0x4e, 0x15, 0x64, 0x9d, 0x53, 0xfc, 0x08, 0xea, 0x6f, 0xe3, 0x4b, 0x7a, 0x14, 0xd1, 0xb1, + 0x4b, 0x8e, 0xe3, 0x34, 0x5a, 0xcd, 0x83, 0x61, 0x5b, 0xc3, 0xde, 0xa4, 0x31, 0x5f, 0x41, 0xd5, + 0x82, 0xbd, 0x97, 0xce, 0x34, 0x19, 0x51, 0x87, 0xb9, 0x43, 0x27, 0x72, 0x69, 0x98, 0x69, 0xe2, + 0x43, 0xa8, 0x7f, 0x9d, 0x86, 0x23, 0xc2, 0xfc, 0x68, 0x42, 0xb3, 0xbb, 0x36, 0x61, 0x23, 0x92, + 0x26, 0x75, 0x5e, 0xed, 0x30, 0x82, 0x6d, 0x0d, 0x55, 0xc7, 0x3f, 0x81, 0xda, 0x6b, 0xea, 0xbf, + 0x77, 0xfc, 0x90, 0xa8, 0x20, 0x1a, 0xf0, 0xbf, 0x73, 0x7f, 0x32, 0x49, 0xda, 0x95, 0xfe, 0xad, + 0x27, 0x9b, 0xc3, 0x6c, 0x83, 0xfb, 0x00,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fb, 0x4a, 0x34, 0x97, 0x19, 0x7a, 0x07, 0xb7, 0xe7, 0xcd, 0xb0, + 0xe4, 0xb1, 0xba, 0xa6, 0x75, 0xb9, 0x79, 0xe2, 0x3d, 0xa9, 0x50, 0x47, 0x5b, 0x52, 0x21, 0x9c, + 0x93, 0x25, 0xb0, 0x53, 0xe8, 0x47, 0x25, 0x0a, 0x8f, 0x4d, 0x6b, 0x59, 0x23, 0x53, 0x99, 0x89, + 0x5a, 0x85, 0xcc, 0x64, 0x19, 0xff, 0x7b, 0xa8, 0x2d, 0x77, 0xba, 0x12, 0xc5, 0x87, 0x1f, 0x51, + 0xd4, 0xfd, 0xf1, 0x40, 0xca, 0x35, 0xd1, 0xca, 0x42, 0x40, 0xaf, 0xa0, 0x2a, 0xc6, 0x43, 0x89, + 0x82, 0x65, 0x5a, 0xf5, 0x28, 0x31, 0x52, 0xed, 0x42, 0x90, 0x78, 0xb0, 0xb5, 0x34, 0x49, 0x4a, + 0x58, 0x1f, 0x98, 0xd6, 0x15, 0xe3, 0x07, 0xef, 0x4b, 0xfa, 0x3d, 0xb4, 0x9b, 0x7d, 0x70, 0xcc, + 0x11, 0x4f, 0x03, 0xc1, 0x7b, 0x06, 0x77, 0x75, 0x2f, 0x7d, 0x5d, 0xf6, 0x9f, 0xb7, 0xb5, 0x55, + 0x7f, 0x49, 0x7c, 0x93, 0x10, 0x86, 0x2d, 0x49, 0xde, 0x40, 0x28, 0x7b, 0x13, 0xfd, 0xc9, 0x11, + 0x12, 0x14, 0xc2, 0xee, 0x8a, 0x79, 0x52, 0x22, 0x71, 0x6f, 0x95, 0x44, 0x7e, 0x08, 0xdf, 0x97, + 0x3a, 0xfb, 0xa8, 0x63, 0xea, 0xc4, 0x39, 0xef, 0xcf, 0x15, 0x40, 0x45, 0x3d, 0x54, 0xcc, 0xa6, + 0xd5, 0x73, 0xc7, 0x3a, 0xf8, 0xd8, 0x0d, 0xb0, 0x2d, 0x2f, 0x70, 0x88, 0x1e, 0x97, 0x5e, 0xc0, + 0xbe, 0x5a, 0x18, 0x5b, 0x33, 0xe4, 0xc2, 0xb6, 0x39, 0x14, 0xff, 0x3d, 0x37, 0xb4, 0x70, 0x76, + 0xc2, 0xa8, 0xd7, 0x05, 0x59, 0x9e, 0x31, 0xce, 0xa0, 0x6e, 0xa8, 0xa0, 0x87, 0xe5, 0x01, 0xeb, + 0x61, 0x69, 0x75, 0x4a, 0x45, 0xf1, 0xa1, 0xd4, 0x7c, 0x80, 0xee, 0xaf, 0xd6, 0xb4, 0xaf, 0xe6, + 0x53, 0x76, 0xf6, 0xe5, 0xe0, 0xb7, 0xeb, 0x6e, 0xe5, 0xc3, 0x75, 0xb7, 0xf2, 0xd7, 0x75, 0xb7, + 0xf2, 0xcb, 0x4d, 0x77, 0xed, 0xc3, 0x4d, 0x77, 0xed, 0xcf, 0x9b, 0xee, 0xda, 0x59, 0x23, 0x0d, + 0x38, 0x23, 0x83, 0x90, 0xd8, 0x4a, 0x47, 0x90, 0x8d, 0x36, 0xe4, 0xe7, 0xe7, 0x17, 0xff, 0x04, + 0x00, 0x00, 0xff, 0xff, 0x00, 0xf0, 0x59, 0x5c, 0x22, 0x0b, 0x00, 0x00, } diff --git a/api/api.pb.gw.go b/api/api.pb.gw.go index 4eb37092..3ebc82e8 100644 --- a/api/api.pb.gw.go +++ b/api/api.pb.gw.go @@ -227,7 +227,7 @@ func request_Server_SoundcloudPlaylist_0(ctx context.Context, marshaler runtime. return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "playlist_id") } - protoReq.PlaylistId, err = runtime.String(val) + protoReq.PlaylistId, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "playlist_id", err) @@ -263,7 +263,7 @@ func request_Server_SoundcloudTrack_0(ctx context.Context, marshaler runtime.Mar return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "track_id") } - protoReq.TrackId, err = runtime.String(val) + protoReq.TrackId, err = runtime.Uint64(val) if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "track_id", err) diff --git a/api/api.proto b/api/api.proto index e65a7b1f..e9ad747c 100644 --- a/api/api.proto +++ b/api/api.proto @@ -6,6 +6,7 @@ import "google/api/annotations.proto"; import "github.com/gogo/protobuf/gogoproto/gogo.proto"; //import "google/protobuf/timestamp.proto"; import "pkg/crew/crew.proto"; +import "pkg/soundcloud/soundcloud.proto"; option go_package = "ultre.me/calcbiz/api"; option (gogoproto.sizer_all) = true; @@ -41,11 +42,11 @@ service Server { rpc SpreadshirtAll(Void) returns (SpreadshirtAllOutput) { option (google.api.http) = {get: "/api/spreadshirt/all"}; } rpc Wotd(Void) returns (WotdOutput) { option (google.api.http) = {get: "/api/wotd"}; } rpc AlternateLogo(Void) returns (AlternateLogoOutput) { option (google.api.http) = {get: "/api/alternate-logo"}; } - rpc SoundcloudMe(Void) returns (SoundcloudMeOutput) { option (google.api.http) = {get: "/api/soundcloud/me"}; } - rpc SoundcloudPlaylists(Void) returns (SoundcloudPlaylistsOutput) { option (google.api.http) = {get: "/api/soundcloud/playlists"}; } - rpc SoundcloudPlaylist(SoundcloudPlaylistInput) returns (SoundcloudPlaylistOutput) { option (google.api.http) = {get: "/api/soundcloud/playlists/{playlist_id}"}; } - rpc SoundcloudTracks(Void) returns (SoundcloudTracksOutput) { option (google.api.http) = {get: "/api/soundcloud/tracks"}; } - rpc SoundcloudTrack(SoundcloudTrackInput) returns (SoundcloudTrackOutput) { option (google.api.http) = {get: "/api/soundcloud/tracks/{track_id}"}; } + rpc SoundcloudMe(Void) returns (calcbiz.soundcloud.User) { option (google.api.http) = {get: "/api/soundcloud/me"}; } + rpc SoundcloudPlaylists(Void) returns (calcbiz.soundcloud.Playlists) { option (google.api.http) = {get: "/api/soundcloud/playlists"}; } + rpc SoundcloudPlaylist(SoundcloudPlaylistInput) returns (calcbiz.soundcloud.Playlist) { option (google.api.http) = {get: "/api/soundcloud/playlists/{playlist_id}"}; } + rpc SoundcloudTracks(Void) returns (calcbiz.soundcloud.Tracks) { option (google.api.http) = {get: "/api/soundcloud/tracks"}; } + rpc SoundcloudTrack(SoundcloudTrackInput) returns (calcbiz.soundcloud.Track) { option (google.api.http) = {get: "/api/soundcloud/tracks/{track_id}"}; } // SoundcloudAlbums // Airtable... @@ -75,10 +76,15 @@ message RecettatorOutput { /* TODO */ } message DashboardOutput { /* TODO */ } message SpreadshirtRandomOutput { /* TODO */ } message SpreadshirtAllOutput { /* TODO */ } -message SoundcloudMeOutput { /* TODO */ } message SoundcloudPlaylistsOutput { /* TODO */ } message SoundcloudPlaylistOutput { /* TODO */ } message SoundcloudTracksOutput { /* TODO */ } message SoundcloudTrackOutput { /* TODO */ } -message SoundcloudPlaylistInput { string playlist_id = 1; } -message SoundcloudTrackInput { string track_id = 1; } + +message SoundcloudPlaylistInput { + uint64 playlist_id = 1; +} + +message SoundcloudTrackInput { + uint64 track_id = 1; +} diff --git a/go.mod b/go.mod index e759d808..89fe22ed 100644 --- a/go.mod +++ b/go.mod @@ -21,6 +21,7 @@ require ( go.uber.org/multierr v1.1.0 // indirect go.uber.org/zap v1.9.1 golang.org/x/net v0.0.0-20190110044637-be1c187aa6c6 + google.golang.org/appengine v1.2.0 // indirect google.golang.org/genproto v0.0.0-20190108161440-ae2f86662275 google.golang.org/grpc v1.17.0 ultre.me/kryptos v0.0.0-20181023194748-240fe1a16033 diff --git a/main.go b/main.go index dc4aa578..986ec5ed 100644 --- a/main.go +++ b/main.go @@ -43,7 +43,7 @@ func main() { app.Before = func(c *cli.Context) error { config := zap.NewDevelopmentConfig() config.Level.SetLevel(zap.DebugLevel) - config.DisableStacktrace = true + config.DisableStacktrace = false config.EncoderConfig.EncodeLevel = zapcore.CapitalColorLevelEncoder l, err := config.Build() if err != nil { @@ -108,8 +108,8 @@ func serverOptionsFromCliContext(c *cli.Context) serverOptions { GRPCBind: c.String("grpc-bind"), HTTPBind: c.String("http-bind"), ServiceOptions: svc.Options{ - SoundcloudUserID: c.Int("soundcloud-client-id"), - SoundcloudClientID: c.String("soundcloud-user-id"), + SoundcloudUserID: c.Int("soundcloud-user-id"), + SoundcloudClientID: c.String("soundcloud-client-id"), }, } } @@ -146,7 +146,10 @@ func startHTTPServer(ctx context.Context, opts *serverOptions) error { box := packr.NewBox("./static") mux.Handle("/", http.FileServer(box)) - return http.ListenAndServe(opts.HTTPBind, handlers.LoggingHandler(os.Stderr, mux)) + handler := handlers.LoggingHandler(os.Stderr, mux) + handler = handlers.RecoveryHandler(handlers.PrintRecoveryStack(true))(handler) + + return http.ListenAndServe(opts.HTTPBind, handler) } func startGRPCServer(ctx context.Context, opts *serverOptions) error { @@ -201,27 +204,3 @@ func startGRPCServer(ctx context.Context, opts *serverOptions) error { zap.L().Info("starting gRPC server", zap.String("bind", opts.GRPCBind)) return grpcServer.Serve(listener) } - -/* - - r := chi.NewRouter() - //r.Use(middleware.RequestID) - //r.Use(middleware.RealIP) - r.Use(middleware.Logger) - r.Use(middleware.Recoverer) - //r.Use(middleware.URLFormat) - r.Use(middleware.Timeout(5 * time.Second)) - - - }) - - // static files - box := packr.NewBox("./static") - r.Handle("/", http.FileServer(box)) - - // FIXME: handle socket.io - http.Handle("/", r) - log.Infof("Listening and serving HTTP on %s", c.String("bind-address")) - return http.ListenAndServe(c.String("bind-address"), nil) -} -*/ diff --git a/pkg/soundcloud/soundcloud.go b/pkg/soundcloud/soundcloud.go index c1128dfa..a598bdf8 100644 --- a/pkg/soundcloud/soundcloud.go +++ b/pkg/soundcloud/soundcloud.go @@ -1,4 +1,4 @@ -package calcsoundcloud +package soundcloud import ( "math/rand" @@ -6,19 +6,19 @@ import ( "strings" "github.com/shazow/memoizer" - "github.com/yanatan16/golang-soundcloud/soundcloud" + gosoundcloud "github.com/yanatan16/golang-soundcloud/soundcloud" ) -type CALCSoundcloud struct { - client *soundcloud.Api +type Soundcloud struct { + client *gosoundcloud.Api clientID string userID uint64 cache memoizer.Memoize } -func New(clientID string, userID uint64) CALCSoundcloud { - return CALCSoundcloud{ - client: &soundcloud.Api{ +func New(clientID string, userID uint64) Soundcloud { + return Soundcloud{ + client: &gosoundcloud.Api{ ClientId: clientID, }, clientID: clientID, @@ -29,50 +29,198 @@ func New(clientID string, userID uint64) CALCSoundcloud { } } -func (s *CALCSoundcloud) EscapeString(input string) string { +func (s *Soundcloud) EscapeString(input string) string { return strings.Replace(input, s.clientID, "", -1) } -func (s *CALCSoundcloud) Me() (*soundcloud.User, error) { +func (s *Soundcloud) Me() (*User, error) { user, err := s.cache.Call(s.client.User(s.userID).Get, url.Values{}) - return user.(*soundcloud.User), err + if err != nil { + return nil, err + } + return fromSoundcloudUser(user.(*gosoundcloud.User)), nil } -func (s *CALCSoundcloud) Playlists() ([]*soundcloud.Playlist, error) { +func (s *Soundcloud) GetPlaylists() (*Playlists, error) { playlists, err := s.cache.Call(s.client.User(s.userID).Playlists, url.Values{}) - return playlists.([]*soundcloud.Playlist), err + if err != nil { + return nil, err + } + return fromSoundcloudPlaylists(playlists.([]*gosoundcloud.Playlist)), nil } -func (s *CALCSoundcloud) Playlist(playlistID uint64) (*soundcloud.Playlist, error) { - inline := func(playlistID uint64) (*soundcloud.Playlist, error) { +func (s *Soundcloud) GetPlaylist(playlistID uint64) (*Playlist, error) { + inline := func(playlistID uint64) (*gosoundcloud.Playlist, error) { return s.client.Playlist(playlistID).Get(nil) } playlist, err := s.cache.Call(inline, playlistID) - return playlist.(*soundcloud.Playlist), err + if err != nil { + return nil, err + } + return fromSoundcloudPlaylist(playlist.(*gosoundcloud.Playlist)), nil } -func (s *CALCSoundcloud) Track(trackID uint64) (*soundcloud.Track, error) { - inline := func(trackID uint64) (*soundcloud.Track, error) { +func (s *Soundcloud) GetTrack(trackID uint64) (*Track, error) { + inline := func(trackID uint64) (*gosoundcloud.Track, error) { return s.client.Track(trackID).Get(nil) } track, err := s.cache.Call(inline, trackID) - return track.(*soundcloud.Track), err + if err != nil { + return nil, err + } + return fromSoundcloudTrack(track.(*gosoundcloud.Track)), nil +} + +func (s *Soundcloud) GetRandomTrack() (*Track, error) { + tracks, err := s.GetTracks() + if err != nil { + return nil, err + } + + return tracks.Tracks[rand.Intn(len(tracks.Tracks))], nil } -func (s *CALCSoundcloud) RandomTrack() (*soundcloud.Track, error) { - tracks, err := s.tracks() +func (s *Soundcloud) GetRandomPlaylist() (*Playlist, error) { + playlists, err := s.GetPlaylists() if err != nil { return nil, err } - return tracks[rand.Intn(len(tracks))], nil + return playlists.Playlists[rand.Intn(len(playlists.Playlists))], nil } -func (s *CALCSoundcloud) tracks() ([]*soundcloud.Track, error) { +func (s *Soundcloud) GetTracks() (*Tracks, error) { tracks, err := s.cache.Call(s.client.User(s.userID).Tracks, url.Values{}) - return tracks.([]*soundcloud.Track), err + if err != nil { + return nil, err + } + return fromSoundcloudTracks(tracks.([]*gosoundcloud.Track)), nil +} + +func fromSoundcloudPlaylists(input []*gosoundcloud.Playlist) *Playlists { + playlists := &Playlists{} + for _, playlist := range input { + playlists.Playlists = append(playlists.Playlists, fromSoundcloudPlaylist(playlist)) + } + return playlists +} + +func fromSoundcloudTracks(input []*gosoundcloud.Track) *Tracks { + tracks := &Tracks{} + for _, track := range input { + tracks.Tracks = append(tracks.Tracks, fromSoundcloudTrack(track)) + } + return tracks } -func (s *CALCSoundcloud) Tracks() ([]*soundcloud.Track, error) { - return s.tracks() +func fromSoundcloudPlaylist(input *gosoundcloud.Playlist) *Playlist { + return &Playlist{ + ID: input.Id, + CreatedAt: input.CreatedAt, + Title: input.Title, + Sharing: input.Sharing, + EmbeddableBy: input.EmbeddableBy, + PurchaseUrl: input.PurchaseUrl, + ArtworkUrl: input.ArtworkUrl, + Description: input.Description, + Duration: input.Duration, + Genre: input.Genre, + SharedToCount: input.SharedToCount, + TagList: input.TagList, + ReleaseDay: uint32(input.ReleaseDay), + ReleaseMonth: uint32(input.ReleaseMonth), + ReleaseYear: uint32(input.ReleaseYear), + Streamable: input.Streamable, + Downloadable: input.Downloadable, + Ean: input.EAN, + PlaylistType: input.PlaylistType, + Tracks: fromSoundcloudTracks(input.Tracks).Tracks, + Uri: input.Uri, + Label: fromSoundcloudUser(input.Label), + LabelId: input.LabelId, + LabelName: input.LabelName, + User: fromSoundcloudUser(input.User), + UserId: input.UserId, + Permalink: input.Permalink, + PermalinkUrl: input.PermalinkUrl, + } +} + +func fromSoundcloudTrack(input *gosoundcloud.Track) *Track { + return &Track{ + ID: input.Id, + CreatedAt: input.CreatedAt, + Title: input.Title, + Sharing: input.Sharing, + EmbeddableBy: input.EmbeddableBy, + PurchaseUrl: input.PurchaseUrl, + ArtworkUrl: input.ArtworkUrl, + Description: input.Description, + Duration: input.Duration, + Genre: input.Genre, + SharedToCount: input.SharedToCount, + TagList: input.TagList, + ReleaseDay: uint32(input.ReleaseDay), + ReleaseMonth: uint32(input.ReleaseMonth), + ReleaseYear: uint32(input.ReleaseYear), + Streamable: input.Streamable, + Downloadable: input.Downloadable, + State: input.State, + License: input.License, + TrackType: input.TrackType, + WaveformUrl: input.WaveformUrl, + DownloadUrl: input.DownloadUrl, + StreamUrl: input.StreamUrl, + VideoUrl: input.VideoUrl, + Bpm: float32(input.Bpm), + Commentable: input.Commentable, + ISRC: input.ISRC, + KeySignature: input.KeySignature, + CommentCount: input.CommentCount, + DownloadCount: input.DownloadCount, + PlaybackCount: input.PlaybackCount, + FavoritingsCount: input.FavoritingsCount, + OriginalFormat: input.OriginalFormat, + OriginalContentSize: input.OriginalContentSize, + AssetData: input.AssetData, + ArtworkData: input.ArtworkData, + UserFavorite: input.UserFavorite, + Uri: input.Uri, + Label: fromSoundcloudUser(input.Label), + LabelId: input.LabelId, + LabelName: input.LabelName, + User: fromSoundcloudUser(input.User), + UserId: input.UserId, + Permalink: input.Permalink, + PermalinkUrl: input.PermalinkUrl, + } +} + +func fromSoundcloudUser(input *gosoundcloud.User) *User { + if input == nil { + return nil + } + return &User{ + ID: input.Id, + Username: input.Username, + AvatarURL: input.AvatarUrl, + Country: input.Country, + FullName: input.FullName, + City: input.City, + Description: input.Description, + DiscogsName: input.DiscogsName, + MyspaceName: input.MyspaceName, + Website: input.Website, + WebsiteTitle: input.WebsiteTitle, + Online: input.Online, + TrackCount: input.TrackCount, + PlaylistCount: input.PlaylistCount, + FollowersCount: input.FollowersCount, + FollowingsCount: input.FollowingsCount, + PublicFavoritesCount: input.PublicFavoritesCount, + AvatarData: input.AvatarData, + Uri: input.Uri, + Permalink: input.Permalink, + PermalinkURL: input.PermalinkUrl, + } } diff --git a/pkg/soundcloud/soundcloud.pb.go b/pkg/soundcloud/soundcloud.pb.go new file mode 100644 index 00000000..ea65257d --- /dev/null +++ b/pkg/soundcloud/soundcloud.pb.go @@ -0,0 +1,5120 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pkg/soundcloud/soundcloud.proto + +package soundcloud // import "ultre.me/calcbiz/pkg/soundcloud" + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "google.golang.org/genproto/googleapis/api/annotations" + +import encoding_binary "encoding/binary" + +import io "io" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +type User struct { + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + AvatarURL string `protobuf:"bytes,3,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + Country string `protobuf:"bytes,4,opt,name=country,proto3" json:"country,omitempty"` + FullName string `protobuf:"bytes,5,opt,name=full_name,json=fullName,proto3" json:"full_name,omitempty"` + City string `protobuf:"bytes,6,opt,name=city,proto3" json:"city,omitempty"` + Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` + DiscogsName string `protobuf:"bytes,8,opt,name=discogs_name,json=discogsName,proto3" json:"discogs_name,omitempty"` + MyspaceName string `protobuf:"bytes,9,opt,name=myspace_name,json=myspaceName,proto3" json:"myspace_name,omitempty"` + Website string `protobuf:"bytes,10,opt,name=website,proto3" json:"website,omitempty"` + WebsiteTitle string `protobuf:"bytes,11,opt,name=website_title,json=websiteTitle,proto3" json:"website_title,omitempty"` + Online bool `protobuf:"varint,12,opt,name=online,proto3" json:"online,omitempty"` + TrackCount uint64 `protobuf:"varint,13,opt,name=track_count,json=trackCount,proto3" json:"track_count,omitempty"` + PlaylistCount uint64 `protobuf:"varint,14,opt,name=playlist_count,json=playlistCount,proto3" json:"playlist_count,omitempty"` + FollowersCount uint64 `protobuf:"varint,15,opt,name=followers_count,json=followersCount,proto3" json:"followers_count,omitempty"` + FollowingsCount uint64 `protobuf:"varint,16,opt,name=followings_count,json=followingsCount,proto3" json:"followings_count,omitempty"` + PublicFavoritesCount uint64 `protobuf:"varint,17,opt,name=public_favorites_count,json=publicFavoritesCount,proto3" json:"public_favorites_count,omitempty"` + AvatarData []byte `protobuf:"bytes,18,opt,name=avatar_data,json=avatarData,proto3" json:"avatar_data,omitempty"` + Uri string `protobuf:"bytes,19,opt,name=uri,proto3" json:"uri,omitempty"` + Permalink string `protobuf:"bytes,20,opt,name=permalink,proto3" json:"permalink,omitempty"` + PermalinkURL string `protobuf:"bytes,21,opt,name=permalink_url,json=permalinkUrl,proto3" json:"permalink_url,omitempty"` +} + +func (m *User) Reset() { *m = User{} } +func (m *User) String() string { return proto.CompactTextString(m) } +func (*User) ProtoMessage() {} +func (*User) Descriptor() ([]byte, []int) { + return fileDescriptor_soundcloud_205f1aff27f92dc6, []int{0} +} +func (m *User) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_User.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *User) XXX_Merge(src proto.Message) { + xxx_messageInfo_User.Merge(dst, src) +} +func (m *User) XXX_Size() int { + return m.Size() +} +func (m *User) XXX_DiscardUnknown() { + xxx_messageInfo_User.DiscardUnknown(m) +} + +var xxx_messageInfo_User proto.InternalMessageInfo + +func (m *User) GetID() uint64 { + if m != nil { + return m.ID + } + return 0 +} + +func (m *User) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *User) GetAvatarURL() string { + if m != nil { + return m.AvatarURL + } + return "" +} + +func (m *User) GetCountry() string { + if m != nil { + return m.Country + } + return "" +} + +func (m *User) GetFullName() string { + if m != nil { + return m.FullName + } + return "" +} + +func (m *User) GetCity() string { + if m != nil { + return m.City + } + return "" +} + +func (m *User) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *User) GetDiscogsName() string { + if m != nil { + return m.DiscogsName + } + return "" +} + +func (m *User) GetMyspaceName() string { + if m != nil { + return m.MyspaceName + } + return "" +} + +func (m *User) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *User) GetWebsiteTitle() string { + if m != nil { + return m.WebsiteTitle + } + return "" +} + +func (m *User) GetOnline() bool { + if m != nil { + return m.Online + } + return false +} + +func (m *User) GetTrackCount() uint64 { + if m != nil { + return m.TrackCount + } + return 0 +} + +func (m *User) GetPlaylistCount() uint64 { + if m != nil { + return m.PlaylistCount + } + return 0 +} + +func (m *User) GetFollowersCount() uint64 { + if m != nil { + return m.FollowersCount + } + return 0 +} + +func (m *User) GetFollowingsCount() uint64 { + if m != nil { + return m.FollowingsCount + } + return 0 +} + +func (m *User) GetPublicFavoritesCount() uint64 { + if m != nil { + return m.PublicFavoritesCount + } + return 0 +} + +func (m *User) GetAvatarData() []byte { + if m != nil { + return m.AvatarData + } + return nil +} + +func (m *User) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *User) GetPermalink() string { + if m != nil { + return m.Permalink + } + return "" +} + +func (m *User) GetPermalinkURL() string { + if m != nil { + return m.PermalinkURL + } + return "" +} + +type Playlists struct { + Playlists []*Playlist `protobuf:"bytes,1,rep,name=playlists" json:"playlists,omitempty"` +} + +func (m *Playlists) Reset() { *m = Playlists{} } +func (m *Playlists) String() string { return proto.CompactTextString(m) } +func (*Playlists) ProtoMessage() {} +func (*Playlists) Descriptor() ([]byte, []int) { + return fileDescriptor_soundcloud_205f1aff27f92dc6, []int{1} +} +func (m *Playlists) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Playlists) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Playlists.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Playlists) XXX_Merge(src proto.Message) { + xxx_messageInfo_Playlists.Merge(dst, src) +} +func (m *Playlists) XXX_Size() int { + return m.Size() +} +func (m *Playlists) XXX_DiscardUnknown() { + xxx_messageInfo_Playlists.DiscardUnknown(m) +} + +var xxx_messageInfo_Playlists proto.InternalMessageInfo + +func (m *Playlists) GetPlaylists() []*Playlist { + if m != nil { + return m.Playlists + } + return nil +} + +type Playlist struct { + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt string `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + Sharing string `protobuf:"bytes,4,opt,name=sharing,proto3" json:"sharing,omitempty"` + EmbeddableBy string `protobuf:"bytes,5,opt,name=embeddable_by,json=embeddableBy,proto3" json:"embeddable_by,omitempty"` + PurchaseUrl string `protobuf:"bytes,6,opt,name=purchase_url,json=purchaseUrl,proto3" json:"purchase_url,omitempty"` + ArtworkUrl string `protobuf:"bytes,7,opt,name=artwork_url,json=artworkUrl,proto3" json:"artwork_url,omitempty"` + Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` + Duration uint64 `protobuf:"varint,9,opt,name=duration,proto3" json:"duration,omitempty"` + Genre string `protobuf:"bytes,10,opt,name=genre,proto3" json:"genre,omitempty"` + SharedToCount uint64 `protobuf:"varint,11,opt,name=shared_to_count,json=sharedToCount,proto3" json:"shared_to_count,omitempty"` + TagList string `protobuf:"bytes,12,opt,name=tag_list,json=tagList,proto3" json:"tag_list,omitempty"` + // uint64 release = 13; + ReleaseDay uint32 `protobuf:"varint,14,opt,name=release_day,json=releaseDay,proto3" json:"release_day,omitempty"` + ReleaseMonth uint32 `protobuf:"varint,15,opt,name=release_month,json=releaseMonth,proto3" json:"release_month,omitempty"` + ReleaseYear uint32 `protobuf:"varint,16,opt,name=release_year,json=releaseYear,proto3" json:"release_year,omitempty"` + Streamable bool `protobuf:"varint,17,opt,name=streamable,proto3" json:"streamable,omitempty"` + Downloadable bool `protobuf:"varint,18,opt,name=downloadable,proto3" json:"downloadable,omitempty"` + Ean string `protobuf:"bytes,19,opt,name=ean,proto3" json:"ean,omitempty"` + PlaylistType string `protobuf:"bytes,20,opt,name=playlist_type,json=playlistType,proto3" json:"playlist_type,omitempty"` + Tracks []*Track `protobuf:"bytes,21,rep,name=tracks" json:"tracks,omitempty"` + Uri string `protobuf:"bytes,22,opt,name=uri,proto3" json:"uri,omitempty"` + Label *User `protobuf:"bytes,23,opt,name=label" json:"label,omitempty"` + LabelId uint64 `protobuf:"varint,24,opt,name=label_id,json=labelId,proto3" json:"label_id,omitempty"` + LabelName string `protobuf:"bytes,25,opt,name=label_name,json=labelName,proto3" json:"label_name,omitempty"` + User *User `protobuf:"bytes,26,opt,name=user" json:"user,omitempty"` + UserId uint64 `protobuf:"varint,27,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Permalink string `protobuf:"bytes,28,opt,name=permalink,proto3" json:"permalink,omitempty"` + PermalinkUrl string `protobuf:"bytes,29,opt,name=permalink_url,json=permalinkUrl,proto3" json:"permalink_url,omitempty"` +} + +func (m *Playlist) Reset() { *m = Playlist{} } +func (m *Playlist) String() string { return proto.CompactTextString(m) } +func (*Playlist) ProtoMessage() {} +func (*Playlist) Descriptor() ([]byte, []int) { + return fileDescriptor_soundcloud_205f1aff27f92dc6, []int{2} +} +func (m *Playlist) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Playlist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Playlist.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Playlist) XXX_Merge(src proto.Message) { + xxx_messageInfo_Playlist.Merge(dst, src) +} +func (m *Playlist) XXX_Size() int { + return m.Size() +} +func (m *Playlist) XXX_DiscardUnknown() { + xxx_messageInfo_Playlist.DiscardUnknown(m) +} + +var xxx_messageInfo_Playlist proto.InternalMessageInfo + +func (m *Playlist) GetID() uint64 { + if m != nil { + return m.ID + } + return 0 +} + +func (m *Playlist) GetCreatedAt() string { + if m != nil { + return m.CreatedAt + } + return "" +} + +func (m *Playlist) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Playlist) GetSharing() string { + if m != nil { + return m.Sharing + } + return "" +} + +func (m *Playlist) GetEmbeddableBy() string { + if m != nil { + return m.EmbeddableBy + } + return "" +} + +func (m *Playlist) GetPurchaseUrl() string { + if m != nil { + return m.PurchaseUrl + } + return "" +} + +func (m *Playlist) GetArtworkUrl() string { + if m != nil { + return m.ArtworkUrl + } + return "" +} + +func (m *Playlist) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Playlist) GetDuration() uint64 { + if m != nil { + return m.Duration + } + return 0 +} + +func (m *Playlist) GetGenre() string { + if m != nil { + return m.Genre + } + return "" +} + +func (m *Playlist) GetSharedToCount() uint64 { + if m != nil { + return m.SharedToCount + } + return 0 +} + +func (m *Playlist) GetTagList() string { + if m != nil { + return m.TagList + } + return "" +} + +func (m *Playlist) GetReleaseDay() uint32 { + if m != nil { + return m.ReleaseDay + } + return 0 +} + +func (m *Playlist) GetReleaseMonth() uint32 { + if m != nil { + return m.ReleaseMonth + } + return 0 +} + +func (m *Playlist) GetReleaseYear() uint32 { + if m != nil { + return m.ReleaseYear + } + return 0 +} + +func (m *Playlist) GetStreamable() bool { + if m != nil { + return m.Streamable + } + return false +} + +func (m *Playlist) GetDownloadable() bool { + if m != nil { + return m.Downloadable + } + return false +} + +func (m *Playlist) GetEan() string { + if m != nil { + return m.Ean + } + return "" +} + +func (m *Playlist) GetPlaylistType() string { + if m != nil { + return m.PlaylistType + } + return "" +} + +func (m *Playlist) GetTracks() []*Track { + if m != nil { + return m.Tracks + } + return nil +} + +func (m *Playlist) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *Playlist) GetLabel() *User { + if m != nil { + return m.Label + } + return nil +} + +func (m *Playlist) GetLabelId() uint64 { + if m != nil { + return m.LabelId + } + return 0 +} + +func (m *Playlist) GetLabelName() string { + if m != nil { + return m.LabelName + } + return "" +} + +func (m *Playlist) GetUser() *User { + if m != nil { + return m.User + } + return nil +} + +func (m *Playlist) GetUserId() uint64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Playlist) GetPermalink() string { + if m != nil { + return m.Permalink + } + return "" +} + +func (m *Playlist) GetPermalinkUrl() string { + if m != nil { + return m.PermalinkUrl + } + return "" +} + +type Tracks struct { + Tracks []*Track `protobuf:"bytes,1,rep,name=tracks" json:"tracks,omitempty"` +} + +func (m *Tracks) Reset() { *m = Tracks{} } +func (m *Tracks) String() string { return proto.CompactTextString(m) } +func (*Tracks) ProtoMessage() {} +func (*Tracks) Descriptor() ([]byte, []int) { + return fileDescriptor_soundcloud_205f1aff27f92dc6, []int{3} +} +func (m *Tracks) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Tracks) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Tracks.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Tracks) XXX_Merge(src proto.Message) { + xxx_messageInfo_Tracks.Merge(dst, src) +} +func (m *Tracks) XXX_Size() int { + return m.Size() +} +func (m *Tracks) XXX_DiscardUnknown() { + xxx_messageInfo_Tracks.DiscardUnknown(m) +} + +var xxx_messageInfo_Tracks proto.InternalMessageInfo + +func (m *Tracks) GetTracks() []*Track { + if m != nil { + return m.Tracks + } + return nil +} + +type Track struct { + ID uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + CreatedAt string `protobuf:"bytes,2,opt,name=CreatedAt,proto3" json:"CreatedAt,omitempty"` + Title string `protobuf:"bytes,3,opt,name=Title,proto3" json:"Title,omitempty"` + Sharing string `protobuf:"bytes,4,opt,name=Sharing,proto3" json:"Sharing,omitempty"` + EmbeddableBy string `protobuf:"bytes,5,opt,name=EmbeddableBy,proto3" json:"EmbeddableBy,omitempty"` + PurchaseUrl string `protobuf:"bytes,6,opt,name=PurchaseUrl,proto3" json:"PurchaseUrl,omitempty"` + ArtworkUrl string `protobuf:"bytes,7,opt,name=ArtworkUrl,proto3" json:"ArtworkUrl,omitempty"` + Description string `protobuf:"bytes,8,opt,name=Description,proto3" json:"Description,omitempty"` + Duration uint64 `protobuf:"varint,9,opt,name=Duration,proto3" json:"Duration,omitempty"` + Genre string `protobuf:"bytes,10,opt,name=Genre,proto3" json:"Genre,omitempty"` + SharedToCount uint64 `protobuf:"varint,11,opt,name=SharedToCount,proto3" json:"SharedToCount,omitempty"` + TagList string `protobuf:"bytes,12,opt,name=TagList,proto3" json:"TagList,omitempty"` + // uint64 Release = 13; + ReleaseDay uint32 `protobuf:"varint,14,opt,name=ReleaseDay,proto3" json:"ReleaseDay,omitempty"` + ReleaseMonth uint32 `protobuf:"varint,15,opt,name=ReleaseMonth,proto3" json:"ReleaseMonth,omitempty"` + ReleaseYear uint32 `protobuf:"varint,16,opt,name=ReleaseYear,proto3" json:"ReleaseYear,omitempty"` + Streamable bool `protobuf:"varint,17,opt,name=Streamable,proto3" json:"Streamable,omitempty"` + Downloadable bool `protobuf:"varint,18,opt,name=Downloadable,proto3" json:"Downloadable,omitempty"` + State string `protobuf:"bytes,19,opt,name=State,proto3" json:"State,omitempty"` + License string `protobuf:"bytes,20,opt,name=License,proto3" json:"License,omitempty"` + TrackType string `protobuf:"bytes,21,opt,name=TrackType,proto3" json:"TrackType,omitempty"` + WaveformUrl string `protobuf:"bytes,22,opt,name=WaveformUrl,proto3" json:"WaveformUrl,omitempty"` + DownloadUrl string `protobuf:"bytes,23,opt,name=DownloadUrl,proto3" json:"DownloadUrl,omitempty"` + StreamUrl string `protobuf:"bytes,24,opt,name=StreamUrl,proto3" json:"StreamUrl,omitempty"` + VideoUrl string `protobuf:"bytes,25,opt,name=VideoUrl,proto3" json:"VideoUrl,omitempty"` + Bpm float32 `protobuf:"fixed32,26,opt,name=Bpm,proto3" json:"Bpm,omitempty"` + Commentable bool `protobuf:"varint,27,opt,name=Commentable,proto3" json:"Commentable,omitempty"` + ISRC string `protobuf:"bytes,28,opt,name=ISRC,proto3" json:"ISRC,omitempty"` + KeySignature string `protobuf:"bytes,29,opt,name=KeySignature,proto3" json:"KeySignature,omitempty"` + CommentCount uint64 `protobuf:"varint,30,opt,name=CommentCount,proto3" json:"CommentCount,omitempty"` + DownloadCount uint64 `protobuf:"varint,31,opt,name=DownloadCount,proto3" json:"DownloadCount,omitempty"` + PlaybackCount uint64 `protobuf:"varint,32,opt,name=PlaybackCount,proto3" json:"PlaybackCount,omitempty"` + FavoritingsCount uint64 `protobuf:"varint,33,opt,name=FavoritingsCount,proto3" json:"FavoritingsCount,omitempty"` + OriginalFormat string `protobuf:"bytes,34,opt,name=OriginalFormat,proto3" json:"OriginalFormat,omitempty"` + OriginalContentSize uint64 `protobuf:"varint,35,opt,name=OriginalContentSize,proto3" json:"OriginalContentSize,omitempty"` + // App created_with = 36; + AssetData []byte `protobuf:"bytes,37,opt,name=AssetData,proto3" json:"AssetData,omitempty"` + ArtworkData []byte `protobuf:"bytes,38,opt,name=ArtworkData,proto3" json:"ArtworkData,omitempty"` + UserFavorite bool `protobuf:"varint,39,opt,name=UserFavorite,proto3" json:"UserFavorite,omitempty"` + Uri string `protobuf:"bytes,40,opt,name=uri,proto3" json:"uri,omitempty"` + Label *User `protobuf:"bytes,41,opt,name=label" json:"label,omitempty"` + LabelId uint64 `protobuf:"varint,42,opt,name=label_id,json=labelId,proto3" json:"label_id,omitempty"` + LabelName string `protobuf:"bytes,43,opt,name=label_name,json=labelName,proto3" json:"label_name,omitempty"` + User *User `protobuf:"bytes,44,opt,name=user" json:"user,omitempty"` + UserId uint64 `protobuf:"varint,45,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Permalink string `protobuf:"bytes,46,opt,name=permalink,proto3" json:"permalink,omitempty"` + PermalinkUrl string `protobuf:"bytes,47,opt,name=permalink_url,json=permalinkUrl,proto3" json:"permalink_url,omitempty"` +} + +func (m *Track) Reset() { *m = Track{} } +func (m *Track) String() string { return proto.CompactTextString(m) } +func (*Track) ProtoMessage() {} +func (*Track) Descriptor() ([]byte, []int) { + return fileDescriptor_soundcloud_205f1aff27f92dc6, []int{4} +} +func (m *Track) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Track) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Track.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (dst *Track) XXX_Merge(src proto.Message) { + xxx_messageInfo_Track.Merge(dst, src) +} +func (m *Track) XXX_Size() int { + return m.Size() +} +func (m *Track) XXX_DiscardUnknown() { + xxx_messageInfo_Track.DiscardUnknown(m) +} + +var xxx_messageInfo_Track proto.InternalMessageInfo + +func (m *Track) GetID() uint64 { + if m != nil { + return m.ID + } + return 0 +} + +func (m *Track) GetCreatedAt() string { + if m != nil { + return m.CreatedAt + } + return "" +} + +func (m *Track) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *Track) GetSharing() string { + if m != nil { + return m.Sharing + } + return "" +} + +func (m *Track) GetEmbeddableBy() string { + if m != nil { + return m.EmbeddableBy + } + return "" +} + +func (m *Track) GetPurchaseUrl() string { + if m != nil { + return m.PurchaseUrl + } + return "" +} + +func (m *Track) GetArtworkUrl() string { + if m != nil { + return m.ArtworkUrl + } + return "" +} + +func (m *Track) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *Track) GetDuration() uint64 { + if m != nil { + return m.Duration + } + return 0 +} + +func (m *Track) GetGenre() string { + if m != nil { + return m.Genre + } + return "" +} + +func (m *Track) GetSharedToCount() uint64 { + if m != nil { + return m.SharedToCount + } + return 0 +} + +func (m *Track) GetTagList() string { + if m != nil { + return m.TagList + } + return "" +} + +func (m *Track) GetReleaseDay() uint32 { + if m != nil { + return m.ReleaseDay + } + return 0 +} + +func (m *Track) GetReleaseMonth() uint32 { + if m != nil { + return m.ReleaseMonth + } + return 0 +} + +func (m *Track) GetReleaseYear() uint32 { + if m != nil { + return m.ReleaseYear + } + return 0 +} + +func (m *Track) GetStreamable() bool { + if m != nil { + return m.Streamable + } + return false +} + +func (m *Track) GetDownloadable() bool { + if m != nil { + return m.Downloadable + } + return false +} + +func (m *Track) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *Track) GetLicense() string { + if m != nil { + return m.License + } + return "" +} + +func (m *Track) GetTrackType() string { + if m != nil { + return m.TrackType + } + return "" +} + +func (m *Track) GetWaveformUrl() string { + if m != nil { + return m.WaveformUrl + } + return "" +} + +func (m *Track) GetDownloadUrl() string { + if m != nil { + return m.DownloadUrl + } + return "" +} + +func (m *Track) GetStreamUrl() string { + if m != nil { + return m.StreamUrl + } + return "" +} + +func (m *Track) GetVideoUrl() string { + if m != nil { + return m.VideoUrl + } + return "" +} + +func (m *Track) GetBpm() float32 { + if m != nil { + return m.Bpm + } + return 0 +} + +func (m *Track) GetCommentable() bool { + if m != nil { + return m.Commentable + } + return false +} + +func (m *Track) GetISRC() string { + if m != nil { + return m.ISRC + } + return "" +} + +func (m *Track) GetKeySignature() string { + if m != nil { + return m.KeySignature + } + return "" +} + +func (m *Track) GetCommentCount() uint64 { + if m != nil { + return m.CommentCount + } + return 0 +} + +func (m *Track) GetDownloadCount() uint64 { + if m != nil { + return m.DownloadCount + } + return 0 +} + +func (m *Track) GetPlaybackCount() uint64 { + if m != nil { + return m.PlaybackCount + } + return 0 +} + +func (m *Track) GetFavoritingsCount() uint64 { + if m != nil { + return m.FavoritingsCount + } + return 0 +} + +func (m *Track) GetOriginalFormat() string { + if m != nil { + return m.OriginalFormat + } + return "" +} + +func (m *Track) GetOriginalContentSize() uint64 { + if m != nil { + return m.OriginalContentSize + } + return 0 +} + +func (m *Track) GetAssetData() []byte { + if m != nil { + return m.AssetData + } + return nil +} + +func (m *Track) GetArtworkData() []byte { + if m != nil { + return m.ArtworkData + } + return nil +} + +func (m *Track) GetUserFavorite() bool { + if m != nil { + return m.UserFavorite + } + return false +} + +func (m *Track) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *Track) GetLabel() *User { + if m != nil { + return m.Label + } + return nil +} + +func (m *Track) GetLabelId() uint64 { + if m != nil { + return m.LabelId + } + return 0 +} + +func (m *Track) GetLabelName() string { + if m != nil { + return m.LabelName + } + return "" +} + +func (m *Track) GetUser() *User { + if m != nil { + return m.User + } + return nil +} + +func (m *Track) GetUserId() uint64 { + if m != nil { + return m.UserId + } + return 0 +} + +func (m *Track) GetPermalink() string { + if m != nil { + return m.Permalink + } + return "" +} + +func (m *Track) GetPermalinkUrl() string { + if m != nil { + return m.PermalinkUrl + } + return "" +} + +func init() { + proto.RegisterType((*User)(nil), "calcbiz.soundcloud.User") + proto.RegisterType((*Playlists)(nil), "calcbiz.soundcloud.Playlists") + proto.RegisterType((*Playlist)(nil), "calcbiz.soundcloud.Playlist") + proto.RegisterType((*Tracks)(nil), "calcbiz.soundcloud.Tracks") + proto.RegisterType((*Track)(nil), "calcbiz.soundcloud.Track") +} +func (m *User) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *User) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ID != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ID)) + } + if len(m.Username) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Username))) + i += copy(dAtA[i:], m.Username) + } + if len(m.AvatarURL) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.AvatarURL))) + i += copy(dAtA[i:], m.AvatarURL) + } + if len(m.Country) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Country))) + i += copy(dAtA[i:], m.Country) + } + if len(m.FullName) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.FullName))) + i += copy(dAtA[i:], m.FullName) + } + if len(m.City) > 0 { + dAtA[i] = 0x32 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.City))) + i += copy(dAtA[i:], m.City) + } + if len(m.Description) > 0 { + dAtA[i] = 0x3a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if len(m.DiscogsName) > 0 { + dAtA[i] = 0x42 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.DiscogsName))) + i += copy(dAtA[i:], m.DiscogsName) + } + if len(m.MyspaceName) > 0 { + dAtA[i] = 0x4a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.MyspaceName))) + i += copy(dAtA[i:], m.MyspaceName) + } + if len(m.Website) > 0 { + dAtA[i] = 0x52 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Website))) + i += copy(dAtA[i:], m.Website) + } + if len(m.WebsiteTitle) > 0 { + dAtA[i] = 0x5a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.WebsiteTitle))) + i += copy(dAtA[i:], m.WebsiteTitle) + } + if m.Online { + dAtA[i] = 0x60 + i++ + if m.Online { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.TrackCount != 0 { + dAtA[i] = 0x68 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.TrackCount)) + } + if m.PlaylistCount != 0 { + dAtA[i] = 0x70 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.PlaylistCount)) + } + if m.FollowersCount != 0 { + dAtA[i] = 0x78 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.FollowersCount)) + } + if m.FollowingsCount != 0 { + dAtA[i] = 0x80 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.FollowingsCount)) + } + if m.PublicFavoritesCount != 0 { + dAtA[i] = 0x88 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.PublicFavoritesCount)) + } + if len(m.AvatarData) > 0 { + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.AvatarData))) + i += copy(dAtA[i:], m.AvatarData) + } + if len(m.Uri) > 0 { + dAtA[i] = 0x9a + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Uri))) + i += copy(dAtA[i:], m.Uri) + } + if len(m.Permalink) > 0 { + dAtA[i] = 0xa2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Permalink))) + i += copy(dAtA[i:], m.Permalink) + } + if len(m.PermalinkURL) > 0 { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.PermalinkURL))) + i += copy(dAtA[i:], m.PermalinkURL) + } + return i, nil +} + +func (m *Playlists) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Playlists) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Playlists) > 0 { + for _, msg := range m.Playlists { + dAtA[i] = 0xa + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *Playlist) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Playlist) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ID != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ID)) + } + if len(m.CreatedAt) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.CreatedAt))) + i += copy(dAtA[i:], m.CreatedAt) + } + if len(m.Title) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Title))) + i += copy(dAtA[i:], m.Title) + } + if len(m.Sharing) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Sharing))) + i += copy(dAtA[i:], m.Sharing) + } + if len(m.EmbeddableBy) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.EmbeddableBy))) + i += copy(dAtA[i:], m.EmbeddableBy) + } + if len(m.PurchaseUrl) > 0 { + dAtA[i] = 0x32 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.PurchaseUrl))) + i += copy(dAtA[i:], m.PurchaseUrl) + } + if len(m.ArtworkUrl) > 0 { + dAtA[i] = 0x3a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.ArtworkUrl))) + i += copy(dAtA[i:], m.ArtworkUrl) + } + if len(m.Description) > 0 { + dAtA[i] = 0x42 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if m.Duration != 0 { + dAtA[i] = 0x48 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.Duration)) + } + if len(m.Genre) > 0 { + dAtA[i] = 0x52 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Genre))) + i += copy(dAtA[i:], m.Genre) + } + if m.SharedToCount != 0 { + dAtA[i] = 0x58 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.SharedToCount)) + } + if len(m.TagList) > 0 { + dAtA[i] = 0x62 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.TagList))) + i += copy(dAtA[i:], m.TagList) + } + if m.ReleaseDay != 0 { + dAtA[i] = 0x70 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ReleaseDay)) + } + if m.ReleaseMonth != 0 { + dAtA[i] = 0x78 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ReleaseMonth)) + } + if m.ReleaseYear != 0 { + dAtA[i] = 0x80 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ReleaseYear)) + } + if m.Streamable { + dAtA[i] = 0x88 + i++ + dAtA[i] = 0x1 + i++ + if m.Streamable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.Downloadable { + dAtA[i] = 0x90 + i++ + dAtA[i] = 0x1 + i++ + if m.Downloadable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.Ean) > 0 { + dAtA[i] = 0x9a + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Ean))) + i += copy(dAtA[i:], m.Ean) + } + if len(m.PlaylistType) > 0 { + dAtA[i] = 0xa2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.PlaylistType))) + i += copy(dAtA[i:], m.PlaylistType) + } + if len(m.Tracks) > 0 { + for _, msg := range m.Tracks { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.Uri) > 0 { + dAtA[i] = 0xb2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Uri))) + i += copy(dAtA[i:], m.Uri) + } + if m.Label != nil { + dAtA[i] = 0xba + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.Label.Size())) + n1, err := m.Label.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.LabelId != 0 { + dAtA[i] = 0xc0 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.LabelId)) + } + if len(m.LabelName) > 0 { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.LabelName))) + i += copy(dAtA[i:], m.LabelName) + } + if m.User != nil { + dAtA[i] = 0xd2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.User.Size())) + n2, err := m.User.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + if m.UserId != 0 { + dAtA[i] = 0xd8 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.UserId)) + } + if len(m.Permalink) > 0 { + dAtA[i] = 0xe2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Permalink))) + i += copy(dAtA[i:], m.Permalink) + } + if len(m.PermalinkUrl) > 0 { + dAtA[i] = 0xea + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.PermalinkUrl))) + i += copy(dAtA[i:], m.PermalinkUrl) + } + return i, nil +} + +func (m *Tracks) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Tracks) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Tracks) > 0 { + for _, msg := range m.Tracks { + dAtA[i] = 0xa + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func (m *Track) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Track) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ID != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ID)) + } + if len(m.CreatedAt) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.CreatedAt))) + i += copy(dAtA[i:], m.CreatedAt) + } + if len(m.Title) > 0 { + dAtA[i] = 0x1a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Title))) + i += copy(dAtA[i:], m.Title) + } + if len(m.Sharing) > 0 { + dAtA[i] = 0x22 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Sharing))) + i += copy(dAtA[i:], m.Sharing) + } + if len(m.EmbeddableBy) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.EmbeddableBy))) + i += copy(dAtA[i:], m.EmbeddableBy) + } + if len(m.PurchaseUrl) > 0 { + dAtA[i] = 0x32 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.PurchaseUrl))) + i += copy(dAtA[i:], m.PurchaseUrl) + } + if len(m.ArtworkUrl) > 0 { + dAtA[i] = 0x3a + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.ArtworkUrl))) + i += copy(dAtA[i:], m.ArtworkUrl) + } + if len(m.Description) > 0 { + dAtA[i] = 0x42 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Description))) + i += copy(dAtA[i:], m.Description) + } + if m.Duration != 0 { + dAtA[i] = 0x48 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.Duration)) + } + if len(m.Genre) > 0 { + dAtA[i] = 0x52 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Genre))) + i += copy(dAtA[i:], m.Genre) + } + if m.SharedToCount != 0 { + dAtA[i] = 0x58 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.SharedToCount)) + } + if len(m.TagList) > 0 { + dAtA[i] = 0x62 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.TagList))) + i += copy(dAtA[i:], m.TagList) + } + if m.ReleaseDay != 0 { + dAtA[i] = 0x70 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ReleaseDay)) + } + if m.ReleaseMonth != 0 { + dAtA[i] = 0x78 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ReleaseMonth)) + } + if m.ReleaseYear != 0 { + dAtA[i] = 0x80 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.ReleaseYear)) + } + if m.Streamable { + dAtA[i] = 0x88 + i++ + dAtA[i] = 0x1 + i++ + if m.Streamable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.Downloadable { + dAtA[i] = 0x90 + i++ + dAtA[i] = 0x1 + i++ + if m.Downloadable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.State) > 0 { + dAtA[i] = 0x9a + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.State))) + i += copy(dAtA[i:], m.State) + } + if len(m.License) > 0 { + dAtA[i] = 0xa2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.License))) + i += copy(dAtA[i:], m.License) + } + if len(m.TrackType) > 0 { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.TrackType))) + i += copy(dAtA[i:], m.TrackType) + } + if len(m.WaveformUrl) > 0 { + dAtA[i] = 0xb2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.WaveformUrl))) + i += copy(dAtA[i:], m.WaveformUrl) + } + if len(m.DownloadUrl) > 0 { + dAtA[i] = 0xba + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.DownloadUrl))) + i += copy(dAtA[i:], m.DownloadUrl) + } + if len(m.StreamUrl) > 0 { + dAtA[i] = 0xc2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.StreamUrl))) + i += copy(dAtA[i:], m.StreamUrl) + } + if len(m.VideoUrl) > 0 { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.VideoUrl))) + i += copy(dAtA[i:], m.VideoUrl) + } + if m.Bpm != 0 { + dAtA[i] = 0xd5 + i++ + dAtA[i] = 0x1 + i++ + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(math.Float32bits(float32(m.Bpm)))) + i += 4 + } + if m.Commentable { + dAtA[i] = 0xd8 + i++ + dAtA[i] = 0x1 + i++ + if m.Commentable { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.ISRC) > 0 { + dAtA[i] = 0xe2 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.ISRC))) + i += copy(dAtA[i:], m.ISRC) + } + if len(m.KeySignature) > 0 { + dAtA[i] = 0xea + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.KeySignature))) + i += copy(dAtA[i:], m.KeySignature) + } + if m.CommentCount != 0 { + dAtA[i] = 0xf0 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.CommentCount)) + } + if m.DownloadCount != 0 { + dAtA[i] = 0xf8 + i++ + dAtA[i] = 0x1 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.DownloadCount)) + } + if m.PlaybackCount != 0 { + dAtA[i] = 0x80 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.PlaybackCount)) + } + if m.FavoritingsCount != 0 { + dAtA[i] = 0x88 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.FavoritingsCount)) + } + if len(m.OriginalFormat) > 0 { + dAtA[i] = 0x92 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.OriginalFormat))) + i += copy(dAtA[i:], m.OriginalFormat) + } + if m.OriginalContentSize != 0 { + dAtA[i] = 0x98 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.OriginalContentSize)) + } + if len(m.AssetData) > 0 { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.AssetData))) + i += copy(dAtA[i:], m.AssetData) + } + if len(m.ArtworkData) > 0 { + dAtA[i] = 0xb2 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.ArtworkData))) + i += copy(dAtA[i:], m.ArtworkData) + } + if m.UserFavorite { + dAtA[i] = 0xb8 + i++ + dAtA[i] = 0x2 + i++ + if m.UserFavorite { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.Uri) > 0 { + dAtA[i] = 0xc2 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Uri))) + i += copy(dAtA[i:], m.Uri) + } + if m.Label != nil { + dAtA[i] = 0xca + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.Label.Size())) + n3, err := m.Label.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + } + if m.LabelId != 0 { + dAtA[i] = 0xd0 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.LabelId)) + } + if len(m.LabelName) > 0 { + dAtA[i] = 0xda + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.LabelName))) + i += copy(dAtA[i:], m.LabelName) + } + if m.User != nil { + dAtA[i] = 0xe2 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.User.Size())) + n4, err := m.User.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n4 + } + if m.UserId != 0 { + dAtA[i] = 0xe8 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(m.UserId)) + } + if len(m.Permalink) > 0 { + dAtA[i] = 0xf2 + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.Permalink))) + i += copy(dAtA[i:], m.Permalink) + } + if len(m.PermalinkUrl) > 0 { + dAtA[i] = 0xfa + i++ + dAtA[i] = 0x2 + i++ + i = encodeVarintSoundcloud(dAtA, i, uint64(len(m.PermalinkUrl))) + i += copy(dAtA[i:], m.PermalinkUrl) + } + return i, nil +} + +func encodeVarintSoundcloud(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *User) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovSoundcloud(uint64(m.ID)) + } + l = len(m.Username) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.AvatarURL) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Country) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.FullName) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.City) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.DiscogsName) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.MyspaceName) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.WebsiteTitle) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + if m.Online { + n += 2 + } + if m.TrackCount != 0 { + n += 1 + sovSoundcloud(uint64(m.TrackCount)) + } + if m.PlaylistCount != 0 { + n += 1 + sovSoundcloud(uint64(m.PlaylistCount)) + } + if m.FollowersCount != 0 { + n += 1 + sovSoundcloud(uint64(m.FollowersCount)) + } + if m.FollowingsCount != 0 { + n += 2 + sovSoundcloud(uint64(m.FollowingsCount)) + } + if m.PublicFavoritesCount != 0 { + n += 2 + sovSoundcloud(uint64(m.PublicFavoritesCount)) + } + l = len(m.AvatarData) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Uri) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Permalink) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.PermalinkURL) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + return n +} + +func (m *Playlists) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Playlists) > 0 { + for _, e := range m.Playlists { + l = e.Size() + n += 1 + l + sovSoundcloud(uint64(l)) + } + } + return n +} + +func (m *Playlist) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovSoundcloud(uint64(m.ID)) + } + l = len(m.CreatedAt) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Sharing) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.EmbeddableBy) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.PurchaseUrl) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.ArtworkUrl) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + if m.Duration != 0 { + n += 1 + sovSoundcloud(uint64(m.Duration)) + } + l = len(m.Genre) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + if m.SharedToCount != 0 { + n += 1 + sovSoundcloud(uint64(m.SharedToCount)) + } + l = len(m.TagList) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + if m.ReleaseDay != 0 { + n += 1 + sovSoundcloud(uint64(m.ReleaseDay)) + } + if m.ReleaseMonth != 0 { + n += 1 + sovSoundcloud(uint64(m.ReleaseMonth)) + } + if m.ReleaseYear != 0 { + n += 2 + sovSoundcloud(uint64(m.ReleaseYear)) + } + if m.Streamable { + n += 3 + } + if m.Downloadable { + n += 3 + } + l = len(m.Ean) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.PlaylistType) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if len(m.Tracks) > 0 { + for _, e := range m.Tracks { + l = e.Size() + n += 2 + l + sovSoundcloud(uint64(l)) + } + } + l = len(m.Uri) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.Label != nil { + l = m.Label.Size() + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.LabelId != 0 { + n += 2 + sovSoundcloud(uint64(m.LabelId)) + } + l = len(m.LabelName) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.User != nil { + l = m.User.Size() + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.UserId != 0 { + n += 2 + sovSoundcloud(uint64(m.UserId)) + } + l = len(m.Permalink) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.PermalinkUrl) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + return n +} + +func (m *Tracks) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Tracks) > 0 { + for _, e := range m.Tracks { + l = e.Size() + n += 1 + l + sovSoundcloud(uint64(l)) + } + } + return n +} + +func (m *Track) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ID != 0 { + n += 1 + sovSoundcloud(uint64(m.ID)) + } + l = len(m.CreatedAt) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Sharing) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.EmbeddableBy) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.PurchaseUrl) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.ArtworkUrl) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + if m.Duration != 0 { + n += 1 + sovSoundcloud(uint64(m.Duration)) + } + l = len(m.Genre) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + if m.SharedToCount != 0 { + n += 1 + sovSoundcloud(uint64(m.SharedToCount)) + } + l = len(m.TagList) + if l > 0 { + n += 1 + l + sovSoundcloud(uint64(l)) + } + if m.ReleaseDay != 0 { + n += 1 + sovSoundcloud(uint64(m.ReleaseDay)) + } + if m.ReleaseMonth != 0 { + n += 1 + sovSoundcloud(uint64(m.ReleaseMonth)) + } + if m.ReleaseYear != 0 { + n += 2 + sovSoundcloud(uint64(m.ReleaseYear)) + } + if m.Streamable { + n += 3 + } + if m.Downloadable { + n += 3 + } + l = len(m.State) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.License) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.TrackType) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.WaveformUrl) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.DownloadUrl) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.StreamUrl) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.VideoUrl) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.Bpm != 0 { + n += 6 + } + if m.Commentable { + n += 3 + } + l = len(m.ISRC) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.KeySignature) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.CommentCount != 0 { + n += 2 + sovSoundcloud(uint64(m.CommentCount)) + } + if m.DownloadCount != 0 { + n += 2 + sovSoundcloud(uint64(m.DownloadCount)) + } + if m.PlaybackCount != 0 { + n += 2 + sovSoundcloud(uint64(m.PlaybackCount)) + } + if m.FavoritingsCount != 0 { + n += 2 + sovSoundcloud(uint64(m.FavoritingsCount)) + } + l = len(m.OriginalFormat) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.OriginalContentSize != 0 { + n += 2 + sovSoundcloud(uint64(m.OriginalContentSize)) + } + l = len(m.AssetData) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.ArtworkData) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.UserFavorite { + n += 3 + } + l = len(m.Uri) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.Label != nil { + l = m.Label.Size() + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.LabelId != 0 { + n += 2 + sovSoundcloud(uint64(m.LabelId)) + } + l = len(m.LabelName) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.User != nil { + l = m.User.Size() + n += 2 + l + sovSoundcloud(uint64(l)) + } + if m.UserId != 0 { + n += 2 + sovSoundcloud(uint64(m.UserId)) + } + l = len(m.Permalink) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + l = len(m.PermalinkUrl) + if l > 0 { + n += 2 + l + sovSoundcloud(uint64(l)) + } + return n +} + +func sovSoundcloud(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozSoundcloud(x uint64) (n int) { + return sovSoundcloud(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *User) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: User: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Username", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Username = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AvatarURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AvatarURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Country", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Country = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FullName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FullName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field City", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.City = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DiscogsName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DiscogsName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MyspaceName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MyspaceName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WebsiteTitle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WebsiteTitle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Online", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Online = bool(v != 0) + case 13: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TrackCount", wireType) + } + m.TrackCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TrackCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PlaylistCount", wireType) + } + m.PlaylistCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PlaylistCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FollowersCount", wireType) + } + m.FollowersCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FollowersCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FollowingsCount", wireType) + } + m.FollowingsCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FollowingsCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PublicFavoritesCount", wireType) + } + m.PublicFavoritesCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PublicFavoritesCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AvatarData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AvatarData = append(m.AvatarData[:0], dAtA[iNdEx:postIndex]...) + if m.AvatarData == nil { + m.AvatarData = []byte{} + } + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permalink", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permalink = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PermalinkURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PermalinkURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSoundcloud(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSoundcloud + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Playlists) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Playlists: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Playlists: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Playlists", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Playlists = append(m.Playlists, &Playlist{}) + if err := m.Playlists[len(m.Playlists)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSoundcloud(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSoundcloud + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Playlist) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Playlist: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Playlist: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreatedAt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sharing", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sharing = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EmbeddableBy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EmbeddableBy = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PurchaseUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PurchaseUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArtworkUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ArtworkUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + m.Duration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Duration |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Genre", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Genre = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedToCount", wireType) + } + m.SharedToCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SharedToCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TagList", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TagList = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReleaseDay", wireType) + } + m.ReleaseDay = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReleaseDay |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReleaseMonth", wireType) + } + m.ReleaseMonth = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReleaseMonth |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReleaseYear", wireType) + } + m.ReleaseYear = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReleaseYear |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Streamable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Streamable = bool(v != 0) + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Downloadable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Downloadable = bool(v != 0) + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ean", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ean = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PlaylistType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PlaylistType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tracks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tracks = append(m.Tracks, &Track{}) + if err := m.Tracks[len(m.Tracks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Label == nil { + m.Label = &User{} + } + if err := m.Label.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 24: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LabelId", wireType) + } + m.LabelId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LabelId |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LabelName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LabelName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 26: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.User == nil { + m.User = &User{} + } + if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 28: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permalink", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permalink = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 29: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PermalinkUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PermalinkUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSoundcloud(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSoundcloud + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Tracks) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Tracks: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Tracks: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tracks", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tracks = append(m.Tracks, &Track{}) + if err := m.Tracks[len(m.Tracks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSoundcloud(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSoundcloud + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Track) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Track: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Track: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CreatedAt = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sharing", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sharing = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EmbeddableBy", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EmbeddableBy = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PurchaseUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PurchaseUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArtworkUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ArtworkUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + m.Duration = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Duration |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Genre", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Genre = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SharedToCount", wireType) + } + m.SharedToCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SharedToCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TagList", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TagList = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReleaseDay", wireType) + } + m.ReleaseDay = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReleaseDay |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 15: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReleaseMonth", wireType) + } + m.ReleaseMonth = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReleaseMonth |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ReleaseYear", wireType) + } + m.ReleaseYear = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ReleaseYear |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Streamable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Streamable = bool(v != 0) + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Downloadable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Downloadable = bool(v != 0) + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.State = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field License", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.License = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 21: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrackType", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TrackType = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 22: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WaveformUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WaveformUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DownloadUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DownloadUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 24: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StreamUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StreamUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 25: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VideoUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VideoUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 26: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Bpm", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + v = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + m.Bpm = float32(math.Float32frombits(v)) + case 27: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Commentable", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Commentable = bool(v != 0) + case 28: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ISRC", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ISRC = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 29: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field KeySignature", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.KeySignature = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 30: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CommentCount", wireType) + } + m.CommentCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CommentCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 31: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DownloadCount", wireType) + } + m.DownloadCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DownloadCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 32: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PlaybackCount", wireType) + } + m.PlaybackCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PlaybackCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 33: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FavoritingsCount", wireType) + } + m.FavoritingsCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FavoritingsCount |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 34: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OriginalFormat", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OriginalFormat = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 35: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OriginalContentSize", wireType) + } + m.OriginalContentSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OriginalContentSize |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 37: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AssetData = append(m.AssetData[:0], dAtA[iNdEx:postIndex]...) + if m.AssetData == nil { + m.AssetData = []byte{} + } + iNdEx = postIndex + case 38: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ArtworkData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + byteLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ArtworkData = append(m.ArtworkData[:0], dAtA[iNdEx:postIndex]...) + if m.ArtworkData == nil { + m.ArtworkData = []byte{} + } + iNdEx = postIndex + case 39: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserFavorite", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.UserFavorite = bool(v != 0) + case 40: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 41: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Label == nil { + m.Label = &User{} + } + if err := m.Label.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 42: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LabelId", wireType) + } + m.LabelId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LabelId |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 43: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LabelName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LabelName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 44: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.User == nil { + m.User = &User{} + } + if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 45: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UserId", wireType) + } + m.UserId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UserId |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 46: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Permalink", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Permalink = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 47: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PermalinkUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSoundcloud + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PermalinkUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSoundcloud(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSoundcloud + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSoundcloud(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthSoundcloud + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSoundcloud + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipSoundcloud(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthSoundcloud = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSoundcloud = fmt.Errorf("proto: integer overflow") +) + +func init() { + proto.RegisterFile("pkg/soundcloud/soundcloud.proto", fileDescriptor_soundcloud_205f1aff27f92dc6) +} + +var fileDescriptor_soundcloud_205f1aff27f92dc6 = []byte{ + // 1394 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x97, 0xdd, 0x72, 0x13, 0xb7, + 0x1b, 0xc6, 0x71, 0x48, 0xfc, 0x21, 0xdb, 0x49, 0xfe, 0x02, 0x82, 0x08, 0xc1, 0x36, 0xe1, 0x0f, + 0x18, 0x0a, 0x76, 0x4b, 0xdb, 0x83, 0xb6, 0x47, 0x49, 0x5c, 0x98, 0x4c, 0x29, 0x65, 0xd6, 0x4e, + 0x3b, 0xed, 0x89, 0x47, 0xde, 0x55, 0x36, 0x3b, 0xac, 0x57, 0x1e, 0xad, 0x96, 0x8c, 0xb9, 0x88, + 0x4e, 0x6f, 0xa3, 0x77, 0xd2, 0x83, 0x1e, 0x70, 0xd8, 0x23, 0xa6, 0x13, 0x6e, 0xa4, 0xf3, 0xbe, + 0x92, 0xec, 0x75, 0x3e, 0x4a, 0x39, 0x8a, 0xde, 0x47, 0xcf, 0xae, 0x56, 0xef, 0x3e, 0x3f, 0x65, + 0x4d, 0x9a, 0x93, 0x57, 0x61, 0x37, 0x95, 0x59, 0x12, 0xf8, 0xb1, 0xcc, 0x82, 0xdc, 0xb0, 0x33, + 0x51, 0x52, 0x4b, 0x4a, 0x7d, 0x1e, 0xfb, 0xa3, 0xe8, 0x4d, 0x67, 0x3e, 0xb3, 0xb9, 0x15, 0x4a, + 0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xfa, 0x83, 0x8a, 0xc2, 0x28, 0xe1, 0xf1, + 0x53, 0xa9, 0xc6, 0x5c, 0xb3, 0x6d, 0xdc, 0xc1, 0x29, 0x95, 0x7e, 0x4a, 0xae, 0x38, 0x65, 0x4f, + 0x26, 0x5a, 0x24, 0xba, 0x1f, 0xbd, 0x11, 0xec, 0x0e, 0xde, 0xf6, 0xbc, 0x29, 0x78, 0x37, 0x3b, + 0x69, 0x2a, 0x34, 0x7c, 0xcc, 0xb0, 0xbb, 0xf8, 0x79, 0x33, 0x17, 0xa0, 0xdb, 0x96, 0x4b, 0x9c, + 0xbf, 0x87, 0xf3, 0x79, 0x09, 0xba, 0x06, 0x07, 0xa5, 0xfb, 0x6c, 0x62, 0xf7, 0x4d, 0x22, 0xf3, + 0x9a, 0x3b, 0xe8, 0xdb, 0xe7, 0x1c, 0xf4, 0x0f, 0x3e, 0xfe, 0xa0, 0x7f, 0xf8, 0x6f, 0x07, 0xfd, + 0x27, 0x17, 0x1d, 0xf4, 0x8f, 0x3e, 0xf6, 0xa0, 0x7f, 0x7c, 0xf1, 0x41, 0xdf, 0xf9, 0xe0, 0x41, + 0xdf, 0x3d, 0x7b, 0xd0, 0xef, 0x7e, 0xf5, 0xc7, 0x49, 0xa3, 0xf0, 0xf6, 0xa4, 0x51, 0xf8, 0xfb, + 0xa4, 0x51, 0xf8, 0xed, 0x7d, 0xe3, 0xd2, 0xdb, 0xf7, 0x8d, 0x4b, 0x7f, 0xbd, 0x6f, 0x5c, 0xfa, + 0xa5, 0x99, 0xc5, 0x5a, 0x89, 0xce, 0x58, 0x74, 0xed, 0xd3, 0x75, 0x17, 0x7f, 0x3e, 0x8d, 0x8a, + 0xf8, 0x9b, 0xe6, 0xf3, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x35, 0x86, 0xaa, 0x9c, 0x57, 0x0d, + 0x00, 0x00, +} diff --git a/pkg/soundcloud/soundcloud.proto b/pkg/soundcloud/soundcloud.proto new file mode 100644 index 00000000..6efe56f2 --- /dev/null +++ b/pkg/soundcloud/soundcloud.proto @@ -0,0 +1,126 @@ +syntax = "proto3"; + +package calcbiz.soundcloud; + +import "google/api/annotations.proto"; +import "github.com/gogo/protobuf/gogoproto/gogo.proto"; +//import "google/protobuf/timestamp.proto"; + +option go_package = "ultre.me/calcbiz/pkg/soundcloud"; +option (gogoproto.sizer_all) = true; +option (gogoproto.marshaler_all) = true; +option (gogoproto.unmarshaler_all) = true; + +message User { + uint64 id = 1 [(gogoproto.customname) = "ID"]; + string username = 2; + string avatar_url = 3 [(gogoproto.customname) = "AvatarURL"]; + string country = 4; + string full_name = 5; + string city = 6; + string description = 7; + string discogs_name = 8; + string myspace_name = 9; + string website = 10; + string website_title = 11; + bool online = 12; + uint64 track_count = 13; + uint64 playlist_count = 14; + uint64 followers_count = 15; + uint64 followings_count = 16; + uint64 public_favorites_count = 17; + bytes avatar_data = 18; + string uri = 19; + string permalink = 20; + string permalink_url = 21 [(gogoproto.customname) = "PermalinkURL"]; +} + +message Playlists { + repeated Playlist playlists = 1; +} + +message Playlist { + uint64 id = 1 [(gogoproto.customname) = "ID"]; + string created_at = 2; + string title = 3; + string sharing = 4; + string embeddable_by = 5; + string purchase_url = 6; + string artwork_url = 7; + string description = 8; + uint64 duration = 9; + string genre = 10; + uint64 shared_to_count = 11; + string tag_list = 12; + // uint64 release = 13; + uint32 release_day = 14; + uint32 release_month = 15; + uint32 release_year = 16; + bool streamable = 17; + bool downloadable = 18; + string ean = 19; + string playlist_type = 20; + repeated Track tracks = 21; + string uri = 22; + User label = 23; + uint64 label_id = 24; + string label_name = 25; + User user = 26; + uint64 user_id = 27; + string permalink = 28; + string permalink_url = 29; +} + +message Tracks { + repeated Track tracks = 1; +} + +message Track { + uint64 id = 1 [(gogoproto.customname) = "ID"]; + string CreatedAt = 2; + string Title = 3; + string Sharing = 4; + string EmbeddableBy = 5; + string PurchaseUrl = 6; + string ArtworkUrl = 7; + string Description = 8; + uint64 Duration = 9; + string Genre = 10; + uint64 SharedToCount = 11; + string TagList = 12; + // uint64 Release = 13; + uint32 ReleaseDay = 14; + uint32 ReleaseMonth = 15; + uint32 ReleaseYear = 16; + bool Streamable = 17; + bool Downloadable = 18; + string State = 19; + string License = 20; + string TrackType = 21; + string WaveformUrl = 22; + string DownloadUrl = 23; + string StreamUrl = 24; + string VideoUrl = 25; + float Bpm = 26; + bool Commentable = 27; + string ISRC = 28; + string KeySignature = 29; + uint64 CommentCount = 30; + uint64 DownloadCount = 31; + uint64 PlaybackCount = 32; + uint64 FavoritingsCount = 33; + string OriginalFormat = 34; + uint64 OriginalContentSize = 35; + // App created_with = 36; + bytes AssetData = 37; + bytes ArtworkData = 38; + bool UserFavorite = 39; + string uri = 40; + User label = 41; + uint64 label_id = 42; + string label_name = 43; + User user = 44; + uint64 user_id = 45; + string permalink = 46; + string permalink_url = 47; +} \ No newline at end of file diff --git a/svc/svc.go b/svc/svc.go index 017febb5..35465dc4 100644 --- a/svc/svc.go +++ b/svc/svc.go @@ -6,6 +6,7 @@ import ( "ultre.me/calcbiz/api" "ultre.me/calcbiz/pkg/crew" + "ultre.me/calcbiz/pkg/soundcloud" "ultre.me/kryptos" ) @@ -15,17 +16,20 @@ type Options struct { } type svc struct { - opts Options - // soundcloud + opts Options + soundcloud soundcloud.Soundcloud // dashboard } func New(opts Options) (api.ServerServer, error) { - //soundcloud := calcsoundcloud.New(c.String("soundcloud-client-id"), uint64(c.Int("soundcloud-user-id"))) - //dashboard := calcdashboard.New() - //dashboard.SetSoundCloud(&soundcloud) - - return &svc{opts: opts}, nil + svc := &svc{opts: opts} + svc.soundcloud = soundcloud.New( + opts.SoundcloudClientID, + uint64(opts.SoundcloudUserID), + ) + // svc.dashboard := calcdashboard.New() + // svc.dashboard.SetSoundCloud(&soundcloud) + return svc, nil } func (svc *svc) Ping(_ context.Context, input *api.Void) (*api.Pong, error) { @@ -194,127 +198,28 @@ func (svc *svc) AlternateLogo(_ context.Context, input *api.Void) (*api.Alternat return nil, fmt.Errorf("not implemented") } -func (svc *svc) SoundcloudMe(_ context.Context, input *api.Void) (*api.SoundcloudMeOutput, error) { - /* - r.Get("/soundcloud/me", func(w http.ResponseWriter, r *http.Request) { - me, err := soundcloud.Me() - if err != nil { - log.Warnf("failed to get /api/soundcloud/me: %v", err) - c.JSON(http.StatusNotFound, gin.H{ - "error": soundcloud.EscapeString(fmt.Sprintf("%v", err)), - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "result": me, - }) - } - }) - */ - return nil, fmt.Errorf("not implemented") +func (svc *svc) SoundcloudMe(_ context.Context, input *api.Void) (*soundcloud.User, error) { + return svc.soundcloud.Me() } -func (svc *svc) SoundcloudPlaylists(_ context.Context, input *api.Void) (*api.SoundcloudPlaylistsOutput, error) { - /* - r.Get("/soundcloud/playlists", func(w http.ResponseWriter, r *http.Request) { - playlists, err := soundcloud.Playlists() - if err != nil { - log.Warnf("failed to get /api/soundcloud/playlists: %v", err) - c.JSON(http.StatusNotFound, gin.H{ - "error": soundcloud.EscapeString(fmt.Sprintf("%v", err)), - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "result": playlists, - }) - } - }) - */ - return nil, fmt.Errorf("not implemented") +func (svc *svc) SoundcloudPlaylists(_ context.Context, input *api.Void) (*soundcloud.Playlists, error) { + return svc.soundcloud.GetPlaylists() } -func (svc *svc) SoundcloudPlaylist(_ context.Context, input *api.SoundcloudPlaylistInput) (*api.SoundcloudPlaylistOutput, error) { - /* - r.Get("/soundcloud/playlists/:id", func(w http.ResponseWriter, r *http.Request) { - playlistID, err := strconv.ParseUint(c.Param("id"), 10, 64) - if err != nil { - c.JSON(http.StatusNotFound, gin.H{ - "error": fmt.Sprintf("Invalid playlist id: %v", c.Param("id")), - }) - return - } - - playlist, err := soundcloud.Playlist(playlistID) - if err != nil { - log.Warnf("failed to get /api/soundcloud/playlists/%d: %v", playlistID, err) - c.JSON(http.StatusNotFound, gin.H{ - "error": soundcloud.EscapeString(fmt.Sprintf("%v", err)), - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "result": playlist, - }) - } - }) - */ - return nil, fmt.Errorf("not implemented") +func (svc *svc) SoundcloudPlaylist(_ context.Context, input *api.SoundcloudPlaylistInput) (*soundcloud.Playlist, error) { + if input.PlaylistId < 1 { // pick random + return svc.soundcloud.GetRandomPlaylist() + } + return svc.soundcloud.GetPlaylist(input.PlaylistId) } -func (svc *svc) SoundcloudTracks(_ context.Context, input *api.Void) (*api.SoundcloudTracksOutput, error) { - /* - r.Get("/soundcloud/tracks", func(w http.ResponseWriter, r *http.Request) { - tracks, err := soundcloud.Tracks() - if err != nil { - log.Warnf("failed to get /api/soundcloud/tracks: %v", err) - c.JSON(http.StatusNotFound, gin.H{ - "error": soundcloud.EscapeString(fmt.Sprintf("%v", err)), - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "result": tracks, - }) - } - }) - */ - return nil, fmt.Errorf("not implemented") +func (svc *svc) SoundcloudTracks(_ context.Context, input *api.Void) (*soundcloud.Tracks, error) { + return svc.soundcloud.GetTracks() } -func (svc *svc) SoundcloudTrack(_ context.Context, input *api.SoundcloudTrackInput) (*api.SoundcloudTrackOutput, error) { - /* - r.Get("/soundcloud/tracks/:id", func(w http.ResponseWriter, r *http.Request) { - if c.Param("id") == "random" { - track, err := soundcloud.RandomTrack() - if err != nil { - log.Warnf("failed to get /api/soundcloud/tracks/random: %v", err) - c.JSON(http.StatusNotFound, gin.H{ - "error": soundcloud.EscapeString(fmt.Sprintf("%v", err)), - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "result": track, - }) - } - return - } - trackID, err := strconv.ParseUint(c.Param("id"), 10, 64) - if err != nil { - c.JSON(http.StatusNotFound, gin.H{ - "error": fmt.Sprintf("Invalid track id: %v", c.Param("id")), - }) - return - } - - track, err := soundcloud.Track(trackID) - if err != nil { - log.Warnf("failed to get /api/soundcloud/tracks/%d: %v", trackID, err) - c.JSON(http.StatusNotFound, gin.H{ - "error": soundcloud.EscapeString(fmt.Sprintf("%v", err)), - }) - } else { - c.JSON(http.StatusOK, gin.H{ - "result": track, - }) - } - }) - */ - return nil, fmt.Errorf("not implemented") +func (svc *svc) SoundcloudTrack(_ context.Context, input *api.SoundcloudTrackInput) (*soundcloud.Track, error) { + if input.TrackId < 1 { // pick random + return svc.soundcloud.GetRandomTrack() + } + return svc.soundcloud.GetTrack(input.TrackId) }