mirror of
https://github.com/facefusion/facefusion.git
synced 2026-04-22 09:26:02 +02:00
Minor cleanup
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import uuid
|
||||
from typing import Dict, Optional
|
||||
|
||||
ASSET_STORE: Dict[str, Dict[str, str]] = {}
|
||||
ASSET_STORE : Dict[str, Dict[str, str]] = {}
|
||||
|
||||
|
||||
def get_asset(asset_id : str) -> Optional[Dict[str, str]]:
|
||||
|
||||
@@ -13,15 +13,13 @@ async def get_state(request : Request) -> JSONResponse:
|
||||
|
||||
async def set_state(request : Request) -> JSONResponse:
|
||||
action = request.query_params.get('action')
|
||||
asset_type = request.query_params.get('type')
|
||||
|
||||
if action == 'select':
|
||||
asset_type = request.query_params.get('type')
|
||||
if action == 'select' and asset_type == 'source':
|
||||
return await select_source(request)
|
||||
|
||||
if asset_type == 'source':
|
||||
return await select_source(request)
|
||||
|
||||
if asset_type == 'target':
|
||||
return await select_target(request)
|
||||
if action == 'select' and asset_type == 'target':
|
||||
return await select_target(request)
|
||||
|
||||
body = await request.json()
|
||||
api_args = args_store.get_api_args()
|
||||
|
||||
@@ -85,7 +85,11 @@ def test_set_state(test_client : TestClient) -> None:
|
||||
|
||||
|
||||
def test_select_source_assets(test_client : TestClient) -> None:
|
||||
asset_ids = [ asset_store.register_asset('/path/to/source1.jpg'), asset_store.register_asset('/path/to/source2.jpg') ]
|
||||
asset_ids =\
|
||||
[
|
||||
asset_store.register_asset('/path/to/source1.jpg'),
|
||||
asset_store.register_asset('/path/to/source2.jpg')
|
||||
]
|
||||
|
||||
select_response = test_client.put('/state?action=select&type=source', json =
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user