Minor cleanup

This commit is contained in:
henryruhs
2026-01-09 15:34:29 +01:00
parent 5a2eb2059d
commit f59bf04bc2
3 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -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]]:
+5 -7
View File
@@ -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()
+5 -1
View File
@@ -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 =
{