Feat: impl user playback info args

This commit is contained in:
zijiren233 2024-05-10 15:34:22 +08:00
parent 6dd3d78e56
commit 3ccb221371
5 changed files with 145 additions and 86 deletions

View File

@ -1461,8 +1461,9 @@ type PlaybackInfoReq struct {
UserId string `protobuf:"bytes,3,opt,name=userId,proto3" json:"userId,omitempty"`
ItemId string `protobuf:"bytes,4,opt,name=itemId,proto3" json:"itemId,omitempty"`
MediaSourceId string `protobuf:"bytes,5,opt,name=mediaSourceId,proto3" json:"mediaSourceId,omitempty"`
AudioStreamIndex string `protobuf:"bytes,6,opt,name=audioStreamIndex,proto3" json:"audioStreamIndex,omitempty"`
SubtitleStreamIndex string `protobuf:"bytes,7,opt,name=subtitleStreamIndex,proto3" json:"subtitleStreamIndex,omitempty"`
AudioStreamIndex int32 `protobuf:"varint,6,opt,name=audioStreamIndex,proto3" json:"audioStreamIndex,omitempty"`
SubtitleStreamIndex int32 `protobuf:"varint,7,opt,name=subtitleStreamIndex,proto3" json:"subtitleStreamIndex,omitempty"`
MaxStreamingBitrate int64 `protobuf:"varint,8,opt,name=maxStreamingBitrate,proto3" json:"maxStreamingBitrate,omitempty"`
}
func (x *PlaybackInfoReq) Reset() {
@ -1532,18 +1533,25 @@ func (x *PlaybackInfoReq) GetMediaSourceId() string {
return ""
}
func (x *PlaybackInfoReq) GetAudioStreamIndex() string {
func (x *PlaybackInfoReq) GetAudioStreamIndex() int32 {
if x != nil {
return x.AudioStreamIndex
}
return ""
return 0
}
func (x *PlaybackInfoReq) GetSubtitleStreamIndex() string {
func (x *PlaybackInfoReq) GetSubtitleStreamIndex() int32 {
if x != nil {
return x.SubtitleStreamIndex
}
return ""
return 0
}
func (x *PlaybackInfoReq) GetMaxStreamingBitrate() int64 {
if x != nil {
return x.MaxStreamingBitrate
}
return 0
}
type PlaybackInfoResp struct {
@ -1881,7 +1889,7 @@ var file_emby_emby_proto_rawDesc = []byte{
0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68,
0x6f, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x22, 0xef, 0x01, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x49,
0x74, 0x79, 0x22, 0xa1, 0x02, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
@ -1891,81 +1899,84 @@ var file_emby_emby_proto_rawDesc = []byte{
0x12, 0x24, 0x0a, 0x0d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49,
0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x10, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x53,
0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05,
0x52, 0x10, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x64,
0x65, 0x78, 0x12, 0x30, 0x0a, 0x13, 0x73, 0x75, 0x62, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x53, 0x74,
0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52,
0x13, 0x73, 0x75, 0x62, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49,
0x6e, 0x64, 0x65, 0x78, 0x22, 0x7d, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x6c, 0x61, 0x79,
0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0d, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x43,
0x0a, 0x0f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x66,
0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d,
0x62, 0x79, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x0f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x22, 0x6b, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x74,
0x6e, 0x64, 0x65, 0x78, 0x12, 0x30, 0x0a, 0x13, 0x6d, 0x61, 0x78, 0x53, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x69, 0x6e, 0x67, 0x42, 0x69, 0x74, 0x72, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
0x03, 0x52, 0x13, 0x6d, 0x61, 0x78, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x42,
0x69, 0x74, 0x72, 0x61, 0x74, 0x65, 0x22, 0x7d, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61,
0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x6c,
0x61, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0d, 0x70, 0x6c, 0x61, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x44,
0x12, 0x43, 0x0a, 0x0f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x65, 0x6d, 0x62, 0x79, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0f, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x6b, 0x0a, 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41,
0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x67, 0x73, 0x52,
0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x24, 0x0a, 0x0d,
0x70, 0x61, 0x6c, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x61, 0x6c, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
0x49, 0x64, 0x32, 0xa4, 0x06, 0x0a, 0x04, 0x45, 0x6d, 0x62, 0x79, 0x12, 0x48, 0x0a, 0x05, 0x4c,
0x6f, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e,
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65,
0x6d, 0x62, 0x79, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x16, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, 0x22, 0x0b, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f,
0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x42, 0x0a, 0x02, 0x4d, 0x65, 0x12, 0x0f, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x4d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x4d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x19,
0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x65, 0x6d, 0x62, 0x79,
0x2f, 0x55, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x4d, 0x65, 0x12, 0x51, 0x0a, 0x08, 0x47, 0x65, 0x74,
0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79,
0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x61,
0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73,
0x52, 0x65, 0x73, 0x70, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, 0x22,
0x0b, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x50, 0x0a, 0x07,
0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d,
0x62, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x1f, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f,
0x49, 0x74, 0x65, 0x6d, 0x73, 0x2f, 0x7b, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x7d, 0x12, 0x60,
0x0a, 0x0d, 0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12,
0x17, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65,
0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65,
0x6d, 0x62, 0x79, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x73, 0x70, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f,
0x65, 0x6d, 0x62, 0x79, 0x2f, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x56, 0x0a, 0x06, 0x46, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x46, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a,
0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x46, 0x73, 0x4c, 0x69, 0x73,
0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a,
0x22, 0x16, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74,
0x65, 0x6d, 0x2f, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x50, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f,
0x75, 0x74, 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x4c, 0x6f,
0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d,
0x62, 0x79, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a,
0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f, 0x53, 0x65, 0x73, 0x73, 0x69,
0x6f, 0x6e, 0x73, 0x2f, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x65, 0x0a, 0x0c, 0x50, 0x6c,
0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x49, 0x6e,
0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79,
0x2e, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
0x70, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x65,
0x6d, 0x62, 0x79, 0x2f, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x2f, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x76, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76,
0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x74,
0x69, 0x76, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71,
0x12, 0x12, 0x0a, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x68, 0x6f, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x24, 0x0a, 0x0d, 0x70, 0x61,
0x6c, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0d, 0x70, 0x61, 0x6c, 0x79, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64,
0x32, 0xa4, 0x06, 0x0a, 0x04, 0x45, 0x6d, 0x62, 0x79, 0x12, 0x48, 0x0a, 0x05, 0x4c, 0x6f, 0x67,
0x69, 0x6e, 0x12, 0x12, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x4c, 0x6f,
0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62,
0x79, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x22, 0x16, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, 0x22, 0x0b, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f, 0x4c, 0x6f,
0x67, 0x69, 0x6e, 0x12, 0x42, 0x0a, 0x02, 0x4d, 0x65, 0x12, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x65, 0x6d, 0x62, 0x79, 0x2e, 0x4d, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x4d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x19, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f, 0x55,
0x73, 0x65, 0x72, 0x73, 0x2f, 0x4d, 0x65, 0x12, 0x51, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x49, 0x74,
0x65, 0x6d, 0x73, 0x12, 0x15, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x47,
0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x61, 0x70, 0x69,
0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65,
0x73, 0x70, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x3a, 0x01, 0x2a, 0x22, 0x0b, 0x2f,
0x65, 0x6d, 0x62, 0x79, 0x2f, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x12, 0x50, 0x0a, 0x07, 0x47, 0x65,
0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x14, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79,
0x2e, 0x47, 0x65, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x61, 0x70,
0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x22, 0x1f, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x19, 0x3a, 0x01, 0x2a, 0x22, 0x14, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f, 0x49, 0x74,
0x65, 0x6d, 0x73, 0x2f, 0x7b, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x7d, 0x12, 0x60, 0x0a, 0x0d,
0x47, 0x65, 0x74, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62,
0x79, 0x2e, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x65, 0x6d,
0x62, 0x79, 0x2f, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2f, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x56,
0x0a, 0x06, 0x46, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65,
0x6d, 0x62, 0x79, 0x2e, 0x46, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e,
0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x46, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x52,
0x65, 0x73, 0x70, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x01, 0x2a, 0x22, 0x16,
0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f, 0x46, 0x69, 0x6c, 0x65, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d,
0x2f, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x50, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74,
0x12, 0x13, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x4c, 0x6f, 0x67, 0x6f,
0x75, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01,
0x2a, 0x22, 0x15, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x2f, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
0x73, 0x2f, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x65, 0x0a, 0x0c, 0x50, 0x6c, 0x61, 0x79,
0x62, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65,
0x6d, 0x62, 0x79, 0x2e, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x65, 0x71, 0x1a, 0x1a, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x50,
0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x22,
0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x3a, 0x01, 0x2a, 0x22, 0x13, 0x2f, 0x65, 0x6d, 0x62,
0x79, 0x2f, 0x50, 0x6c, 0x61, 0x79, 0x62, 0x61, 0x63, 0x6b, 0x2f, 0x49, 0x6e, 0x66, 0x6f, 0x12,
0x76, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45,
0x6e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x23, 0x2e, 0x61, 0x70, 0x69, 0x2e,
0x65, 0x6d, 0x62, 0x79, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76,
0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x67, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0f,
0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x65, 0x6d, 0x62,
0x79, 0x2f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x6e,
0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x67, 0x42, 0x39, 0x0a, 0x08, 0x61, 0x70, 0x69, 0x2e, 0x65,
0x6d, 0x62, 0x79, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x74, 0x76, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x76, 0x65, 0x6e,
0x64, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x3b, 0x65, 0x6d,
0x62, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x1a, 0x0f, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x6d, 0x62, 0x79, 0x2e, 0x45, 0x6d, 0x70, 0x74,
0x79, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x65,
0x6d, 0x62, 0x79, 0x2f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65,
0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x69, 0x6e, 0x67, 0x42, 0x39, 0x0a, 0x08, 0x61, 0x70, 0x69,
0x2e, 0x65, 0x6d, 0x62, 0x79, 0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x79, 0x6e, 0x63, 0x74, 0x76, 0x2d, 0x6f, 0x72, 0x67, 0x2f, 0x76,
0x65, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x6d, 0x62, 0x79, 0x3b,
0x65, 0x6d, 0x62, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

View File

@ -225,8 +225,9 @@ message PlaybackInfoReq {
string userId = 3;
string itemId = 4;
string mediaSourceId = 5;
string audioStreamIndex = 6;
string subtitleStreamIndex = 7;
int32 audioStreamIndex = 6;
int32 subtitleStreamIndex = 7;
int64 maxStreamingBitrate = 8;
}
message PlaybackInfoResp {

View File

@ -1338,8 +1338,12 @@ components:
mediaSourceId:
type: string
audioStreamIndex:
type: string
type: integer
format: int32
subtitleStreamIndex:
type: integer
format: int32
maxStreamingBitrate:
type: string
api.emby.PlaybackInfoResp:
type: object

View File

@ -309,7 +309,20 @@ func (a *EmbyService) Logout(ctx context.Context, req *pb.LogoutReq) (*pb.Empty,
func (a *EmbyService) PlaybackInfo(ctx context.Context, req *pb.PlaybackInfoReq) (*pb.PlaybackInfoResp, error) {
cli := emby.NewClient(req.Host, emby.WithContext(ctx), emby.WithKey(req.Token), emby.WithUserID(req.UserId))
r, err := cli.UserPlaybackInfo(req.ItemId)
opts := []emby.UserPlaybackInfoOption{}
if req.MediaSourceId != "" {
opts = append(opts, emby.WithMediaSourceID(req.MediaSourceId))
}
if req.SubtitleStreamIndex != 0 {
opts = append(opts, emby.WithSubtitleStreamIndex(int(req.SubtitleStreamIndex)))
}
if req.AudioStreamIndex != 0 {
opts = append(opts, emby.WithAudioStreamIndex(int(req.AudioStreamIndex)))
}
if req.MaxStreamingBitrate != 0 {
opts = append(opts, emby.WithMaxStreamingBitrate(int(req.MaxStreamingBitrate)))
}
r, err := cli.UserPlaybackInfo(req.ItemId, opts...)
if err != nil {
return nil, err
}

38
vendors/emby/user.go vendored
View File

@ -266,11 +266,37 @@ func (c *Client) Episodes(seriesID, seasonId string, opt ...QueryFunc) (*ItemsRe
return &itemsResp, nil
}
func (c *Client) UserPlaybackInfo(id string) (*PlayBackResp, error) {
type UserPlaybackInfoOption func(*PlayBackReq)
func WithMaxStreamingBitrate(bitrate int) UserPlaybackInfoOption {
return func(p *PlayBackReq) {
p.MaxStreamingBitrate = bitrate
}
}
func WithSubtitleStreamIndex(index int) UserPlaybackInfoOption {
return func(p *PlayBackReq) {
p.SubtitleStreamIndex = index
}
}
func WithAudioStreamIndex(index int) UserPlaybackInfoOption {
return func(p *PlayBackReq) {
p.AudioStreamIndex = index
}
}
func WithMediaSourceID(id string) UserPlaybackInfoOption {
return func(p *PlayBackReq) {
p.MediaSourceID = id
}
}
func (c *Client) UserPlaybackInfo(id string, opts ...UserPlaybackInfoOption) (*PlayBackResp, error) {
if c.userID == "" {
return nil, errors.New("user id not set")
}
req, err := c.NewRequest(http.MethodPost, fmt.Sprintf("/emby/Items/%s/PlaybackInfo", id), &PlayBackReq{
cfg := &PlayBackReq{
DeviceProfile: DeviceProfile{
MaxStaticBitrate: 140000000,
MaxStreamingBitrate: 140000000,
@ -406,8 +432,12 @@ func (c *Client) UserPlaybackInfo(id string) (*PlayBackResp, error) {
StartTimeTicks: 0,
IsPlayback: true,
AutoOpenLiveStream: true,
MaxStreamingBitrate: 6000001,
}, map[string]string{
MaxStreamingBitrate: 8000001,
}
for _, opt := range opts {
opt(cfg)
}
req, err := c.NewRequest(http.MethodPost, fmt.Sprintf("/emby/Items/%s/PlaybackInfo", id), cfg, map[string]string{
"reqformat": "json",
})
if err != nil {