API: remove deprecated APIs
This commit is contained in:
parent
a599ac44b5
commit
2f37d2247e
1 changed files with 0 additions and 117 deletions
117
catalog/api.py
117
catalog/api.py
|
@ -195,120 +195,3 @@ def get_performance(request, uuid: str, response: HttpResponse):
|
|||
)
|
||||
def get_performance_production(request, uuid: str, response: HttpResponse):
|
||||
return _get_item(PerformanceProduction, uuid, response)
|
||||
|
||||
|
||||
# Legacy API will be removed soon
|
||||
|
||||
|
||||
class SearchResultLegacy(Schema):
|
||||
items: List[ItemSchema]
|
||||
pages: int
|
||||
|
||||
|
||||
@api.api_operation(
|
||||
["POST", "OPTIONS"],
|
||||
"/catalog/search",
|
||||
response={200: SearchResult, 400: Result},
|
||||
summary="This method is deprecated, will be removed by Aug 1 2023; use GET instead",
|
||||
auth=None,
|
||||
deprecated=True,
|
||||
)
|
||||
def search_item_legacy(
|
||||
request, query: str, category: AvailableItemCategory | None = None
|
||||
):
|
||||
query = query.strip()
|
||||
if not query:
|
||||
return 400, {"message": "Invalid query"}
|
||||
result = Indexer.search(query, page=1, categories=[category])
|
||||
return 200, {"items": result.items}
|
||||
|
||||
|
||||
@api.api_operation(
|
||||
["POST", "OPTIONS"],
|
||||
"/catalog/fetch",
|
||||
response={200: ItemSchema, 202: Result},
|
||||
summary="This method is deprecated, will be removed by Aug 1 2023; use GET instead",
|
||||
auth=None,
|
||||
deprecated=True,
|
||||
)
|
||||
def fetch_item_legacy(request, url: str):
|
||||
site = SiteManager.get_site_by_url(url)
|
||||
if not site:
|
||||
raise Http404(url)
|
||||
item = site.get_item()
|
||||
if item:
|
||||
return 200, item
|
||||
enqueue_fetch(url, False)
|
||||
return 202, {"message": "Fetch in progress"}
|
||||
|
||||
|
||||
@api.api_operation(
|
||||
["GET", "OPTIONS"],
|
||||
"/movie/{uuid}/",
|
||||
response={200: MovieSchema, 302: RedirectedResult, 404: Result},
|
||||
summary="This method is deprecated, will be removed by Aug 1 2023",
|
||||
auth=None,
|
||||
deprecated=True,
|
||||
)
|
||||
def get_movie_legacy(request, uuid: str, response: HttpResponse):
|
||||
return _get_item(Movie, uuid, response)
|
||||
|
||||
|
||||
@api.api_operation(
|
||||
["GET", "OPTIONS"],
|
||||
"/tv/{uuid}/",
|
||||
response={200: TVShowSchema, 302: RedirectedResult, 404: Result},
|
||||
summary="This method is deprecated, will be removed by Aug 1 2023",
|
||||
auth=None,
|
||||
deprecated=True,
|
||||
)
|
||||
def get_tv_show_legacy(request, uuid: str, response: HttpResponse):
|
||||
return _get_item(TVShow, uuid, response)
|
||||
|
||||
|
||||
@api.api_operation(
|
||||
["GET", "OPTIONS"],
|
||||
"/tvseason/{uuid}/",
|
||||
response={200: TVSeasonSchema, 302: RedirectedResult, 404: Result},
|
||||
summary="This method is deprecated, will be removed by Aug 1 2023",
|
||||
auth=None,
|
||||
deprecated=True,
|
||||
)
|
||||
def get_tv_season_legacy(request, uuid: str, response: HttpResponse):
|
||||
return _get_item(TVSeason, uuid, response)
|
||||
|
||||
|
||||
@api.api_operation(
|
||||
["GET", "OPTIONS"],
|
||||
"/podcast/{uuid}/",
|
||||
response={200: PodcastSchema, 302: RedirectedResult, 404: Result},
|
||||
summary="This method is deprecated, will be removed by Aug 1 2023",
|
||||
auth=None,
|
||||
deprecated=True,
|
||||
)
|
||||
def get_podcast_legacy(request, uuid: str, response: HttpResponse):
|
||||
return _get_item(Podcast, uuid, response)
|
||||
|
||||
|
||||
@api.api_operation(
|
||||
["GET", "OPTIONS"],
|
||||
"/album/{uuid}/",
|
||||
response={200: AlbumSchema, 302: RedirectedResult, 404: Result},
|
||||
summary="This method is deprecated, will be removed by Aug 1 2023",
|
||||
auth=None,
|
||||
deprecated=True,
|
||||
)
|
||||
def get_album_legacy(request, uuid: str, response: HttpResponse):
|
||||
return _get_item(Album, uuid, response)
|
||||
|
||||
|
||||
@api.api_operation(
|
||||
["GET", "OPTIONS"],
|
||||
"/game/{uuid}/",
|
||||
response={200: GameSchema, 302: RedirectedResult, 404: Result},
|
||||
summary="This method is deprecated, will be removed by Aug 1 2023",
|
||||
auth=None,
|
||||
deprecated=True,
|
||||
)
|
||||
def get_game_legacy(request, uuid: str, response: HttpResponse):
|
||||
return _get_item(Game, uuid, response)
|
||||
|
|
Loading…
Add table
Reference in a new issue