Refactor capture engine architecture, rename PictureStream to PictureSource, and split API modules

- Separate CaptureEngine into stateless factory + stateful CaptureStream session
- Add LiveStream/LiveStreamManager for shared capture with reference counting
- Rename PictureStream to PictureSource across storage, API, and UI
- Remove legacy migration logic and unused compatibility code
- Split monolithic routes.py (1935 lines) into 5 focused route modules
- Split schemas.py (480 lines) into 7 schema modules with re-exports
- Extract dependency injection into dedicated dependencies.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 14:27:00 +03:00
parent b8389f080a
commit c3828e10fa
42 changed files with 4047 additions and 3797 deletions

View File

@@ -199,19 +199,19 @@
"confirm.no": "No",
"common.delete": "Delete",
"common.edit": "Edit",
"streams.title": "\uD83D\uDCFA Streams",
"streams.description": "Streams define the capture pipeline. A raw stream captures from a display using a capture template. A processed stream applies postprocessing to another stream. Assign streams to devices.",
"streams.title": "\uD83D\uDCFA Sources",
"streams.description": "Sources define the capture pipeline. A raw source captures from a display using a capture template. A processed source applies postprocessing to another source. Assign sources to devices.",
"streams.group.raw": "Screen Capture",
"streams.group.processed": "Processed",
"streams.section.streams": "\uD83D\uDCFA Streams",
"streams.add": "Add Stream",
"streams.section.streams": "\uD83D\uDCFA Sources",
"streams.add": "Add Source",
"streams.add.raw": "Add Screen Capture",
"streams.add.processed": "Add Processed Stream",
"streams.edit": "Edit Stream",
"streams.add.processed": "Add Processed Source",
"streams.edit": "Edit Source",
"streams.edit.raw": "Edit Screen Capture",
"streams.edit.processed": "Edit Processed Stream",
"streams.name": "Stream Name:",
"streams.name.placeholder": "My Stream",
"streams.edit.processed": "Edit Processed Source",
"streams.name": "Source Name:",
"streams.name.placeholder": "My Source",
"streams.type": "Type:",
"streams.type.raw": "Screen Capture",
"streams.type.processed": "Processed",
@@ -221,26 +221,26 @@
"streams.capture_template.hint": "Engine template defining how the screen is captured",
"streams.target_fps": "Target FPS:",
"streams.target_fps.hint": "Target frames per second for capture (10-90)",
"streams.source": "Source Stream:",
"streams.source.hint": "The stream to apply processing filters to",
"streams.source": "Source:",
"streams.source.hint": "The source to apply processing filters to",
"streams.pp_template": "Filter Template:",
"streams.pp_template.hint": "Filter template to apply to the source stream",
"streams.pp_template.hint": "Filter template to apply to the source",
"streams.description_label": "Description (optional):",
"streams.description_placeholder": "Describe this stream...",
"streams.created": "Stream created successfully",
"streams.updated": "Stream updated successfully",
"streams.deleted": "Stream deleted successfully",
"streams.delete.confirm": "Are you sure you want to delete this stream?",
"streams.error.load": "Failed to load streams",
"streams.description_placeholder": "Describe this source...",
"streams.created": "Source created successfully",
"streams.updated": "Source updated successfully",
"streams.deleted": "Source deleted successfully",
"streams.delete.confirm": "Are you sure you want to delete this source?",
"streams.error.load": "Failed to load sources",
"streams.error.required": "Please fill in all required fields",
"streams.error.delete": "Failed to delete stream",
"streams.test.title": "Test Stream",
"streams.error.delete": "Failed to delete source",
"streams.test.title": "Test Source",
"streams.test.run": "🧪 Run",
"streams.test.running": "Testing stream...",
"streams.test.running": "Testing source...",
"streams.test.duration": "Capture Duration (s):",
"streams.test.error.failed": "Stream test failed",
"streams.test.error.failed": "Source test failed",
"postprocessing.title": "\uD83D\uDCC4 Filter Templates",
"postprocessing.description": "Processing templates define image filters and color correction. Assign them to processed picture streams for consistent postprocessing across devices.",
"postprocessing.description": "Processing templates define image filters and color correction. Assign them to processed picture sources for consistent postprocessing across devices.",
"postprocessing.add": "Add Filter Template",
"postprocessing.edit": "Edit Filter Template",
"postprocessing.name": "Template Name:",
@@ -269,16 +269,16 @@
"postprocessing.error.delete": "Failed to delete processing template",
"postprocessing.config.show": "Show settings",
"postprocessing.test.title": "Test Filter Template",
"postprocessing.test.source_stream": "Source Stream:",
"postprocessing.test.source_stream": "Source:",
"postprocessing.test.running": "Testing processing template...",
"postprocessing.test.error.no_stream": "Please select a source stream",
"postprocessing.test.error.no_stream": "Please select a source",
"postprocessing.test.error.failed": "Processing template test failed",
"device.button.stream_selector": "Stream Settings",
"device.stream_settings.title": "📺 Stream Settings",
"device.stream_selector.label": "Stream:",
"device.stream_selector.hint": "Select a stream that defines what this device captures and processes",
"device.stream_selector.none": "-- No stream assigned --",
"device.stream_selector.saved": "Stream settings updated",
"device.button.stream_selector": "Source Settings",
"device.stream_settings.title": "📺 Source Settings",
"device.stream_selector.label": "Source:",
"device.stream_selector.hint": "Select a source that defines what this device captures and processes",
"device.stream_selector.none": "-- No source assigned --",
"device.stream_selector.saved": "Source settings updated",
"device.stream_settings.border_width": "Border Width (px):",
"device.stream_settings.border_width_hint": "How many pixels from the screen edge to sample for LED colors (1-100)",
"device.stream_settings.interpolation": "Interpolation Mode:",
@@ -288,10 +288,10 @@
"device.stream_settings.interpolation_hint": "How to calculate LED color from sampled pixels",
"device.stream_settings.smoothing": "Smoothing:",
"device.stream_settings.smoothing_hint": "Temporal blending between frames (0=none, 1=full). Reduces flicker.",
"device.tip.stream_selector": "Configure picture stream and LED projection settings for this device",
"device.tip.stream_selector": "Configure picture source and LED projection settings for this device",
"streams.group.static_image": "Static Image",
"streams.add.static_image": "Add Static Image",
"streams.edit.static_image": "Edit Static Image",
"streams.add.static_image": "Add Static Image Source",
"streams.edit.static_image": "Edit Static Image Source",
"streams.type.static_image": "Static Image",
"streams.image_source": "Image Source:",
"streams.image_source.placeholder": "https://example.com/image.jpg or C:\\path\\to\\image.png",

