refactor: unify tmdb query contracts

This commit is contained in:
jxxghp
2026-08-24 01:47:47 +08:00
parent 488b3667bb
commit f655051c85
3 changed files with 301 additions and 148 deletions
+240 -148
View File
@@ -3216,159 +3216,194 @@
"version": 1
},
"async_tmdb_collection": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbCollectionRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"collection_id"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_discover": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbDiscoverRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"mtype",
"page",
"release_date",
"sort_by",
"vote_average",
"vote_count",
"with_genres",
"with_keywords",
"with_original_language",
"with_watch_providers"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_episodes": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbEpisodesRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"episode_group",
"season",
"tmdbid"
],
"result_contract": "list[TmdbEpisode]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_group_seasons": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbGroupRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"group_id"
],
"result_contract": "list[TmdbSeason]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_info": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbInfoRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"mtype",
"season",
"tmdbid"
],
"result_contract": "dict | None",
"result_shape": "mapping",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_movie_credits": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaPageRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"page",
"tmdbid"
],
"result_contract": "list[MediaPerson]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_movie_recommend": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_movie_similar": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_person_credits": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbPersonPageRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"page",
"person_id"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_person_detail": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbPersonRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"required_parameters": [
"person_id"
],
"result_contract": "MediaPerson | None",
"result_shape": "any",
"supports_async": true,
"supports_sync": true,
@@ -3376,80 +3411,91 @@
"version": 1
},
"async_tmdb_seasons": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[TmdbSeason]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_trending": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbTrendingRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"page"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_tv_credits": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaPageRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"page",
"tmdbid"
],
"result_contract": "list[MediaPerson]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_tv_recommend": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"async_tmdb_tv_similar": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
@@ -5659,159 +5705,194 @@
"version": 1
},
"tmdb_collection": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbCollectionRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"collection_id"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_discover": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbDiscoverRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"mtype",
"page",
"release_date",
"sort_by",
"vote_average",
"vote_count",
"with_genres",
"with_keywords",
"with_original_language",
"with_watch_providers"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_episodes": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbEpisodesRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"episode_group",
"season",
"tmdbid"
],
"result_contract": "list[TmdbEpisode]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_group_seasons": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbGroupRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"group_id"
],
"result_contract": "list[TmdbSeason]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_info": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbInfoRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"mtype",
"season",
"tmdbid"
],
"result_contract": "dict | None",
"result_shape": "mapping",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_movie_credits": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaPageRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"page",
"tmdbid"
],
"result_contract": "list[MediaPerson]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_movie_recommend": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_movie_similar": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_person_credits": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbPersonPageRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"page",
"person_id"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_person_detail": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbPersonRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"required_parameters": [
"person_id"
],
"result_contract": "MediaPerson | None",
"result_shape": "any",
"supports_async": true,
"supports_sync": true,
@@ -5819,80 +5900,91 @@
"version": 1
},
"tmdb_seasons": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[TmdbSeason]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_trending": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbTrendingRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"page"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_tv_credits": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaPageRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"page",
"tmdbid"
],
"result_contract": "list[MediaPerson]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_tv_recommend": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"tmdb_tv_similar": {
"aggregation": "legacy",
"aggregation": "ordered_list_merge",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "tmdb",
"input_contract": "TmdbKeywordArguments",
"input_contract": "TmdbMediaRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "TmdbProviderResult",
"result_shape": "any",
"required_parameters": [
"tmdbid"
],
"result_contract": "list[MediaInfo]",
"result_shape": "list",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",