mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
refactor: unify tmdb query contracts
This commit is contained in:
@@ -161,6 +161,21 @@ _METHOD_CONTRACTS = {
|
||||
"anilist_popular_this_season": ModuleMethodContract(family="anilist", input_contract="AniListPageRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("page", "count")),
|
||||
"anilist_recommendations": ModuleMethodContract(family="anilist", input_contract="AniListMediaPageRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("anilist_id", "page", "count")),
|
||||
"anilist_trending": ModuleMethodContract(family="anilist", input_contract="AniListPageRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("page", "count")),
|
||||
"tmdb_collection": ModuleMethodContract(family="tmdb", input_contract="TmdbCollectionRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("collection_id",)),
|
||||
"tmdb_discover": ModuleMethodContract(family="tmdb", input_contract="TmdbDiscoverRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("mtype", "sort_by", "with_genres", "with_original_language", "with_keywords", "with_watch_providers", "vote_average", "vote_count", "release_date", "page")),
|
||||
"tmdb_episodes": ModuleMethodContract(family="tmdb", input_contract="TmdbEpisodesRequest", result_contract="list[TmdbEpisode]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("tmdbid", "season", "episode_group")),
|
||||
"tmdb_group_seasons": ModuleMethodContract(family="tmdb", input_contract="TmdbGroupRequest", result_contract="list[TmdbSeason]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("group_id",)),
|
||||
"tmdb_info": ModuleMethodContract(family="tmdb", input_contract="TmdbInfoRequest", result_contract="dict | None", result_shape=ModuleResultShape.MAPPING, aggregation=ModuleResultAggregation.FIRST_NON_EMPTY, required_parameters=("tmdbid", "mtype", "season")),
|
||||
"tmdb_movie_credits": ModuleMethodContract(family="tmdb", input_contract="TmdbMediaPageRequest", result_contract="list[MediaPerson]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("tmdbid", "page")),
|
||||
"tmdb_movie_recommend": ModuleMethodContract(family="tmdb", input_contract="TmdbMediaRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("tmdbid",)),
|
||||
"tmdb_movie_similar": ModuleMethodContract(family="tmdb", input_contract="TmdbMediaRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("tmdbid",)),
|
||||
"tmdb_person_credits": ModuleMethodContract(family="tmdb", input_contract="TmdbPersonPageRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("person_id", "page")),
|
||||
"tmdb_person_detail": ModuleMethodContract(family="tmdb", input_contract="TmdbPersonRequest", result_contract="MediaPerson | None", aggregation=ModuleResultAggregation.FIRST_NON_EMPTY, required_parameters=("person_id",)),
|
||||
"tmdb_seasons": ModuleMethodContract(family="tmdb", input_contract="TmdbMediaRequest", result_contract="list[TmdbSeason]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("tmdbid",)),
|
||||
"tmdb_trending": ModuleMethodContract(family="tmdb", input_contract="TmdbTrendingRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("page",)),
|
||||
"tmdb_tv_credits": ModuleMethodContract(family="tmdb", input_contract="TmdbMediaPageRequest", result_contract="list[MediaPerson]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("tmdbid", "page")),
|
||||
"tmdb_tv_recommend": ModuleMethodContract(family="tmdb", input_contract="TmdbMediaRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("tmdbid",)),
|
||||
"tmdb_tv_similar": ModuleMethodContract(family="tmdb", input_contract="TmdbMediaRequest", result_contract="list[MediaInfo]", result_shape=ModuleResultShape.LIST, aggregation=ModuleResultAggregation.ORDERED_LIST_MERGE, required_parameters=("tmdbid",)),
|
||||
"send_message": ModuleMethodContract(family="messaging", input_contract="MessageSendRequest", result_contract="Message | None", aggregation=ModuleResultAggregation.FIRST_NON_EMPTY),
|
||||
"finalize_message": ModuleMethodContract(family="messaging", input_contract="MessageFinalizeRequest", result_contract="Message | None", aggregation=ModuleResultAggregation.FIRST_NON_EMPTY, required_parameters=("response",)),
|
||||
"register_commands": ModuleMethodContract(family="messaging", input_contract="CommandRegistrationRequest", result_contract="None", required_parameters=("commands",)),
|
||||
@@ -230,6 +245,21 @@ _METHOD_CONTRACTS.update({
|
||||
"async_anilist_popular_this_season": _METHOD_CONTRACTS["anilist_popular_this_season"],
|
||||
"async_anilist_recommendations": _METHOD_CONTRACTS["anilist_recommendations"],
|
||||
"async_anilist_trending": _METHOD_CONTRACTS["anilist_trending"],
|
||||
"async_tmdb_collection": _METHOD_CONTRACTS["tmdb_collection"],
|
||||
"async_tmdb_discover": _METHOD_CONTRACTS["tmdb_discover"],
|
||||
"async_tmdb_episodes": _METHOD_CONTRACTS["tmdb_episodes"],
|
||||
"async_tmdb_group_seasons": _METHOD_CONTRACTS["tmdb_group_seasons"],
|
||||
"async_tmdb_info": _METHOD_CONTRACTS["tmdb_info"],
|
||||
"async_tmdb_movie_credits": _METHOD_CONTRACTS["tmdb_movie_credits"],
|
||||
"async_tmdb_movie_recommend": _METHOD_CONTRACTS["tmdb_movie_recommend"],
|
||||
"async_tmdb_movie_similar": _METHOD_CONTRACTS["tmdb_movie_similar"],
|
||||
"async_tmdb_person_credits": _METHOD_CONTRACTS["tmdb_person_credits"],
|
||||
"async_tmdb_person_detail": _METHOD_CONTRACTS["tmdb_person_detail"],
|
||||
"async_tmdb_seasons": _METHOD_CONTRACTS["tmdb_seasons"],
|
||||
"async_tmdb_trending": _METHOD_CONTRACTS["tmdb_trending"],
|
||||
"async_tmdb_tv_credits": _METHOD_CONTRACTS["tmdb_tv_credits"],
|
||||
"async_tmdb_tv_recommend": _METHOD_CONTRACTS["tmdb_tv_recommend"],
|
||||
"async_tmdb_tv_similar": _METHOD_CONTRACTS["tmdb_tv_similar"],
|
||||
})
|
||||
|
||||
_PREFIX_CONTRACTS = (
|
||||
|
||||
Reference in New Issue
Block a user