View File

@@ -199,19 +199,19 @@
"confirm.no": "Нет",
"common.delete": "Удалить",
"common.edit": "Редактировать",
"streams.title": "\uD83D\uDCFA Потоки",
"streams.description": "Потоки определяют конвейер захвата. Сырой поток захватывает экран с помощью шаблона захвата. Обработанный поток применяет постобработку к другому потоку. Назначайте потоки устройствам.",
"streams.title": "\uD83D\uDCFA Источники",
"streams.description": "Источники определяют конвейер захвата. Сырой источник захватывает экран с помощью шаблона захвата. Обработанный источник применяет постобработку к другому источнику. Назначайте источники устройствам.",
"streams.group.raw": "Захват Экрана",
"streams.group.processed": "Обработанные",
"streams.section.streams": "\uD83D\uDCFA Потоки",
"streams.add": "Добавить Поток",
"streams.section.streams": "\uD83D\uDCFA Источники",
"streams.add": "Добавить Источник",
"streams.add.raw": "Добавить Захват Экрана",
"streams.add.processed": "Добавить Обработанный",
"streams.edit": "Редактировать Поток",
"streams.edit": "Редактировать Источник",
"streams.edit.raw": "Редактировать Захват Экрана",
"streams.edit.processed": "Редактировать Обработанный Поток",
"streams.name": "Имя Потока:",
"streams.name.placeholder": "Мой Поток",
"streams.edit.processed": "Редактировать Обработанный Источник",
"streams.name": "Имя Источника:",
"streams.name.placeholder": "Мой Источник",
"streams.type": "Тип:",
"streams.type.raw": "Захват экрана",
"streams.type.processed": "Обработанный",
@@ -221,26 +221,26 @@
"streams.capture_template.hint": "Шаблон движка, определяющий способ захвата экрана",
"streams.target_fps": "Целевой FPS:",
"streams.target_fps.hint": "Целевое количество кадров в секунду (10-90)",
"streams.source": "Исходный Поток:",
"streams.source.hint": "Поток, к которому применяются фильтры обработки",
"streams.source": "Источник:",
"streams.source.hint": "Источник, к которому применяются фильтры обработки",
"streams.pp_template": "Шаблон Фильтра:",
"streams.pp_template.hint": "Шаблон фильтра для применения к исходному потоку",
"streams.pp_template.hint": "Шаблон фильтра для применения к источнику",
"streams.description_label": "Описание (необязательно):",
"streams.description_placeholder": "Опишите этот поток...",
"streams.created": "Поток успешно создан",
"streams.updated": "Поток успешно обновлён",
"streams.deleted": "Поток успешно удалён",
"streams.delete.confirm": "Вы уверены, что хотите удалить этот поток?",
"streams.error.load": "Не удалось загрузить потоки",
"streams.description_placeholder": "Опишите этот источник...",
"streams.created": "Источник успешно создан",
"streams.updated": "Источник успешно обновлён",
"streams.deleted": "Источник успешно удалён",
"streams.delete.confirm": "Вы уверены, что хотите удалить этот источник?",
"streams.error.load": "Не удалось загрузить источники",
"streams.error.required": "Пожалуйста, заполните все обязательные поля",
"streams.error.delete": "Не удалось удалить поток",
"streams.test.title": "Тест Потока",
"streams.error.delete": "Не удалось удалить источник",
"streams.test.title": "Тест Источника",
"streams.test.run": "🧪 Запустить",
"streams.test.running": "Тестирование потока...",
"streams.test.running": "Тестирование источника...",
"streams.test.duration": "Длительность Захвата (с):",
"streams.test.error.failed": "Тест потока не удался",
"streams.test.error.failed": "Тест источника не удался",
"postprocessing.title": "\uD83D\uDCC4 Шаблоны Фильтров",
"postprocessing.description": "Шаблоны обработки определяют фильтры изображений и цветокоррекцию. Назначайте их обработанным видеопотокам для единообразной постобработки на всех устройствах.",
"postprocessing.description": "Шаблоны обработки определяют фильтры изображений и цветокоррекцию. Назначайте их обработанным источникам для единообразной постобработки на всех устройствах.",
"postprocessing.add": "Добавить Шаблон Фильтра",
"postprocessing.edit": "Редактировать Шаблон Фильтра",
"postprocessing.name": "Имя Шаблона:",
@@ -269,16 +269,16 @@
"postprocessing.error.delete": "Не удалось удалить шаблон фильтра",
"postprocessing.config.show": "Показать настройки",
"postprocessing.test.title": "Тест шаблона фильтра",
"postprocessing.test.source_stream": "Источник потока:",
"postprocessing.test.source_stream": "Источник:",
"postprocessing.test.running": "Тестирование шаблона фильтра...",
"postprocessing.test.error.no_stream": "Пожалуйста, выберите источник потока",
"postprocessing.test.error.no_stream": "Пожалуйста, выберите источник",
"postprocessing.test.error.failed": "Тест шаблона фильтра не удался",
"device.button.stream_selector": "Настройки потока",
"device.stream_settings.title": "📺 Настройки потока",
"device.stream_selector.label": "Поток:",
"device.stream_selector.hint": "Выберите поток, определяющий что это устройство захватывает и обрабатывает",
"device.stream_selector.none": "-- Поток не назначен --",
"device.stream_selector.saved": "Настройки потока обновлены",
"device.button.stream_selector": "Настройки источника",
"device.stream_settings.title": "📺 Настройки источника",
"device.stream_selector.label": "Источник:",
"device.stream_selector.hint": "Выберите источник, определяющий что это устройство захватывает и обрабатывает",
"device.stream_selector.none": "-- Источник не назначен --",
"device.stream_selector.saved": "Настройки источника обновлены",
"device.stream_settings.border_width": "Ширина границы (px):",
"device.stream_settings.border_width_hint": "Сколько пикселей от края экрана выбирать для цвета LED (1-100)",
"device.stream_settings.interpolation": "Режим интерполяции:",
@@ -288,10 +288,10 @@
"device.stream_settings.interpolation_hint": "Как вычислять цвет LED из выбранных пикселей",
"device.stream_settings.smoothing": "Сглаживание:",
"device.stream_settings.smoothing_hint": "Временное смешивание между кадрами (0=нет, 1=полное). Уменьшает мерцание.",
"device.tip.stream_selector": "Настройки видеопотока и проекции LED для этого устройства",
"device.tip.stream_selector": "Настройки источника и проекции LED для этого устройства",
"streams.group.static_image": "Статические",
"streams.add.static_image": "Добавить статическое изображение",
"streams.edit.static_image": "Редактировать статическое изображение",
"streams.add.static_image": "Добавить статическое изображение (источник)",
"streams.edit.static_image": "Редактировать статическое изображение (источник)",
"streams.type.static_image": "Статическое изображение",
"streams.image_source": "Источник изображения:",
"streams.image_source.placeholder": "https://example.com/image.jpg или C:\\path\\to\\image.png",