From d6c4eba3db0bc4c26d4f0d67a98fffe4b1df9baf Mon Sep 17 00:00:00 2001 From: Rhainland Date: Wed, 18 Nov 2026 10:33:31 +0100 Subject: [PATCH 1/3] feat(proto): describe each requested season to request routers A request names seasons by TMDB's numbering. Download services such as Sonarr split or merge some series differently, so a plugin matching by number monitors the wrong episodes. RequestDescriptor.season_details carries each requested season's first air date and episode count, so a plugin can match the same episodes by air date. --- README.md | 9 +- docs/compatibility.md | 7 + .../silo/plugin/v1/request_router.pb.go | 362 +++++++++++------- pkg/pluginsdk/runtime/request_router_test.go | 29 +- proto/silo/plugin/v1/request_router.proto | 24 ++ 5 files changed, 288 insertions(+), 143 deletions(-) diff --git a/README.md b/README.md index 0a6bc06..bd7c095 100644 --- a/README.md +++ b/README.md @@ -207,8 +207,13 @@ 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 can then match the season as the first +that many regular episodes airing from that date. A season with no detail, or +a detail without a date or count, is matched by its number. A plugin that fulfils seasons individually +declares it in its manifest: ```json { diff --git a/docs/compatibility.md b/docs/compatibility.md index eac9fce..df9a7d4 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -146,6 +146,13 @@ 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.33.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. A detail with an empty +`first_air_date` or an `episode_count` of 0 is matched by number too. 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..b4d86ba 100644 --- a/pkg/pluginproto/silo/plugin/v1/request_router.pb.go +++ b/pkg/pluginproto/silo/plugin/v1/request_router.pb.go @@ -41,7 +41,13 @@ 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 lists the seasons in + // `seasons`, in the same order, when the host knows them; 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 +152,85 @@ 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. +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; 0 when unknown. 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 +271,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 +283,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 +296,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 +358,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 +370,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 +383,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 +422,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 +434,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 +447,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 +483,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 +495,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 +508,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 +553,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 +565,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 +578,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 +607,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 +619,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 +632,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 +683,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 +695,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 +708,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 +771,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 +783,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 +796,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 +824,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 +836,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 +849,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 +885,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 +897,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 +910,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 +970,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 +982,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 +995,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 +1068,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 +1080,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 +1093,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 +1154,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 +1166,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 +1179,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 +1199,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 +1211,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 +1224,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 +1250,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 +1262,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 +1275,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 +1295,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 +1307,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 +1320,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 +1347,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 +1359,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 +1372,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 +1392,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 +1404,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 +1417,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 +1444,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 +1456,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 +1469,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 +1501,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 +1513,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 +1526,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 +1560,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 +1572,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 +1585,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 +1606,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 +1619,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 +1749,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 +1835,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..5d6de83 100644 --- a/proto/silo/plugin/v1/request_router.proto +++ b/proto/silo/plugin/v1/request_router.proto @@ -38,6 +38,30 @@ 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 lists the seasons in + // `seasons`, in the same order, when the host knows them; 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. +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; 0 when unknown. Episodes the season gains later are not + // counted. + int32 episode_count = 3; } // RequestRouterDescriptor is typed request_router.v1 contract metadata that the From 90dbbd76019b4a818af5e81e14340413e774974e Mon Sep 17 00:00:00 2001 From: Rhainland Date: Wed, 18 Nov 2026 11:40:37 +0100 Subject: [PATCH 2/3] docs(proto): match Specials by number in season details A Specials season is not regular episodes, so air-date matching would pick the wrong ones. Say that plugins match season 0 by number. --- docs/compatibility.md | 3 ++- pkg/pluginproto/silo/plugin/v1/request_router.pb.go | 3 ++- proto/silo/plugin/v1/request_router.proto | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/compatibility.md b/docs/compatibility.md index df9a7d4..780fa6b 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -150,7 +150,8 @@ descriptor means the flag is false. 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. A detail with an empty -`first_air_date` or an `episode_count` of 0 is matched by number too. A +`first_air_date` or an `episode_count` of 0 is matched by number too, and so +is season `0` (Specials) whatever its detail says. A plugin built before the field existed ignores it. `TargetStatus.progress` is a message field, so its presence is the `nil` check. diff --git a/pkg/pluginproto/silo/plugin/v1/request_router.pb.go b/pkg/pluginproto/silo/plugin/v1/request_router.pb.go index b4d86ba..16befe3 100644 --- a/pkg/pluginproto/silo/plugin/v1/request_router.pb.go +++ b/pkg/pluginproto/silo/plugin/v1/request_router.pb.go @@ -164,7 +164,8 @@ func (x *RequestDescriptor) GetSeasonDetails() []*RequestedSeason { // 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. +// first_air_date. 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`. diff --git a/proto/silo/plugin/v1/request_router.proto b/proto/silo/plugin/v1/request_router.proto index 5d6de83..8011a1e 100644 --- a/proto/silo/plugin/v1/request_router.proto +++ b/proto/silo/plugin/v1/request_router.proto @@ -51,7 +51,8 @@ message RequestDescriptor { // 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. +// first_air_date. 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; From b635842e6838c7daa0b8a85a2a9464845b8ba0f7 Mon Sep 17 00:00:00 2001 From: Quick104 <31828688+Quick104@users.noreply.github.com> Date: Wed, 18 Nov 2026 15:15:24 -0500 Subject: [PATCH 3/3] docs(proto): say when a plugin falls back to the season number State in the RequestedSeason contract what silo-server and the Sonarr plugin already do: a count of 0, or details that match no episode, fall back to the season number, and a partial match uses the episodes found. Tell plugins to find a detail by number, since the list can leave seasons out, and date the field to v0.34.0, as v0.33.0 shipped without it. Co-Authored-By: Claude Opus 5.5 --- README.md | 10 ++++++---- docs/compatibility.md | 13 ++++++++----- .../silo/plugin/v1/request_router.pb.go | 19 ++++++++++++------- proto/silo/plugin/v1/request_router.proto | 19 ++++++++++++------- 4 files changed, 38 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 7b42146..65b1c22 100644 --- a/README.md +++ b/README.md @@ -212,10 +212,12 @@ A series request may name seasons in `RequestDescriptor.seasons`. Season `0` 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 can then match the season as the first -that many regular episodes airing from that date. A season with no detail, or -a detail without a date or count, is matched by its number. A plugin that fulfils seasons individually -declares it in its manifest: +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 360091c..6caee46 100644 --- a/docs/compatibility.md +++ b/docs/compatibility.md @@ -154,13 +154,16 @@ 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.33.0) is a repeated field, so +`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. A detail with an empty -`first_air_date` or an `episode_count` of 0 is matched by number too, and so -is season `0` (Specials) whatever its detail says. A -plugin built before the field existed ignores it. +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 diff --git a/pkg/pluginproto/silo/plugin/v1/request_router.pb.go b/pkg/pluginproto/silo/plugin/v1/request_router.pb.go index 16befe3..c3bebca 100644 --- a/pkg/pluginproto/silo/plugin/v1/request_router.pb.go +++ b/pkg/pluginproto/silo/plugin/v1/request_router.pb.go @@ -44,9 +44,11 @@ type RequestDescriptor struct { 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 lists the seasons in - // `seasons`, in the same order, when the host knows them; it is empty for - // a whole-series request and for requests made before the field existed. + // 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 @@ -164,8 +166,11 @@ func (x *RequestDescriptor) GetSeasonDetails() []*RequestedSeason { // 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. Specials (season 0) are not regular episodes and are always -// matched by number; a host need not describe them. +// 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`. @@ -174,8 +179,8 @@ type RequestedSeason struct { // 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; 0 when unknown. Episodes the season gains later are not - // counted. + // 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 diff --git a/proto/silo/plugin/v1/request_router.proto b/proto/silo/plugin/v1/request_router.proto index 8011a1e..64a99e9 100644 --- a/proto/silo/plugin/v1/request_router.proto +++ b/proto/silo/plugin/v1/request_router.proto @@ -40,9 +40,11 @@ message RequestDescriptor { 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 lists the seasons in - // `seasons`, in the same order, when the host knows them; it is empty for - // a whole-series request and for requests made before the field existed. + // 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; } @@ -51,8 +53,11 @@ message RequestDescriptor { // 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. Specials (season 0) are not regular episodes and are always -// matched by number; a host need not describe them. +// 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; @@ -60,8 +65,8 @@ message RequestedSeason { // 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; 0 when unknown. Episodes the season gains later are not - // counted. + // 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; }