From 4a7af219a6bb12bf70c2577185982116c5bbdf4f Mon Sep 17 00:00:00 2001 From: Ovler Date: Sat, 15 Jun 2024 13:24:17 +0000 Subject: [PATCH] chore: remove source_type and removed an assert --- biliarchiver/rest_api/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/biliarchiver/rest_api/main.py b/biliarchiver/rest_api/main.py index 027b157..08cc4f0 100644 --- a/biliarchiver/rest_api/main.py +++ b/biliarchiver/rest_api/main.py @@ -106,7 +106,7 @@ async def delete(vid: str): return {"success": False, "vid": vid, "status": "not_found"} -async def source_action(fun, source_type: str, source_id: str, TRUNCATE=20): +async def source_action(fun, source_id: str, TRUNCATE=20): try: txt_path = await fun(source_id, truncate=TRUNCATE) except Exception as e: @@ -139,9 +139,8 @@ async def perform_source_action_from_req(source_type: str, source_id: str): fun = fun_mapping[source_type] assert callable(fun) - assert isinstance(source_id, str) - return await source_action(fun, source_type, source_id, TRUNCATE=int(9e99)) + return await source_action(fun, source_id, TRUNCATE=int(9e99)) async def video_scheduler(): while True: