diff --git a/README.md b/README.md index dcbe14e..65b1c22 100644 --- a/README.md +++ b/README.md @@ -209,8 +209,15 @@ and quality governance; the plugin routes the request to a configured connection and reports its status. A series request may name seasons in `RequestDescriptor.seasons`. Season `0` -is Specials, and an empty list means the whole series. A plugin that fulfils -seasons individually declares it in its manifest: +is Specials, and an empty list means the whole series. Season numbers are the +host's (TMDB's), and download services number some series differently, so +`RequestDescriptor.season_details` also gives each requested season's first +air date and episode count. A plugin finds a season's detail by its `number` +and matches the season as the first that many regular episodes airing from +that date, or the ones it finds when fewer match. A season with no detail, a +detail without a date or count, and a detail that matches no episode are +matched by number. A plugin that fulfils seasons individually declares it in +its manifest: ```json { diff --git a/docs/compatibility.md b/docs/compatibility.md index fc12c7d..6caee46 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -154,6 +154,17 @@ wire, the host decides who may receive a season-only request from the manifest's `RequestRouterDescriptor.supports_seasons` flag instead. An absent descriptor means the flag is false. +`RequestDescriptor.season_details` (added in v0.34.0) is a repeated field, so +it has no presence: a host that predates it, a whole-series request, and a +request made before the host stored the details all send an empty list. A +plugin then matches `seasons` by number, as before. The list may leave out +seasons in `seasons`, so a plugin finds each detail by its `number`, not its +position. A season with no detail, a detail with an empty `first_air_date` or +an `episode_count` of 0, and a detail that matches no episode in the plugin's +service are matched by number too, and so is season `0` (Specials) whatever +its detail says. When fewer than `episode_count` episodes match, the season is +the ones that do. A plugin built before the field existed ignores it. + `TargetStatus.progress` is a message field, so its presence is the `nil` check. Unset means the target has nothing in flight, and the host clears the progress it stored for it. A set `progress` must carry a `phase`: the host counts one diff --git a/pkg/pluginproto/silo/plugin/v1/request_router.pb.go b/pkg/pluginproto/silo/plugin/v1/request_router.pb.go index 883b6bd..c3bebca 100644 --- a/pkg/pluginproto/silo/plugin/v1/request_router.pb.go +++ b/pkg/pluginproto/silo/plugin/v1/request_router.pb.go @@ -41,7 +41,15 @@ type RequestDescriptor struct { // this field existed. Only set when media_type is "series". Plugins that // declare RequestRouterDescriptor.supports_seasons must fulfil only these // seasons; see that field for the full contract. - Seasons []int32 `protobuf:"varint,10,rep,packed,name=seasons,proto3" json:"seasons,omitempty"` + Seasons []int32 `protobuf:"varint,10,rep,packed,name=seasons,proto3" json:"seasons,omitempty"` + // season_details describes each requested season as the host's metadata + // source (TMDB) numbers it, so a plugin whose download service numbers the + // series differently can find the same episodes. It describes the seasons + // in `seasons` that the host has details for, in the same order, and may + // leave some out, so a plugin finds a season's detail by + // RequestedSeason.number rather than by position. It is empty for a + // whole-series request and for requests made before the field existed. + SeasonDetails []*RequestedSeason `protobuf:"bytes,11,rep,name=season_details,json=seasonDetails,proto3" json:"season_details,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -146,6 +154,89 @@ func (x *RequestDescriptor) GetSeasons() []int32 { return nil } +func (x *RequestDescriptor) GetSeasonDetails() []*RequestedSeason { + if x != nil { + return x.SeasonDetails + } + return nil +} + +// RequestedSeason is one requested season as the host's metadata source +// numbers it. Download services can split or merge seasons differently (one +// 24-episode season on TMDB can be two 12-episode seasons on Sonarr); a +// plugin matches by air date rather than by number: the season is the first +// episode_count regular episodes, in airing order, that air on or after +// first_air_date. When fewer episodes match, the season is the ones that do. +// The plugin matches the season by number instead when it has no detail, when +// the detail has no date or a count of 0, or when no episode matches. Specials +// (season 0) are not regular episodes and are always matched by number; a host +// need not describe them. +type RequestedSeason struct { + state protoimpl.MessageState `protogen:"open.v1"` + // number is the season number in `RequestDescriptor.seasons`. + Number int32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + // first_air_date is the season's first air date as YYYY-MM-DD, or empty + // when it has none yet; the plugin then matches the season by number. + FirstAirDate string `protobuf:"bytes,2,opt,name=first_air_date,json=firstAirDate,proto3" json:"first_air_date,omitempty"` + // episode_count is the number of episodes the season had when the request + // was made, or 0 when unknown; the plugin then matches the season by + // number. Episodes the season gains later are not counted. + EpisodeCount int32 `protobuf:"varint,3,opt,name=episode_count,json=episodeCount,proto3" json:"episode_count,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RequestedSeason) Reset() { + *x = RequestedSeason{} + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RequestedSeason) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RequestedSeason) ProtoMessage() {} + +func (x *RequestedSeason) ProtoReflect() protoreflect.Message { + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RequestedSeason.ProtoReflect.Descriptor instead. +func (*RequestedSeason) Descriptor() ([]byte, []int) { + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{1} +} + +func (x *RequestedSeason) GetNumber() int32 { + if x != nil { + return x.Number + } + return 0 +} + +func (x *RequestedSeason) GetFirstAirDate() string { + if x != nil { + return x.FirstAirDate + } + return "" +} + +func (x *RequestedSeason) GetEpisodeCount() int32 { + if x != nil { + return x.EpisodeCount + } + return 0 +} + // RequestRouterDescriptor is typed request_router.v1 contract metadata that the // host reads from the manifest without launching the plugin. An absent // descriptor means every flag is false, which is how the host treats plugins @@ -186,7 +277,7 @@ type RequestRouterDescriptor struct { func (x *RequestRouterDescriptor) Reset() { *x = RequestRouterDescriptor{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[1] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -198,7 +289,7 @@ func (x *RequestRouterDescriptor) String() string { func (*RequestRouterDescriptor) ProtoMessage() {} func (x *RequestRouterDescriptor) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[1] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -211,7 +302,7 @@ func (x *RequestRouterDescriptor) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestRouterDescriptor.ProtoReflect.Descriptor instead. func (*RequestRouterDescriptor) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{1} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{2} } func (x *RequestRouterDescriptor) GetSupportsSeasons() bool { @@ -273,7 +364,7 @@ type RequestRouterWording struct { func (x *RequestRouterWording) Reset() { *x = RequestRouterWording{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[2] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -285,7 +376,7 @@ func (x *RequestRouterWording) String() string { func (*RequestRouterWording) ProtoMessage() {} func (x *RequestRouterWording) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[2] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -298,7 +389,7 @@ func (x *RequestRouterWording) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestRouterWording.ProtoReflect.Descriptor instead. func (*RequestRouterWording) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{2} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{3} } func (x *RequestRouterWording) GetStep() string { @@ -337,7 +428,7 @@ type RequestStatusWording struct { func (x *RequestStatusWording) Reset() { *x = RequestStatusWording{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[3] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -349,7 +440,7 @@ func (x *RequestStatusWording) String() string { func (*RequestStatusWording) ProtoMessage() {} func (x *RequestStatusWording) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[3] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -362,7 +453,7 @@ func (x *RequestStatusWording) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestStatusWording.ProtoReflect.Descriptor instead. func (*RequestStatusWording) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{3} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{4} } func (x *RequestStatusWording) GetLabel() string { @@ -398,7 +489,7 @@ type RouterConnection struct { func (x *RouterConnection) Reset() { *x = RouterConnection{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[4] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -410,7 +501,7 @@ func (x *RouterConnection) String() string { func (*RouterConnection) ProtoMessage() {} func (x *RouterConnection) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[4] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -423,7 +514,7 @@ func (x *RouterConnection) ProtoReflect() protoreflect.Message { // Deprecated: Use RouterConnection.ProtoReflect.Descriptor instead. func (*RouterConnection) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{4} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{5} } func (x *RouterConnection) GetId() string { @@ -468,7 +559,7 @@ type RequestedQuality struct { func (x *RequestedQuality) Reset() { *x = RequestedQuality{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[5] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -480,7 +571,7 @@ func (x *RequestedQuality) String() string { func (*RequestedQuality) ProtoMessage() {} func (x *RequestedQuality) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[5] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -493,7 +584,7 @@ func (x *RequestedQuality) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestedQuality.ProtoReflect.Descriptor instead. func (*RequestedQuality) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{5} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{6} } func (x *RequestedQuality) GetId() string { @@ -522,7 +613,7 @@ type FulfillRequest struct { func (x *FulfillRequest) Reset() { *x = FulfillRequest{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[6] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -534,7 +625,7 @@ func (x *FulfillRequest) String() string { func (*FulfillRequest) ProtoMessage() {} func (x *FulfillRequest) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[6] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -547,7 +638,7 @@ func (x *FulfillRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use FulfillRequest.ProtoReflect.Descriptor instead. func (*FulfillRequest) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{6} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{7} } func (x *FulfillRequest) GetCapabilityId() string { @@ -598,7 +689,7 @@ type FulfillmentTarget struct { func (x *FulfillmentTarget) Reset() { *x = FulfillmentTarget{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[7] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -610,7 +701,7 @@ func (x *FulfillmentTarget) String() string { func (*FulfillmentTarget) ProtoMessage() {} func (x *FulfillmentTarget) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[7] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -623,7 +714,7 @@ func (x *FulfillmentTarget) ProtoReflect() protoreflect.Message { // Deprecated: Use FulfillmentTarget.ProtoReflect.Descriptor instead. func (*FulfillmentTarget) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{7} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{8} } func (x *FulfillmentTarget) GetQuality() string { @@ -686,7 +777,7 @@ type FulfillResponse struct { func (x *FulfillResponse) Reset() { *x = FulfillResponse{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[8] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -698,7 +789,7 @@ func (x *FulfillResponse) String() string { func (*FulfillResponse) ProtoMessage() {} func (x *FulfillResponse) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[8] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -711,7 +802,7 @@ func (x *FulfillResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use FulfillResponse.ProtoReflect.Descriptor instead. func (*FulfillResponse) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{8} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{9} } func (x *FulfillResponse) GetTargets() []*FulfillmentTarget { @@ -739,7 +830,7 @@ type TargetRef struct { func (x *TargetRef) Reset() { *x = TargetRef{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[9] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -751,7 +842,7 @@ func (x *TargetRef) String() string { func (*TargetRef) ProtoMessage() {} func (x *TargetRef) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[9] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -764,7 +855,7 @@ func (x *TargetRef) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetRef.ProtoReflect.Descriptor instead. func (*TargetRef) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{9} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{10} } func (x *TargetRef) GetQuality() string { @@ -800,7 +891,7 @@ type CheckStatusRequest struct { func (x *CheckStatusRequest) Reset() { *x = CheckStatusRequest{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[10] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -812,7 +903,7 @@ func (x *CheckStatusRequest) String() string { func (*CheckStatusRequest) ProtoMessage() {} func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[10] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -825,7 +916,7 @@ func (x *CheckStatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusRequest.ProtoReflect.Descriptor instead. func (*CheckStatusRequest) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{10} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{11} } func (x *CheckStatusRequest) GetCapabilityId() string { @@ -885,7 +976,7 @@ type DownloadProgress struct { func (x *DownloadProgress) Reset() { *x = DownloadProgress{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[11] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -897,7 +988,7 @@ func (x *DownloadProgress) String() string { func (*DownloadProgress) ProtoMessage() {} func (x *DownloadProgress) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[11] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -910,7 +1001,7 @@ func (x *DownloadProgress) ProtoReflect() protoreflect.Message { // Deprecated: Use DownloadProgress.ProtoReflect.Descriptor instead. func (*DownloadProgress) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{11} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{12} } func (x *DownloadProgress) GetPhase() string { @@ -983,7 +1074,7 @@ type TargetStatus struct { func (x *TargetStatus) Reset() { *x = TargetStatus{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[12] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -995,7 +1086,7 @@ func (x *TargetStatus) String() string { func (*TargetStatus) ProtoMessage() {} func (x *TargetStatus) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[12] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1008,7 +1099,7 @@ func (x *TargetStatus) ProtoReflect() protoreflect.Message { // Deprecated: Use TargetStatus.ProtoReflect.Descriptor instead. func (*TargetStatus) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{12} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{13} } func (x *TargetStatus) GetQuality() string { @@ -1069,7 +1160,7 @@ type CheckStatusResponse struct { func (x *CheckStatusResponse) Reset() { *x = CheckStatusResponse{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[13] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1081,7 +1172,7 @@ func (x *CheckStatusResponse) String() string { func (*CheckStatusResponse) ProtoMessage() {} func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[13] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1094,7 +1185,7 @@ func (x *CheckStatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CheckStatusResponse.ProtoReflect.Descriptor instead. func (*CheckStatusResponse) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{13} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{14} } func (x *CheckStatusResponse) GetStatuses() []*TargetStatus { @@ -1114,7 +1205,7 @@ type ConfigOption struct { func (x *ConfigOption) Reset() { *x = ConfigOption{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[14] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1126,7 +1217,7 @@ func (x *ConfigOption) String() string { func (*ConfigOption) ProtoMessage() {} func (x *ConfigOption) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[14] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1139,7 +1230,7 @@ func (x *ConfigOption) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigOption.ProtoReflect.Descriptor instead. func (*ConfigOption) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{14} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{15} } func (x *ConfigOption) GetValue() string { @@ -1165,7 +1256,7 @@ type ConfigOptionList struct { func (x *ConfigOptionList) Reset() { *x = ConfigOptionList{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[15] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1177,7 +1268,7 @@ func (x *ConfigOptionList) String() string { func (*ConfigOptionList) ProtoMessage() {} func (x *ConfigOptionList) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[15] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1190,7 +1281,7 @@ func (x *ConfigOptionList) ProtoReflect() protoreflect.Message { // Deprecated: Use ConfigOptionList.ProtoReflect.Descriptor instead. func (*ConfigOptionList) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{15} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{16} } func (x *ConfigOptionList) GetOptions() []*ConfigOption { @@ -1210,7 +1301,7 @@ type ListConfigOptionsRequest struct { func (x *ListConfigOptionsRequest) Reset() { *x = ListConfigOptionsRequest{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[16] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1222,7 +1313,7 @@ func (x *ListConfigOptionsRequest) String() string { func (*ListConfigOptionsRequest) ProtoMessage() {} func (x *ListConfigOptionsRequest) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[16] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1235,7 +1326,7 @@ func (x *ListConfigOptionsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigOptionsRequest.ProtoReflect.Descriptor instead. func (*ListConfigOptionsRequest) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{16} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{17} } func (x *ListConfigOptionsRequest) GetCapabilityId() string { @@ -1262,7 +1353,7 @@ type ListConfigOptionsResponse struct { func (x *ListConfigOptionsResponse) Reset() { *x = ListConfigOptionsResponse{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[17] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1274,7 +1365,7 @@ func (x *ListConfigOptionsResponse) String() string { func (*ListConfigOptionsResponse) ProtoMessage() {} func (x *ListConfigOptionsResponse) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[17] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1287,7 +1378,7 @@ func (x *ListConfigOptionsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListConfigOptionsResponse.ProtoReflect.Descriptor instead. func (*ListConfigOptionsResponse) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{17} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{18} } func (x *ListConfigOptionsResponse) GetOptionsByField() map[string]*ConfigOptionList { @@ -1307,7 +1398,7 @@ type TestConnectionRequest struct { func (x *TestConnectionRequest) Reset() { *x = TestConnectionRequest{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[18] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1319,7 +1410,7 @@ func (x *TestConnectionRequest) String() string { func (*TestConnectionRequest) ProtoMessage() {} func (x *TestConnectionRequest) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[18] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1332,7 +1423,7 @@ func (x *TestConnectionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TestConnectionRequest.ProtoReflect.Descriptor instead. func (*TestConnectionRequest) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{18} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{19} } func (x *TestConnectionRequest) GetCapabilityId() string { @@ -1359,7 +1450,7 @@ type TestConnectionResponse struct { func (x *TestConnectionResponse) Reset() { *x = TestConnectionResponse{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[19] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1371,7 +1462,7 @@ func (x *TestConnectionResponse) String() string { func (*TestConnectionResponse) ProtoMessage() {} func (x *TestConnectionResponse) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[19] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1384,7 +1475,7 @@ func (x *TestConnectionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TestConnectionResponse.ProtoReflect.Descriptor instead. func (*TestConnectionResponse) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{19} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{20} } func (x *TestConnectionResponse) GetOk() bool { @@ -1416,7 +1507,7 @@ type ValidateRequest struct { func (x *ValidateRequest) Reset() { *x = ValidateRequest{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[20] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1428,7 +1519,7 @@ func (x *ValidateRequest) String() string { func (*ValidateRequest) ProtoMessage() {} func (x *ValidateRequest) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[20] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1441,7 +1532,7 @@ func (x *ValidateRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidateRequest.ProtoReflect.Descriptor instead. func (*ValidateRequest) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{20} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{21} } func (x *ValidateRequest) GetCapabilityId() string { @@ -1475,7 +1566,7 @@ type ValidateResponse struct { func (x *ValidateResponse) Reset() { *x = ValidateResponse{} - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[21] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1487,7 +1578,7 @@ func (x *ValidateResponse) String() string { func (*ValidateResponse) ProtoMessage() {} func (x *ValidateResponse) ProtoReflect() protoreflect.Message { - mi := &file_silo_plugin_v1_request_router_proto_msgTypes[21] + mi := &file_silo_plugin_v1_request_router_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1500,7 +1591,7 @@ func (x *ValidateResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ValidateResponse.ProtoReflect.Descriptor instead. func (*ValidateResponse) Descriptor() ([]byte, []int) { - return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{21} + return file_silo_plugin_v1_request_router_proto_rawDescGZIP(), []int{22} } func (x *ValidateResponse) GetFieldErrors() map[string]string { @@ -1521,7 +1612,7 @@ var File_silo_plugin_v1_request_router_proto protoreflect.FileDescriptor const file_silo_plugin_v1_request_router_proto_rawDesc = "" + "\n" + - "#silo/plugin/v1/request_router.proto\x12\x0esilo.plugin.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xde\x03\n" + + "#silo/plugin/v1/request_router.proto\x12\x0esilo.plugin.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa6\x04\n" + "\x11RequestDescriptor\x12\x1d\n" + "\n" + "media_type\x18\x01 \x01(\tR\tmediaType\x12\x14\n" + @@ -1534,10 +1625,15 @@ const file_silo_plugin_v1_request_router_proto_rawDesc = "" + "\x0frequester_email\x18\b \x01(\tR\x0erequesterEmail\x12-\n" + "\x12requester_username\x18\t \x01(\tR\x11requesterUsername\x12\x18\n" + "\aseasons\x18\n" + - " \x03(\x05R\aseasons\x1a>\n" + + " \x03(\x05R\aseasons\x12F\n" + + "\x0eseason_details\x18\v \x03(\v2\x1f.silo.plugin.v1.RequestedSeasonR\rseasonDetails\x1a>\n" + "\x10ExternalIdsEntry\x12\x10\n" + "\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" + - "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"\x96\x02\n" + + "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"t\n" + + "\x0fRequestedSeason\x12\x16\n" + + "\x06number\x18\x01 \x01(\x05R\x06number\x12$\n" + + "\x0efirst_air_date\x18\x02 \x01(\tR\ffirstAirDate\x12#\n" + + "\repisode_count\x18\x03 \x01(\x05R\fepisodeCount\"\x96\x02\n" + "\x17RequestRouterDescriptor\x12)\n" + "\x10supports_seasons\x18\x01 \x01(\bR\x0fsupportsSeasons\x12:\n" + "\x19reports_download_progress\x18\x02 \x01(\bR\x17reportsDownloadProgress\x12>\n" + @@ -1659,77 +1755,79 @@ func file_silo_plugin_v1_request_router_proto_rawDescGZIP() []byte { return file_silo_plugin_v1_request_router_proto_rawDescData } -var file_silo_plugin_v1_request_router_proto_msgTypes = make([]protoimpl.MessageInfo, 25) +var file_silo_plugin_v1_request_router_proto_msgTypes = make([]protoimpl.MessageInfo, 26) var file_silo_plugin_v1_request_router_proto_goTypes = []any{ (*RequestDescriptor)(nil), // 0: silo.plugin.v1.RequestDescriptor - (*RequestRouterDescriptor)(nil), // 1: silo.plugin.v1.RequestRouterDescriptor - (*RequestRouterWording)(nil), // 2: silo.plugin.v1.RequestRouterWording - (*RequestStatusWording)(nil), // 3: silo.plugin.v1.RequestStatusWording - (*RouterConnection)(nil), // 4: silo.plugin.v1.RouterConnection - (*RequestedQuality)(nil), // 5: silo.plugin.v1.RequestedQuality - (*FulfillRequest)(nil), // 6: silo.plugin.v1.FulfillRequest - (*FulfillmentTarget)(nil), // 7: silo.plugin.v1.FulfillmentTarget - (*FulfillResponse)(nil), // 8: silo.plugin.v1.FulfillResponse - (*TargetRef)(nil), // 9: silo.plugin.v1.TargetRef - (*CheckStatusRequest)(nil), // 10: silo.plugin.v1.CheckStatusRequest - (*DownloadProgress)(nil), // 11: silo.plugin.v1.DownloadProgress - (*TargetStatus)(nil), // 12: silo.plugin.v1.TargetStatus - (*CheckStatusResponse)(nil), // 13: silo.plugin.v1.CheckStatusResponse - (*ConfigOption)(nil), // 14: silo.plugin.v1.ConfigOption - (*ConfigOptionList)(nil), // 15: silo.plugin.v1.ConfigOptionList - (*ListConfigOptionsRequest)(nil), // 16: silo.plugin.v1.ListConfigOptionsRequest - (*ListConfigOptionsResponse)(nil), // 17: silo.plugin.v1.ListConfigOptionsResponse - (*TestConnectionRequest)(nil), // 18: silo.plugin.v1.TestConnectionRequest - (*TestConnectionResponse)(nil), // 19: silo.plugin.v1.TestConnectionResponse - (*ValidateRequest)(nil), // 20: silo.plugin.v1.ValidateRequest - (*ValidateResponse)(nil), // 21: silo.plugin.v1.ValidateResponse - nil, // 22: silo.plugin.v1.RequestDescriptor.ExternalIdsEntry - nil, // 23: silo.plugin.v1.ListConfigOptionsResponse.OptionsByFieldEntry - nil, // 24: silo.plugin.v1.ValidateResponse.FieldErrorsEntry - (*structpb.Struct)(nil), // 25: google.protobuf.Struct - (*timestamppb.Timestamp)(nil), // 26: google.protobuf.Timestamp + (*RequestedSeason)(nil), // 1: silo.plugin.v1.RequestedSeason + (*RequestRouterDescriptor)(nil), // 2: silo.plugin.v1.RequestRouterDescriptor + (*RequestRouterWording)(nil), // 3: silo.plugin.v1.RequestRouterWording + (*RequestStatusWording)(nil), // 4: silo.plugin.v1.RequestStatusWording + (*RouterConnection)(nil), // 5: silo.plugin.v1.RouterConnection + (*RequestedQuality)(nil), // 6: silo.plugin.v1.RequestedQuality + (*FulfillRequest)(nil), // 7: silo.plugin.v1.FulfillRequest + (*FulfillmentTarget)(nil), // 8: silo.plugin.v1.FulfillmentTarget + (*FulfillResponse)(nil), // 9: silo.plugin.v1.FulfillResponse + (*TargetRef)(nil), // 10: silo.plugin.v1.TargetRef + (*CheckStatusRequest)(nil), // 11: silo.plugin.v1.CheckStatusRequest + (*DownloadProgress)(nil), // 12: silo.plugin.v1.DownloadProgress + (*TargetStatus)(nil), // 13: silo.plugin.v1.TargetStatus + (*CheckStatusResponse)(nil), // 14: silo.plugin.v1.CheckStatusResponse + (*ConfigOption)(nil), // 15: silo.plugin.v1.ConfigOption + (*ConfigOptionList)(nil), // 16: silo.plugin.v1.ConfigOptionList + (*ListConfigOptionsRequest)(nil), // 17: silo.plugin.v1.ListConfigOptionsRequest + (*ListConfigOptionsResponse)(nil), // 18: silo.plugin.v1.ListConfigOptionsResponse + (*TestConnectionRequest)(nil), // 19: silo.plugin.v1.TestConnectionRequest + (*TestConnectionResponse)(nil), // 20: silo.plugin.v1.TestConnectionResponse + (*ValidateRequest)(nil), // 21: silo.plugin.v1.ValidateRequest + (*ValidateResponse)(nil), // 22: silo.plugin.v1.ValidateResponse + nil, // 23: silo.plugin.v1.RequestDescriptor.ExternalIdsEntry + nil, // 24: silo.plugin.v1.ListConfigOptionsResponse.OptionsByFieldEntry + nil, // 25: silo.plugin.v1.ValidateResponse.FieldErrorsEntry + (*structpb.Struct)(nil), // 26: google.protobuf.Struct + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp } var file_silo_plugin_v1_request_router_proto_depIdxs = []int32{ - 22, // 0: silo.plugin.v1.RequestDescriptor.external_ids:type_name -> silo.plugin.v1.RequestDescriptor.ExternalIdsEntry - 2, // 1: silo.plugin.v1.RequestRouterDescriptor.wording:type_name -> silo.plugin.v1.RequestRouterWording - 3, // 2: silo.plugin.v1.RequestRouterWording.queued:type_name -> silo.plugin.v1.RequestStatusWording - 3, // 3: silo.plugin.v1.RequestRouterWording.downloading:type_name -> silo.plugin.v1.RequestStatusWording - 25, // 4: silo.plugin.v1.RouterConnection.config:type_name -> google.protobuf.Struct - 0, // 5: silo.plugin.v1.FulfillRequest.request:type_name -> silo.plugin.v1.RequestDescriptor - 5, // 6: silo.plugin.v1.FulfillRequest.qualities:type_name -> silo.plugin.v1.RequestedQuality - 4, // 7: silo.plugin.v1.FulfillRequest.connections:type_name -> silo.plugin.v1.RouterConnection - 3, // 8: silo.plugin.v1.FulfillmentTarget.wording:type_name -> silo.plugin.v1.RequestStatusWording - 7, // 9: silo.plugin.v1.FulfillResponse.targets:type_name -> silo.plugin.v1.FulfillmentTarget - 0, // 10: silo.plugin.v1.CheckStatusRequest.request:type_name -> silo.plugin.v1.RequestDescriptor - 9, // 11: silo.plugin.v1.CheckStatusRequest.targets:type_name -> silo.plugin.v1.TargetRef - 4, // 12: silo.plugin.v1.CheckStatusRequest.connections:type_name -> silo.plugin.v1.RouterConnection - 26, // 13: silo.plugin.v1.DownloadProgress.estimated_completion:type_name -> google.protobuf.Timestamp - 11, // 14: silo.plugin.v1.TargetStatus.progress:type_name -> silo.plugin.v1.DownloadProgress - 3, // 15: silo.plugin.v1.TargetStatus.wording:type_name -> silo.plugin.v1.RequestStatusWording - 12, // 16: silo.plugin.v1.CheckStatusResponse.statuses:type_name -> silo.plugin.v1.TargetStatus - 14, // 17: silo.plugin.v1.ConfigOptionList.options:type_name -> silo.plugin.v1.ConfigOption - 4, // 18: silo.plugin.v1.ListConfigOptionsRequest.connection:type_name -> silo.plugin.v1.RouterConnection - 23, // 19: silo.plugin.v1.ListConfigOptionsResponse.options_by_field:type_name -> silo.plugin.v1.ListConfigOptionsResponse.OptionsByFieldEntry - 4, // 20: silo.plugin.v1.TestConnectionRequest.connection:type_name -> silo.plugin.v1.RouterConnection - 4, // 21: silo.plugin.v1.ValidateRequest.connection:type_name -> silo.plugin.v1.RouterConnection - 4, // 22: silo.plugin.v1.ValidateRequest.siblings:type_name -> silo.plugin.v1.RouterConnection - 24, // 23: silo.plugin.v1.ValidateResponse.field_errors:type_name -> silo.plugin.v1.ValidateResponse.FieldErrorsEntry - 15, // 24: silo.plugin.v1.ListConfigOptionsResponse.OptionsByFieldEntry.value:type_name -> silo.plugin.v1.ConfigOptionList - 6, // 25: silo.plugin.v1.RequestRouter.Fulfill:input_type -> silo.plugin.v1.FulfillRequest - 10, // 26: silo.plugin.v1.RequestRouter.CheckStatus:input_type -> silo.plugin.v1.CheckStatusRequest - 16, // 27: silo.plugin.v1.RequestRouter.ListConfigOptions:input_type -> silo.plugin.v1.ListConfigOptionsRequest - 18, // 28: silo.plugin.v1.RequestRouter.TestConnection:input_type -> silo.plugin.v1.TestConnectionRequest - 20, // 29: silo.plugin.v1.RequestRouter.Validate:input_type -> silo.plugin.v1.ValidateRequest - 8, // 30: silo.plugin.v1.RequestRouter.Fulfill:output_type -> silo.plugin.v1.FulfillResponse - 13, // 31: silo.plugin.v1.RequestRouter.CheckStatus:output_type -> silo.plugin.v1.CheckStatusResponse - 17, // 32: silo.plugin.v1.RequestRouter.ListConfigOptions:output_type -> silo.plugin.v1.ListConfigOptionsResponse - 19, // 33: silo.plugin.v1.RequestRouter.TestConnection:output_type -> silo.plugin.v1.TestConnectionResponse - 21, // 34: silo.plugin.v1.RequestRouter.Validate:output_type -> silo.plugin.v1.ValidateResponse - 30, // [30:35] is the sub-list for method output_type - 25, // [25:30] is the sub-list for method input_type - 25, // [25:25] is the sub-list for extension type_name - 25, // [25:25] is the sub-list for extension extendee - 0, // [0:25] is the sub-list for field type_name + 23, // 0: silo.plugin.v1.RequestDescriptor.external_ids:type_name -> silo.plugin.v1.RequestDescriptor.ExternalIdsEntry + 1, // 1: silo.plugin.v1.RequestDescriptor.season_details:type_name -> silo.plugin.v1.RequestedSeason + 3, // 2: silo.plugin.v1.RequestRouterDescriptor.wording:type_name -> silo.plugin.v1.RequestRouterWording + 4, // 3: silo.plugin.v1.RequestRouterWording.queued:type_name -> silo.plugin.v1.RequestStatusWording + 4, // 4: silo.plugin.v1.RequestRouterWording.downloading:type_name -> silo.plugin.v1.RequestStatusWording + 26, // 5: silo.plugin.v1.RouterConnection.config:type_name -> google.protobuf.Struct + 0, // 6: silo.plugin.v1.FulfillRequest.request:type_name -> silo.plugin.v1.RequestDescriptor + 6, // 7: silo.plugin.v1.FulfillRequest.qualities:type_name -> silo.plugin.v1.RequestedQuality + 5, // 8: silo.plugin.v1.FulfillRequest.connections:type_name -> silo.plugin.v1.RouterConnection + 4, // 9: silo.plugin.v1.FulfillmentTarget.wording:type_name -> silo.plugin.v1.RequestStatusWording + 8, // 10: silo.plugin.v1.FulfillResponse.targets:type_name -> silo.plugin.v1.FulfillmentTarget + 0, // 11: silo.plugin.v1.CheckStatusRequest.request:type_name -> silo.plugin.v1.RequestDescriptor + 10, // 12: silo.plugin.v1.CheckStatusRequest.targets:type_name -> silo.plugin.v1.TargetRef + 5, // 13: silo.plugin.v1.CheckStatusRequest.connections:type_name -> silo.plugin.v1.RouterConnection + 27, // 14: silo.plugin.v1.DownloadProgress.estimated_completion:type_name -> google.protobuf.Timestamp + 12, // 15: silo.plugin.v1.TargetStatus.progress:type_name -> silo.plugin.v1.DownloadProgress + 4, // 16: silo.plugin.v1.TargetStatus.wording:type_name -> silo.plugin.v1.RequestStatusWording + 13, // 17: silo.plugin.v1.CheckStatusResponse.statuses:type_name -> silo.plugin.v1.TargetStatus + 15, // 18: silo.plugin.v1.ConfigOptionList.options:type_name -> silo.plugin.v1.ConfigOption + 5, // 19: silo.plugin.v1.ListConfigOptionsRequest.connection:type_name -> silo.plugin.v1.RouterConnection + 24, // 20: silo.plugin.v1.ListConfigOptionsResponse.options_by_field:type_name -> silo.plugin.v1.ListConfigOptionsResponse.OptionsByFieldEntry + 5, // 21: silo.plugin.v1.TestConnectionRequest.connection:type_name -> silo.plugin.v1.RouterConnection + 5, // 22: silo.plugin.v1.ValidateRequest.connection:type_name -> silo.plugin.v1.RouterConnection + 5, // 23: silo.plugin.v1.ValidateRequest.siblings:type_name -> silo.plugin.v1.RouterConnection + 25, // 24: silo.plugin.v1.ValidateResponse.field_errors:type_name -> silo.plugin.v1.ValidateResponse.FieldErrorsEntry + 16, // 25: silo.plugin.v1.ListConfigOptionsResponse.OptionsByFieldEntry.value:type_name -> silo.plugin.v1.ConfigOptionList + 7, // 26: silo.plugin.v1.RequestRouter.Fulfill:input_type -> silo.plugin.v1.FulfillRequest + 11, // 27: silo.plugin.v1.RequestRouter.CheckStatus:input_type -> silo.plugin.v1.CheckStatusRequest + 17, // 28: silo.plugin.v1.RequestRouter.ListConfigOptions:input_type -> silo.plugin.v1.ListConfigOptionsRequest + 19, // 29: silo.plugin.v1.RequestRouter.TestConnection:input_type -> silo.plugin.v1.TestConnectionRequest + 21, // 30: silo.plugin.v1.RequestRouter.Validate:input_type -> silo.plugin.v1.ValidateRequest + 9, // 31: silo.plugin.v1.RequestRouter.Fulfill:output_type -> silo.plugin.v1.FulfillResponse + 14, // 32: silo.plugin.v1.RequestRouter.CheckStatus:output_type -> silo.plugin.v1.CheckStatusResponse + 18, // 33: silo.plugin.v1.RequestRouter.ListConfigOptions:output_type -> silo.plugin.v1.ListConfigOptionsResponse + 20, // 34: silo.plugin.v1.RequestRouter.TestConnection:output_type -> silo.plugin.v1.TestConnectionResponse + 22, // 35: silo.plugin.v1.RequestRouter.Validate:output_type -> silo.plugin.v1.ValidateResponse + 31, // [31:36] is the sub-list for method output_type + 26, // [26:31] is the sub-list for method input_type + 26, // [26:26] is the sub-list for extension type_name + 26, // [26:26] is the sub-list for extension extendee + 0, // [0:26] is the sub-list for field type_name } func init() { file_silo_plugin_v1_request_router_proto_init() } @@ -1743,7 +1841,7 @@ func file_silo_plugin_v1_request_router_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_silo_plugin_v1_request_router_proto_rawDesc), len(file_silo_plugin_v1_request_router_proto_rawDesc)), NumEnums: 0, - NumMessages: 25, + NumMessages: 26, NumExtensions: 0, NumServices: 1, }, diff --git a/pkg/pluginsdk/runtime/request_router_test.go b/pkg/pluginsdk/runtime/request_router_test.go index adca8aa..a6d80f2 100644 --- a/pkg/pluginsdk/runtime/request_router_test.go +++ b/pkg/pluginsdk/runtime/request_router_test.go @@ -16,16 +16,16 @@ import ( type recordingRequestRouter struct { pluginv1.UnimplementedRequestRouterServer - seasons chan []int32 + requests chan *pluginv1.RequestDescriptor } func (r recordingRequestRouter) Fulfill(_ context.Context, req *pluginv1.FulfillRequest) (*pluginv1.FulfillResponse, error) { - r.seasons <- req.GetRequest().GetSeasons() + r.requests <- req.GetRequest() return &pluginv1.FulfillResponse{}, nil } func TestRequestRouterReceivesRequestedSeasons(t *testing.T) { - router := recordingRequestRouter{seasons: make(chan []int32, 1)} + router := recordingRequestRouter{requests: make(chan *pluginv1.RequestDescriptor, 1)} plugins := runtime.DefaultPluginSet(runtime.CapabilityServers{Runtime: stubRuntime{}, RequestRouter: router}) p := plugins[runtime.PluginSetName].(plugin.GRPCPlugin) srv := grpc.NewServer() @@ -46,12 +46,29 @@ func TestRequestRouterReceivesRequestedSeasons(t *testing.T) { _, err = pluginv1.NewRequestRouterClient(conn).Fulfill(context.Background(), &pluginv1.FulfillRequest{ CapabilityId: "arr", - Request: &pluginv1.RequestDescriptor{MediaType: "series", Title: "Example", Seasons: []int32{0, 4}}, + Request: &pluginv1.RequestDescriptor{MediaType: "series", Title: "Example", Seasons: []int32{0, 4}, + SeasonDetails: []*pluginv1.RequestedSeason{{Number: 4, FirstAirDate: "2024-10-04", EpisodeCount: 24}}}, }) if err != nil { t.Fatalf("Fulfill = %v", err) } - if got := <-router.seasons; !slices.Equal(got, []int32{0, 4}) { - t.Fatalf("seasons = %v, want [0 4]", got) + got := <-router.requests + if !slices.Equal(got.GetSeasons(), []int32{0, 4}) { + t.Fatalf("seasons = %v, want [0 4]", got.GetSeasons()) + } + details := got.GetSeasonDetails() + if len(details) != 1 || details[0].GetNumber() != 4 || details[0].GetFirstAirDate() != "2024-10-04" || details[0].GetEpisodeCount() != 24 { + t.Fatalf("season details = %v, want season 4 from 2024-10-04 with 24 episodes", details) + } + + // A host that predates season_details sends only the numbers. + if _, err = pluginv1.NewRequestRouterClient(conn).Fulfill(context.Background(), &pluginv1.FulfillRequest{ + CapabilityId: "arr", + Request: &pluginv1.RequestDescriptor{MediaType: "series", Title: "Example", Seasons: []int32{2}}, + }); err != nil { + t.Fatalf("Fulfill without details = %v", err) + } + if got := <-router.requests; !slices.Equal(got.GetSeasons(), []int32{2}) || len(got.GetSeasonDetails()) != 0 { + t.Fatalf("seasons = %v, details = %v; want [2] and none", got.GetSeasons(), got.GetSeasonDetails()) } } diff --git a/proto/silo/plugin/v1/request_router.proto b/proto/silo/plugin/v1/request_router.proto index a1d48cb..64a99e9 100644 --- a/proto/silo/plugin/v1/request_router.proto +++ b/proto/silo/plugin/v1/request_router.proto @@ -38,6 +38,36 @@ message RequestDescriptor { // declare RequestRouterDescriptor.supports_seasons must fulfil only these // seasons; see that field for the full contract. repeated int32 seasons = 10; + // season_details describes each requested season as the host's metadata + // source (TMDB) numbers it, so a plugin whose download service numbers the + // series differently can find the same episodes. It describes the seasons + // in `seasons` that the host has details for, in the same order, and may + // leave some out, so a plugin finds a season's detail by + // RequestedSeason.number rather than by position. It is empty for a + // whole-series request and for requests made before the field existed. + repeated RequestedSeason season_details = 11; +} + +// RequestedSeason is one requested season as the host's metadata source +// numbers it. Download services can split or merge seasons differently (one +// 24-episode season on TMDB can be two 12-episode seasons on Sonarr); a +// plugin matches by air date rather than by number: the season is the first +// episode_count regular episodes, in airing order, that air on or after +// first_air_date. When fewer episodes match, the season is the ones that do. +// The plugin matches the season by number instead when it has no detail, when +// the detail has no date or a count of 0, or when no episode matches. Specials +// (season 0) are not regular episodes and are always matched by number; a host +// need not describe them. +message RequestedSeason { + // number is the season number in `RequestDescriptor.seasons`. + int32 number = 1; + // first_air_date is the season's first air date as YYYY-MM-DD, or empty + // when it has none yet; the plugin then matches the season by number. + string first_air_date = 2; + // episode_count is the number of episodes the season had when the request + // was made, or 0 when unknown; the plugin then matches the season by + // number. Episodes the season gains later are not counted. + int32 episode_count = 3; } // RequestRouterDescriptor is typed request_router.v1 contract metadata that the