Add Chinese locale, fix audio device duplicates, remove display lock restriction
- Add Simplified Chinese (中文) locale with all 906 translation keys - Fix duplicate audio devices: WASAPI two-pass enumerate avoids double-listing loopback endpoints; cross-engine dedup by (name, is_loopback) prefers higher-priority engine - Remove redundant display lock check from capture template, picture source, and postprocessing template test endpoints — screen capture is read-only and concurrent access is safe Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,10 +10,8 @@ from fastapi import APIRouter, HTTPException, Depends
|
||||
|
||||
from wled_controller.api.auth import AuthRequired
|
||||
from wled_controller.api.dependencies import (
|
||||
get_device_store,
|
||||
get_picture_source_store,
|
||||
get_pp_template_store,
|
||||
get_processor_manager,
|
||||
get_template_store,
|
||||
)
|
||||
from wled_controller.api.schemas.common import (
|
||||
@@ -37,8 +35,6 @@ from wled_controller.api.schemas.filters import (
|
||||
)
|
||||
from wled_controller.core.capture_engines import EngineRegistry
|
||||
from wled_controller.core.filters import FilterRegistry
|
||||
from wled_controller.core.processing.processor_manager import ProcessorManager
|
||||
from wled_controller.storage import DeviceStore
|
||||
from wled_controller.storage.template_store import TemplateStore
|
||||
from wled_controller.storage.picture_source_store import PictureSourceStore
|
||||
from wled_controller.storage.picture_source import ScreenCapturePictureSource
|
||||
@@ -246,8 +242,6 @@ async def list_engines(_auth: AuthRequired):
|
||||
def test_template(
|
||||
test_request: TemplateTestRequest,
|
||||
_auth: AuthRequired,
|
||||
processor_manager: ProcessorManager = Depends(get_processor_manager),
|
||||
device_store: DeviceStore = Depends(get_device_store),
|
||||
):
|
||||
"""Test a capture template configuration.
|
||||
|
||||
@@ -267,24 +261,6 @@ def test_template(
|
||||
detail=f"Engine '{test_request.engine_type}' is not available on this system"
|
||||
)
|
||||
|
||||
# Check if display is already being captured
|
||||
locked_device_id = processor_manager.get_display_lock_info(test_request.display_index)
|
||||
if locked_device_id:
|
||||
# Get device info for better error message
|
||||
try:
|
||||
device = device_store.get_device(locked_device_id)
|
||||
device_name = device.name
|
||||
except Exception:
|
||||
device_name = locked_device_id
|
||||
|
||||
raise HTTPException(
|
||||
status_code=409,
|
||||
detail=(
|
||||
f"Display {test_request.display_index} is currently being captured by device "
|
||||
f"'{device_name}'. Please stop the device processing before testing this template."
|
||||
)
|
||||
)
|
||||
|
||||
# Create and initialize capture stream
|
||||
stream = EngineRegistry.create_stream(
|
||||
test_request.engine_type, test_request.display_index, test_request.engine_config
|
||||
|
||||
Reference in New Issue
Block a user