diff --git a/docs/plans/feature-roadmap.md b/docs/plans/feature-roadmap.md index 4561e12a15..6a1b5ae4e8 100644 --- a/docs/plans/feature-roadmap.md +++ b/docs/plans/feature-roadmap.md @@ -138,7 +138,7 @@ Upload-Post turned out to cover more than assumed: per-platform text fields (`ti **Decision (2026-11-03): A — restructure Streamlit.** B is not planned; keep it possible by building new features API-first. 1. Split `Main.py` into `webui/common.py` and `webui/components/` (one module per panel). Pure move, no behavior change, existing UI tests guard it. **Done 2026-11-03** (uncommitted). Page-level modules come with step A.2 via `st.navigation`; avoid a `webui/pages/` folder, which Streamlit turns into automatic multipage navigation. 2. Create page becomes a stepper: Script → Voice → Visuals → Subtitles & Music → Render → Publish, with a sticky summary/preview column. -3. Library page: grid of rendered videos with thumbnail, state, re-run, publish status. +3. Library page: grid of rendered videos with thumbnail, state, re-run, publish status. **Done 2026-11-04 as a dialog** (top bar > Library): switching pages would skip rendering the generation form, and Streamlit drops the state of widgets it does not render, so a half-typed subject or script would be lost. Thumbnails are the frame at 0.5 s, cached next to the video. 4. Visual pass on `styles.css`: one token set, dark/light, consistent spacing. 5. In parallel, every new feature (local AI, publish) gets API endpoints first, UI second → B becomes a front-end-only project later. diff --git a/test/services/test_webui_library.py b/test/services/test_webui_library.py new file mode 100644 index 0000000000..6493efbac9 --- /dev/null +++ b/test/services/test_webui_library.py @@ -0,0 +1,119 @@ +"""视频库:缩略图、发布状态与弹窗交互。""" + +import os +import subprocess +from pathlib import Path +from unittest.mock import patch + +import pytest +from streamlit.testing.v1 import AppTest + +from app.config import config +from app.models import const +from app.services import material as _material # noqa: F401 (resolve FFmpeg before patching) +from app.services import state as sm +from app.utils import utils +from webui.components import library + +ROOT_DIR = Path(__file__).parent.parent.parent +WEBUI_MAIN = ROOT_DIR / "webui" / "Main.py" + + +def _tiny_video(path: Path) -> Path: + subprocess.run( + [ + utils.get_ffmpeg_binary(), "-y", "-loglevel", "error", + "-f", "lavfi", "-i", "color=c=red:s=64x112:d=1", + "-pix_fmt", "yuv420p", str(path), + ], + check=True, capture_output=True, timeout=60, + ) + return path + + +def test_thumbnail_is_created_once_and_refreshed_for_newer_video(tmp_path): + video = _tiny_video(tmp_path / "final-1.mp4") + thumbnail = library.task_thumbnail(str(video)) + assert thumbnail == str(tmp_path / library.THUMBNAIL_NAME) + assert os.path.getsize(thumbnail) > 0 + with patch.object(library.subprocess, "run") as run: + assert library.task_thumbnail(str(video)) == thumbnail + run.assert_not_called() + future = os.path.getmtime(thumbnail) + 10 + os.utime(video, (future, future)) + with patch.object(library.subprocess, "run", wraps=subprocess.run) as run: + library.task_thumbnail(str(video)) + run.assert_called() + + +def test_thumbnail_returns_none_when_ffmpeg_cannot_read_the_file(tmp_path): + video = tmp_path / "final-1.mp4" + video.write_bytes(b"not a video") + assert library.task_thumbnail(str(video)) is None + + +@pytest.mark.parametrize( + "task, expected", + [ + ({}, "library.publish.none"), + ({"cross_post_state": const.CROSS_POST_STATE_PROCESSING}, "library.publish.pending"), + ({"cross_post_state": const.CROSS_POST_STATE_FAILED, "cross_post_error": "boom"}, + "library.publish.failed"), + ({"cross_post_state": const.CROSS_POST_STATE_COMPLETE, + "cross_post_results": [{"success": True}]}, "library.publish.done"), + ({"cross_post_state": const.CROSS_POST_STATE_COMPLETE, + "cross_post_results": [{"success": True, "scheduled": True, "job_id": "j"}]}, + "library.publish.queued"), + ], +) +def test_publish_status_labels(task, expected): + with patch.object(library, "tr", lambda key: key): + label, detail = library.publish_status(task) + assert label == expected + assert detail == ("boom" if expected == "library.publish.failed" else "") + + +def test_scheduled_status_shows_the_local_time(): + task = { + "cross_post_state": const.CROSS_POST_STATE_COMPLETE, + "cross_post_results": [{"scheduled": True, "scheduled_date": "2026-11-04T13:00:00Z"}], + } + with patch.object(library, "tr", lambda key: "at {date}"): + label, _ = library.publish_status(task) + assert label.startswith("at 2026-11-0") + + +@pytest.fixture +def library_app(tmp_path, monkeypatch): + tasks_dir = tmp_path / "storage" / "tasks" + task_dir = tasks_dir / "library-task" + task_dir.mkdir(parents=True) + _tiny_video(task_dir / "final-1.mp4") + (task_dir / "script.json").write_text('{"params": {"video_subject": "Coffee ritual"}}', encoding="utf-8") + monkeypatch.setattr(utils, "task_dir", lambda *a: str(tasks_dir if not a else tasks_dir / a[0])) + monkeypatch.setattr(sm.state, "get_all_tasks", lambda *_a, **_k: ([], 0)) + monkeypatch.setattr( + sm.state, "get_task", + lambda task_id: {"cross_post_state": const.CROSS_POST_STATE_COMPLETE, + "cross_post_results": [{"scheduled": True, "scheduled_date": "2026-11-04T13:00:00Z"}]}, + ) + with patch.object(config, "try_save_config", return_value=True): + app = AppTest.from_file(str(WEBUI_MAIN), default_timeout=60) + app.session_state["ui_language"] = "en" + app.run() + yield app, task_dir + + +def test_library_dialog_shows_videos_and_plays_them_inline(library_app): + app, task_dir = library_app + app.button(key="open_library_dialog_button").click().run() + assert not app.exception + captions = " ".join(item.value for item in app.caption) + assert "Scheduled for 2026-11-0" in captions + assert any("Coffee ritual" in item.value for item in app.markdown) + assert (task_dir / library.THUMBNAIL_NAME).is_file() + + app.button(key="library_play_library_task").click().run() + assert not app.exception + assert app.session_state["library_preview_video"] == str(task_dir / "final-1.mp4") + assert len(app.get("video")) == 1 diff --git a/webui/Main.py b/webui/Main.py index c12db6de3e..c6a05a08dd 100644 --- a/webui/Main.py +++ b/webui/Main.py @@ -44,6 +44,7 @@ ) from webui.components.audio_panel import _render_audio_settings from webui.components.generation_controls import _render_generation_controls +from webui.components.library import render_library_dialog from webui.components.script_panel import _render_script_settings from webui.components.settings_dialog import _render_settings_dialog from webui.components.settings_transfer import _apply_pending_settings_preset @@ -65,8 +66,11 @@ def _render_application(): """按固定顺序渲染顶部栏、弹窗、生成表单和任务结果。""" _render_top_bar() + # Streamlit 同一时间只能打开一个弹窗,设置优先。 if st.session_state.get("settings_dialog_open", False): _render_settings_dialog() + elif st.session_state.get("library_dialog_open", False): + render_library_dialog() if _apply_pending_settings_preset(): st.success(tr("Settings Preset Imported")) diff --git a/webui/components/library.py b/webui/components/library.py new file mode 100644 index 0000000000..bd76dddede --- /dev/null +++ b/webui/components/library.py @@ -0,0 +1,197 @@ +"""视频库弹窗:以缩略图网格浏览已生成的视频,并查看自动发布状态。 + +视频库用弹窗而不是独立页面:切换页面时生成表单不会渲染,Streamlit 会清掉 +这些控件的会话状态,用户正在填写的主题和文案就会丢失。 +""" + +import os +import subprocess +from datetime import datetime + +import streamlit as st +from loguru import logger + +from app.models import const +from app.services import state as sm +from app.utils import utils +from webui.common import localized_dialog, tr +from webui.components.tasks import ( + _collect_task_summaries, + _delete_task, + _format_task_time, + _open_task_path, + _queue_task_restore, +) + +THUMBNAIL_NAME = "thumbnail.jpg" +_PAGE_SIZE = 12 +_COLUMNS = 3 +_THUMBNAIL_TIMEOUT_SECONDS = 30 + + +def task_thumbnail(video_file: str) -> str | None: + """返回视频首帧缩略图,缺失或比视频旧时用 ffmpeg 重新生成。""" + thumbnail = os.path.join(os.path.dirname(video_file), THUMBNAIL_NAME) + try: + if os.path.getmtime(thumbnail) >= os.path.getmtime(video_file): + return thumbnail + except OSError: + pass + # 片头常是黑场或淡入,先取 0.5 秒处;更短的视频退回第一帧。 + for offset in ("0.5", "0"): + try: + subprocess.run( + [ + utils.get_ffmpeg_binary(), + "-y", "-loglevel", "error", + "-ss", offset, "-i", video_file, + "-frames:v", "1", "-vf", "scale=360:-2", + thumbnail, + ], + capture_output=True, + timeout=_THUMBNAIL_TIMEOUT_SECONDS, + check=False, + ) + except (OSError, subprocess.SubprocessError) as error: + logger.warning(f"failed to create task thumbnail: {video_file}, {error}") + return None + if os.path.isfile(thumbnail) and os.path.getsize(thumbnail) > 0: + return thumbnail + return None + + +def _format_iso_time(value) -> str: + try: + moment = datetime.fromisoformat(str(value).replace("Z", "+00:00")) + except ValueError: + return str(value or "") + return moment.astimezone().strftime("%Y-%m-%d %H:%M") + + +def publish_status(task: dict) -> tuple[str, str]: + """视频的发布状态:(标签, 补充说明)。""" + state = task.get("cross_post_state") + if not state: + return tr("library.publish.none"), "" + if state in (const.CROSS_POST_STATE_PENDING, const.CROSS_POST_STATE_PROCESSING): + return tr("library.publish.pending"), "" + if state == const.CROSS_POST_STATE_FAILED: + return tr("library.publish.failed"), str(task.get("cross_post_error") or "") + results = [item for item in task.get("cross_post_results") or [] if isinstance(item, dict)] + scheduled = next((item for item in results if item.get("scheduled")), None) + if scheduled is None: + return tr("library.publish.done"), "" + when = scheduled.get("scheduled_date") or scheduled.get("queue_slot") + if when: + return tr("library.publish.scheduled").format(date=_format_iso_time(when)), "" + return tr("library.publish.queued"), "" + + +def _finished_videos(): + tasks = _collect_task_summaries(limit=200) + return [ + task for task in tasks + if task.get("video_file") and os.path.isfile(task["video_file"]) + ] + + +def _runtime_task(task_id: str) -> dict: + try: + return sm.state.get_task(task_id) or {} + except Exception as error: + logger.warning(f"failed to load task for the library: {task_id}, {error}") + return {} + + +def _safe_key(task_id: str) -> str: + return "".join(ch if ch.isalnum() else "_" for ch in task_id)[:40] + + +def _render_card(task: dict): + task_id = task["task_id"] + key = _safe_key(task_id) + with st.container(border=True, key=f"library_card_{key}"): + thumbnail = task_thumbnail(task["video_file"]) + if thumbnail: + st.image(thumbnail, width="stretch") + st.markdown(f"**{task['subject']}**") + label, detail = publish_status(_runtime_task(task_id)) + st.caption(f"{_format_task_time(task['mtime'])} · {label}") + if detail: + st.caption(detail) + actions = st.columns(4, gap="small") + # 回调在页面重跑前执行,播放器位于网格上方,本次重跑就能显示。 + actions[0].button( + tr("library.play"), key=f"library_play_{key}", icon=":material/play_arrow:", + help=tr("library.play"), width="stretch", + on_click=st.session_state.__setitem__, + args=("library_preview_video", task["video_file"]), + ) + if actions[1].button( + tr("Open Task Folder"), key=f"library_open_{key}", icon=":material/folder_open:", + help=tr("Open Task Folder"), width="stretch", + ): + _open_task_path(task["task_path"]) + has_restore_data = os.path.isfile(os.path.join(task["task_path"], "script.json")) + if actions[2].button( + tr("Regenerate Task"), key=f"library_restore_{key}", icon=":material/replay:", + help=tr("Regenerate Task"), width="stretch", disabled=not has_restore_data, + ): + st.session_state.pop("library_dialog_open", None) + _queue_task_restore(task_id) + st.rerun() + if actions[3].button( + tr("Delete Task"), key=f"library_delete_{key}", icon=":material/delete:", + help=tr("Delete Task"), width="stretch", + ): + if _delete_task(task_id, task["task_path"], task.get("state")): + st.toast(tr("Task Deleted")) + st.rerun() + else: + st.error(tr("Task Delete Failed")) + + +def _render_preview(): + preview = st.session_state.get("library_preview_video") + if not preview: + return + tasks_root = os.path.abspath(utils.task_dir()) + # 只播放任务目录内的文件,避免会话状态被改成任意本地路径。 + if not (os.path.abspath(preview).startswith(tasks_root + os.sep) and os.path.isfile(preview)): + st.session_state.pop("library_preview_video", None) + return + # 竖屏视频按弹窗全宽显示会高过整个屏幕,放在中间一栏。 + player = st.columns([1, 1, 1])[1] + with player: + st.video(preview, autoplay=True) + if st.button(tr("Close"), key="library_close_preview", width="stretch"): + st.session_state.pop("library_preview_video", None) + st.rerun() + st.divider() + + +def _dismiss_library(): + st.session_state.pop("library_dialog_open", None) + st.session_state.pop("library_preview_video", None) + + +def open_library(): + st.session_state["library_dialog_open"] = True + + +@localized_dialog("library.title", width="large", on_dismiss=_dismiss_library) +def render_library_dialog(): + _render_preview() + tasks = _finished_videos() + if not tasks: + st.info(tr("library.empty")) + return + shown = st.session_state.get("library_shown", _PAGE_SIZE) + for start in range(0, min(shown, len(tasks)), _COLUMNS): + columns = st.columns(_COLUMNS) + for column, task in zip(columns, tasks[start:start + _COLUMNS]): + with column: + _render_card(task) + if len(tasks) > shown and st.button(tr("library.show_more"), key="library_show_more"): + st.session_state["library_shown"] = shown + _PAGE_SIZE + st.rerun() diff --git a/webui/components/top_bar.py b/webui/components/top_bar.py index d08127bee9..31b6b85c55 100644 --- a/webui/components/top_bar.py +++ b/webui/components/top_bar.py @@ -13,6 +13,7 @@ locales, tr, ) +from webui.components.library import open_library from webui.components.tasks import _render_task_manager_entry @@ -110,6 +111,15 @@ def _render_top_bar(): ): _render_task_manager_entry() + st.button( + tr("library.open"), + key="open_library_dialog_button", + type="secondary", + icon=":material/video_library:", + width="content", + on_click=open_library, + ) + st.button( tr("Settings"), key="open_settings_dialog_button", diff --git a/webui/i18n/az.json b/webui/i18n/az.json index b0f96fb66b..6b4ab853c2 100644 --- a/webui/i18n/az.json +++ b/webui/i18n/az.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Upload-Post növbəmdə növbəti boş vaxt", "upload_post.schedule.delay": "Müəyyən saat sonra", "upload_post.schedule.delay_hours": "Gözləmə saatı", - "upload_post.schedule.help": "Upload-Post planlaşdırılmış paylaşımları saxlayır və özü dərc edir, ona görə bu kompüter o vaxt sönülü ola bilər. Növbə vaxtlarını Upload-Post panelində qurun." + "upload_post.schedule.help": "Upload-Post planlaşdırılmış paylaşımları saxlayır və özü dərc edir, ona görə bu kompüter o vaxt sönülü ola bilər. Növbə vaxtlarını Upload-Post panelində qurun.", + "library.open": "Kitabxana", + "library.title": "Video kitabxanası", + "library.empty": "Hələ hazır video yoxdur. Yaratdığınız videolar burada görünəcək.", + "library.play": "Oynat", + "library.publish.none": "Dərc edilməyib", + "library.publish.pending": "Dərc edilir…", + "library.publish.done": "Dərc edildi", + "library.publish.scheduled": "{date} üçün planlaşdırılıb", + "library.publish.queued": "Upload-Post növbəsinə əlavə edildi", + "library.publish.failed": "Dərc etmək alınmadı", + "library.show_more": "Daha çox göstər" } } diff --git a/webui/i18n/ca.json b/webui/i18n/ca.json index 33a22753ab..1dfde07932 100644 --- a/webui/i18n/ca.json +++ b/webui/i18n/ca.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Següent franja lliure de la meva cua d'Upload-Post", "upload_post.schedule.delay": "Després d'un nombre d'hores", "upload_post.schedule.delay_hours": "Hores d'espera", - "upload_post.schedule.help": "Upload-Post desa les publicacions programades i les publica ell mateix, així que aquest ordinador pot estar apagat. Configura les franges de la cua al tauler d'Upload-Post." + "upload_post.schedule.help": "Upload-Post desa les publicacions programades i les publica ell mateix, així que aquest ordinador pot estar apagat. Configura les franges de la cua al tauler d'Upload-Post.", + "library.open": "Biblioteca", + "library.title": "Biblioteca de vídeos", + "library.empty": "Encara no hi ha vídeos acabats. Els vídeos que generis apareixeran aquí.", + "library.play": "Reprodueix", + "library.publish.none": "Sense publicar", + "library.publish.pending": "S'està publicant…", + "library.publish.done": "Publicat", + "library.publish.scheduled": "Programat per a {date}", + "library.publish.queued": "Afegit a la cua d'Upload-Post", + "library.publish.failed": "No s'ha pogut publicar", + "library.show_more": "Mostra'n més" } } diff --git a/webui/i18n/de.json b/webui/i18n/de.json index f649012f54..519f6c6068 100644 --- a/webui/i18n/de.json +++ b/webui/i18n/de.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Nächster freier Platz in meiner Upload-Post-Warteschlange", "upload_post.schedule.delay": "Nach einer festen Anzahl Stunden", "upload_post.schedule.delay_hours": "Wartezeit in Stunden", - "upload_post.schedule.help": "Upload-Post speichert geplante Beiträge und veröffentlicht sie selbst, dieser Computer kann dann ausgeschaltet sein. Warteschlangen-Zeiten richten Sie im Upload-Post-Dashboard ein." + "upload_post.schedule.help": "Upload-Post speichert geplante Beiträge und veröffentlicht sie selbst, dieser Computer kann dann ausgeschaltet sein. Warteschlangen-Zeiten richten Sie im Upload-Post-Dashboard ein.", + "library.open": "Bibliothek", + "library.title": "Videobibliothek", + "library.empty": "Noch keine fertigen Videos. Erzeugte Videos erscheinen hier.", + "library.play": "Abspielen", + "library.publish.none": "Nicht veröffentlicht", + "library.publish.pending": "Wird veröffentlicht…", + "library.publish.done": "Veröffentlicht", + "library.publish.scheduled": "Geplant für {date}", + "library.publish.queued": "In der Upload-Post-Warteschlange", + "library.publish.failed": "Veröffentlichung fehlgeschlagen", + "library.show_more": "Mehr anzeigen" } } diff --git a/webui/i18n/en.json b/webui/i18n/en.json index b77d34c5ea..3967bfd5ae 100644 --- a/webui/i18n/en.json +++ b/webui/i18n/en.json @@ -811,6 +811,17 @@ "upload_post.schedule.queue": "Next free slot in my Upload-Post queue", "upload_post.schedule.delay": "A set number of hours later", "upload_post.schedule.delay_hours": "Hours to wait", - "upload_post.schedule.help": "Upload-Post stores scheduled posts and publishes them itself, so this computer can be off by then. Set up queue slots in the Upload-Post dashboard." + "upload_post.schedule.help": "Upload-Post stores scheduled posts and publishes them itself, so this computer can be off by then. Set up queue slots in the Upload-Post dashboard.", + "library.open": "Library", + "library.title": "Video library", + "library.empty": "No finished videos yet. Videos you generate appear here.", + "library.play": "Play", + "library.publish.none": "Not published", + "library.publish.pending": "Publishing…", + "library.publish.done": "Published", + "library.publish.scheduled": "Scheduled for {date}", + "library.publish.queued": "Added to the Upload-Post queue", + "library.publish.failed": "Publishing failed", + "library.show_more": "Show more" } } diff --git a/webui/i18n/es.json b/webui/i18n/es.json index 615a90f6da..8d3498bd6d 100644 --- a/webui/i18n/es.json +++ b/webui/i18n/es.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Siguiente hueco libre de mi cola de Upload-Post", "upload_post.schedule.delay": "Tras un número de horas", "upload_post.schedule.delay_hours": "Horas de espera", - "upload_post.schedule.help": "Upload-Post guarda las publicaciones programadas y las publica él mismo, así que este ordenador puede estar apagado. Configura los huecos de la cola en el panel de Upload-Post." + "upload_post.schedule.help": "Upload-Post guarda las publicaciones programadas y las publica él mismo, así que este ordenador puede estar apagado. Configura los huecos de la cola en el panel de Upload-Post.", + "library.open": "Biblioteca", + "library.title": "Biblioteca de vídeos", + "library.empty": "Aún no hay vídeos terminados. Los vídeos que generes aparecerán aquí.", + "library.play": "Reproducir", + "library.publish.none": "Sin publicar", + "library.publish.pending": "Publicando…", + "library.publish.done": "Publicado", + "library.publish.scheduled": "Programado para {date}", + "library.publish.queued": "Añadido a la cola de Upload-Post", + "library.publish.failed": "Error al publicar", + "library.show_more": "Mostrar más" } } diff --git a/webui/i18n/fr.json b/webui/i18n/fr.json index 5cfd1524fd..86889dbd0d 100644 --- a/webui/i18n/fr.json +++ b/webui/i18n/fr.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Prochain créneau libre de ma file Upload-Post", "upload_post.schedule.delay": "Après un nombre d'heures donné", "upload_post.schedule.delay_hours": "Heures d'attente", - "upload_post.schedule.help": "Upload-Post enregistre les publications programmées et les publie lui-même : cet ordinateur peut être éteint à ce moment-là. Configurez les créneaux de la file dans le tableau de bord Upload-Post." + "upload_post.schedule.help": "Upload-Post enregistre les publications programmées et les publie lui-même : cet ordinateur peut être éteint à ce moment-là. Configurez les créneaux de la file dans le tableau de bord Upload-Post.", + "library.open": "Bibliothèque", + "library.title": "Bibliothèque vidéo", + "library.empty": "Aucune vidéo terminée pour l'instant. Les vidéos générées apparaissent ici.", + "library.play": "Lire", + "library.publish.none": "Non publiée", + "library.publish.pending": "Publication…", + "library.publish.done": "Publiée", + "library.publish.scheduled": "Programmée pour {date}", + "library.publish.queued": "Ajoutée à la file Upload-Post", + "library.publish.failed": "Échec de la publication", + "library.show_more": "Afficher plus" } } diff --git a/webui/i18n/id.json b/webui/i18n/id.json index 7eb6e0f806..5592023ab1 100644 --- a/webui/i18n/id.json +++ b/webui/i18n/id.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Slot kosong berikutnya di antrean Upload-Post saya", "upload_post.schedule.delay": "Setelah sejumlah jam", "upload_post.schedule.delay_hours": "Jam menunggu", - "upload_post.schedule.help": "Upload-Post menyimpan postingan terjadwal dan memublikasikannya sendiri, jadi komputer ini boleh mati saat itu. Atur slot antrean di dasbor Upload-Post." + "upload_post.schedule.help": "Upload-Post menyimpan postingan terjadwal dan memublikasikannya sendiri, jadi komputer ini boleh mati saat itu. Atur slot antrean di dasbor Upload-Post.", + "library.open": "Pustaka", + "library.title": "Pustaka video", + "library.empty": "Belum ada video yang selesai. Video yang Anda buat muncul di sini.", + "library.play": "Putar", + "library.publish.none": "Belum dipublikasikan", + "library.publish.pending": "Memublikasikan…", + "library.publish.done": "Dipublikasikan", + "library.publish.scheduled": "Dijadwalkan pada {date}", + "library.publish.queued": "Ditambahkan ke antrean Upload-Post", + "library.publish.failed": "Gagal memublikasikan", + "library.show_more": "Tampilkan lagi" } } diff --git a/webui/i18n/it.json b/webui/i18n/it.json index a38cd5677f..32237d3480 100644 --- a/webui/i18n/it.json +++ b/webui/i18n/it.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Prossimo spazio libero nella mia coda Upload-Post", "upload_post.schedule.delay": "Dopo un numero di ore stabilito", "upload_post.schedule.delay_hours": "Ore di attesa", - "upload_post.schedule.help": "Upload-Post salva i post programmati e li pubblica da sé, quindi questo computer può essere spento. Imposta gli spazi della coda nella dashboard di Upload-Post." + "upload_post.schedule.help": "Upload-Post salva i post programmati e li pubblica da sé, quindi questo computer può essere spento. Imposta gli spazi della coda nella dashboard di Upload-Post.", + "library.open": "Libreria", + "library.title": "Libreria video", + "library.empty": "Nessun video completato. I video generati compaiono qui.", + "library.play": "Riproduci", + "library.publish.none": "Non pubblicato", + "library.publish.pending": "Pubblicazione…", + "library.publish.done": "Pubblicato", + "library.publish.scheduled": "Programmato per {date}", + "library.publish.queued": "Aggiunto alla coda di Upload-Post", + "library.publish.failed": "Pubblicazione non riuscita", + "library.show_more": "Mostra altri" } } diff --git a/webui/i18n/ko.json b/webui/i18n/ko.json index d1d7c95b03..d9323dd813 100644 --- a/webui/i18n/ko.json +++ b/webui/i18n/ko.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "내 Upload-Post 대기열의 다음 빈 시간대", "upload_post.schedule.delay": "지정한 시간 후", "upload_post.schedule.delay_hours": "대기 시간(시간)", - "upload_post.schedule.help": "Upload-Post가 예약 게시물을 저장해 직접 게시하므로 그때 이 컴퓨터는 꺼져 있어도 됩니다. 대기열 시간대는 Upload-Post 대시보드에서 설정하세요." + "upload_post.schedule.help": "Upload-Post가 예약 게시물을 저장해 직접 게시하므로 그때 이 컴퓨터는 꺼져 있어도 됩니다. 대기열 시간대는 Upload-Post 대시보드에서 설정하세요.", + "library.open": "라이브러리", + "library.title": "영상 라이브러리", + "library.empty": "완성된 영상이 아직 없습니다. 생성한 영상이 여기에 표시됩니다.", + "library.play": "재생", + "library.publish.none": "게시 안 됨", + "library.publish.pending": "게시 중…", + "library.publish.done": "게시됨", + "library.publish.scheduled": "{date}에 게시 예약됨", + "library.publish.queued": "Upload-Post 대기열에 추가됨", + "library.publish.failed": "게시 실패", + "library.show_more": "더 보기" } } diff --git a/webui/i18n/pt.json b/webui/i18n/pt.json index dfa4895a0a..d639be0f4f 100644 --- a/webui/i18n/pt.json +++ b/webui/i18n/pt.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Próximo horário livre na minha fila do Upload-Post", "upload_post.schedule.delay": "Depois de um número de horas", "upload_post.schedule.delay_hours": "Horas de espera", - "upload_post.schedule.help": "O Upload-Post guarda as publicações agendadas e as publica sozinho, então este computador pode estar desligado. Configure os horários da fila no painel do Upload-Post." + "upload_post.schedule.help": "O Upload-Post guarda as publicações agendadas e as publica sozinho, então este computador pode estar desligado. Configure os horários da fila no painel do Upload-Post.", + "library.open": "Biblioteca", + "library.title": "Biblioteca de vídeos", + "library.empty": "Ainda não há vídeos prontos. Os vídeos gerados aparecem aqui.", + "library.play": "Reproduzir", + "library.publish.none": "Não publicado", + "library.publish.pending": "Publicando…", + "library.publish.done": "Publicado", + "library.publish.scheduled": "Agendado para {date}", + "library.publish.queued": "Adicionado à fila do Upload-Post", + "library.publish.failed": "Falha ao publicar", + "library.show_more": "Mostrar mais" } } diff --git a/webui/i18n/ru.json b/webui/i18n/ru.json index 278ec45fb7..c02740eb23 100644 --- a/webui/i18n/ru.json +++ b/webui/i18n/ru.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Ближайший свободный слот в моей очереди Upload-Post", "upload_post.schedule.delay": "Через заданное число часов", "upload_post.schedule.delay_hours": "Часов ожидания", - "upload_post.schedule.help": "Upload-Post сохраняет отложенные публикации и публикует их сам, поэтому компьютер к этому времени можно выключить. Слоты очереди настраиваются в панели Upload-Post." + "upload_post.schedule.help": "Upload-Post сохраняет отложенные публикации и публикует их сам, поэтому компьютер к этому времени можно выключить. Слоты очереди настраиваются в панели Upload-Post.", + "library.open": "Библиотека", + "library.title": "Библиотека видео", + "library.empty": "Готовых видео пока нет. Созданные видео появятся здесь.", + "library.play": "Воспроизвести", + "library.publish.none": "Не опубликовано", + "library.publish.pending": "Публикуется…", + "library.publish.done": "Опубликовано", + "library.publish.scheduled": "Запланировано на {date}", + "library.publish.queued": "Добавлено в очередь Upload-Post", + "library.publish.failed": "Не удалось опубликовать", + "library.show_more": "Показать ещё" } } diff --git a/webui/i18n/tr.json b/webui/i18n/tr.json index 6dbd4193bf..1cc85bc36f 100644 --- a/webui/i18n/tr.json +++ b/webui/i18n/tr.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Upload-Post kuyruğumdaki bir sonraki boş zaman", "upload_post.schedule.delay": "Belirli bir saat sonra", "upload_post.schedule.delay_hours": "Beklenecek saat", - "upload_post.schedule.help": "Upload-Post zamanlanmış gönderileri saklar ve kendisi yayınlar; o sırada bu bilgisayar kapalı olabilir. Kuyruk zamanlarını Upload-Post panelinden ayarlayın." + "upload_post.schedule.help": "Upload-Post zamanlanmış gönderileri saklar ve kendisi yayınlar; o sırada bu bilgisayar kapalı olabilir. Kuyruk zamanlarını Upload-Post panelinden ayarlayın.", + "library.open": "Kitaplık", + "library.title": "Video kitaplığı", + "library.empty": "Henüz tamamlanmış video yok. Ürettiğiniz videolar burada görünür.", + "library.play": "Oynat", + "library.publish.none": "Yayınlanmadı", + "library.publish.pending": "Yayınlanıyor…", + "library.publish.done": "Yayınlandı", + "library.publish.scheduled": "{date} için zamanlandı", + "library.publish.queued": "Upload-Post kuyruğuna eklendi", + "library.publish.failed": "Yayınlanamadı", + "library.show_more": "Daha fazla göster" } } diff --git a/webui/i18n/vi.json b/webui/i18n/vi.json index 3672e863c7..0a94e5b2a4 100644 --- a/webui/i18n/vi.json +++ b/webui/i18n/vi.json @@ -556,6 +556,17 @@ "upload_post.schedule.queue": "Khung giờ trống tiếp theo trong hàng đợi Upload-Post của tôi", "upload_post.schedule.delay": "Sau một số giờ nhất định", "upload_post.schedule.delay_hours": "Số giờ chờ", - "upload_post.schedule.help": "Upload-Post lưu bài đăng hẹn giờ và tự đăng, nên lúc đó máy tính này có thể tắt. Thiết lập khung giờ hàng đợi trong bảng điều khiển Upload-Post." + "upload_post.schedule.help": "Upload-Post lưu bài đăng hẹn giờ và tự đăng, nên lúc đó máy tính này có thể tắt. Thiết lập khung giờ hàng đợi trong bảng điều khiển Upload-Post.", + "library.open": "Thư viện", + "library.title": "Thư viện video", + "library.empty": "Chưa có video hoàn tất. Video bạn tạo sẽ hiện ở đây.", + "library.play": "Phát", + "library.publish.none": "Chưa đăng", + "library.publish.pending": "Đang đăng…", + "library.publish.done": "Đã đăng", + "library.publish.scheduled": "Hẹn đăng lúc {date}", + "library.publish.queued": "Đã thêm vào hàng đợi Upload-Post", + "library.publish.failed": "Đăng thất bại", + "library.show_more": "Xem thêm" } } diff --git a/webui/i18n/zh.json b/webui/i18n/zh.json index 93cd2e1c3f..f5694d1269 100644 --- a/webui/i18n/zh.json +++ b/webui/i18n/zh.json @@ -811,6 +811,17 @@ "upload_post.schedule.queue": "Upload-Post 发布队列中的下一个空闲时段", "upload_post.schedule.delay": "指定小时数之后", "upload_post.schedule.delay_hours": "等待小时数", - "upload_post.schedule.help": "Upload-Post 会保存定时发布并按时执行,到时本机可以关机。发布队列时段请在 Upload-Post 后台设置。" + "upload_post.schedule.help": "Upload-Post 会保存定时发布并按时执行,到时本机可以关机。发布队列时段请在 Upload-Post 后台设置。", + "library.open": "视频库", + "library.title": "视频库", + "library.empty": "还没有生成完成的视频。生成的视频会显示在这里。", + "library.play": "播放", + "library.publish.none": "未发布", + "library.publish.pending": "正在发布…", + "library.publish.done": "已发布", + "library.publish.scheduled": "定时发布:{date}", + "library.publish.queued": "已加入 Upload-Post 发布队列", + "library.publish.failed": "发布失败", + "library.show_more": "显示更多" } } diff --git a/webui/styles.css b/webui/styles.css index 6dac27640a..1460e3b937 100644 --- a/webui/styles.css +++ b/webui/styles.css @@ -366,6 +366,9 @@ div[class*="st-key-task_row_"] button[kind="secondary"] { /* 按钮文字视觉隐藏后,Streamlit 仍会保留图标与文字之间的默认间距,导致 单独图标向左偏移。清除该间距并让内容层占满按钮,确保操作图标严格居中。 */ div[class*="st-key-task_row_"] + button[kind="secondary"] + span[data-has-shortcut], +div[class*="st-key-library_card_"] button[kind="secondary"] span[data-has-shortcut] { width: 100% !important; @@ -375,7 +378,8 @@ div[class*="st-key-task_row_"] /* 行内操作保留可访问的按钮名称,但视觉上只显示图标。使用屏幕阅读器可见的 隐藏方式,而不是 display:none,确保每个操作仍能被正确朗读。 */ -div[class*="st-key-task_row_"] button[kind="secondary"] p { +div[class*="st-key-task_row_"] button[kind="secondary"] p, +div[class*="st-key-library_card_"] button[kind="secondary"] p { position: absolute !important; width: 1px !important; height: 1px !important;