Skip to content

armgit / peach

Public Imported from GitHub
0

Peach: Local-first video metadata scraper and media manager.

fix(media): 补齐预览契约与播放器行为回归

longmeidao52b23c4e553d
diff --git a/docs/reference-snapshots/strm-source-evidence.md b/docs/reference-snapshots/strm-source-evidence.md
index abf1027a5..ac5718e81 100644
--- a/docs/reference-snapshots/strm-source-evidence.md
+++ b/docs/reference-snapshots/strm-source-evidence.md
@@ -1,6 +1,6 @@
# STRM 与挂载来源参考
-核对日期:2026-10-17。本文件是人工取证笔记,不登记为可由上游字节覆盖的 snapshot。
+核对日期:2026-10-17。本文件汇总多个来源与本机实测,无法对应单一可重抓快照,因此不登记进 `docs/reference-sources.json`。
源码链接固定 revision;产品文档仅作行为说明,没有逐字复制或引入运行依赖。
## 实测证据
diff --git a/frontend/e2e/canonical-routes.test.ts b/frontend/e2e/canonical-routes.test.ts
index c8791d74f..7bfdc7c1a 100644
--- a/frontend/e2e/canonical-routes.test.ts
+++ b/frontend/e2e/canonical-routes.test.ts
@@ -106,7 +106,7 @@ describe('规范路由与设置历史', () => {
const opened = await openItemPage(browser, `/assets/${ITEM.plain}`, viewport);
const { page } = opened;
try {
- await page.locator('#stage video').waitFor({ state: 'attached' });
+ await page.locator('#stage video.vjs-tech').waitFor({ state: 'attached' });
await page.evaluate(() => {
Object.assign(window, { routeVideo: document.querySelector('#stage video') });
document.querySelector<HTMLElement>('#settingsBtn')!.click();
diff --git a/frontend/e2e/follow-detail.test.ts b/frontend/e2e/follow-detail.test.ts
index 6bdb605ed..67900e9f3 100644
--- a/frontend/e2e/follow-detail.test.ts
+++ b/frontend/e2e/follow-detail.test.ts
@@ -160,7 +160,7 @@ describe('关注详情岛', () => {
// 控制条在用户一段时间不动后会隐去(Video.js 的 userActive),只等它挂上,不等可见。
await frame.locator('.video-js .vjs-control-bar').waitFor({ state: 'attached' });
assert.equal(await frame.locator('[data-ambient-canvas]').count(), 1);
- assert.equal(await frame.locator('.video-js video').count(), 1, '媒体框里的 video 不止一个');
+ assert.equal(await frame.locator('.video-js video.vjs-tech').count(), 1, '媒体框里的活动 video 不止一个');
await watchStage(page);
const seen = watchFollowRequests(page);
await page.locator('[data-follow-queue-item="5102"]').click();
diff --git a/frontend/e2e/immerse.test.ts b/frontend/e2e/immerse.test.ts
index 4f238ac3b..36b0f247d 100644
--- a/frontend/e2e/immerse.test.ts
+++ b/frontend/e2e/immerse.test.ts
@@ -83,7 +83,7 @@ describe('沉浸模式', () => {
.observe(document, { childList: true, subtree: true });
});
await page.goto(new URL(`/immerse?id=${wide.id}`, page.url()).href, { waitUntil: 'domcontentloaded' });
- await page.locator('[data-immerse-track] [data-immerse-slide] video').waitFor({ state: 'attached' });
+ await page.locator('[data-immerse-track] [data-immerse-slide] video.vjs-tech').waitFor({ state: 'attached' });
// 首条出画前:框、动作列、作者标题一样都不露,出画时一次摆成横屏。
const loaderHidden = () => page.evaluate(() => document.querySelector<HTMLElement>('[data-immerse-loader]')!.hidden);
diff --git a/frontend/e2e/item-detail.test.ts b/frontend/e2e/item-detail.test.ts
index aac8c230c..2dcf4fc28 100644
--- a/frontend/e2e/item-detail.test.ts
+++ b/frontend/e2e/item-detail.test.ts
@@ -594,10 +594,10 @@ describe('作品详情岛', () => {
assert.equal(await page.locator('#stage').getByText('2 个版本', { exact: true }).count(), 1);
await page.locator('#stage [data-queue-item="32"]').click();
await page.locator('#stage [data-queue-item="32"][aria-current="true"]').waitFor();
- await page.locator('#stage video').dispatchEvent('ended');
+ await page.locator('#stage video.vjs-tech').dispatchEvent('ended');
await pathIs(page, '/assets/33?editions=31');
await page.locator('#stage [data-queue-item="33"][aria-current="true"]').waitFor();
- await page.locator('#stage video').dispatchEvent('ended');
+ await page.locator('#stage video.vjs-tech').dispatchEvent('ended');
assert.equal(new URL(page.url()).pathname + new URL(page.url()).search, '/assets/33?editions=31');
const bounds = await layout(page);
assert.ok(bounds.scrollWidth <= bounds.viewportWidth + 1, JSON.stringify(bounds));
diff --git a/frontend/e2e/item-gallery.test.ts b/frontend/e2e/item-gallery.test.ts
index 4d3694807..51a03c476 100644
--- a/frontend/e2e/item-gallery.test.ts
+++ b/frontend/e2e/item-gallery.test.ts
@@ -15,7 +15,7 @@ describe('馆藏 JAV 官方预览', () => {
await page.route('**/stream?*', route => route.continue({ url: new URL(`/stream?id=${process.env.PEACH_E2E_ITEM}`, page.url()).href }));
await page.goto(new URL(`/assets/${COVER_ONLY_ITEM.id}`, page.url()).href);
const frame = page.locator('[data-item-gallery]');
- const video = frame.locator('video');
+ const video = frame.locator('video.vjs-tech');
await page.waitForFunction(() => (document.querySelector<HTMLVideoElement>('[data-item-gallery] video')?.readyState || 0) >= 3);
assert.equal(await frame.locator('[data-follow-image-dots] button').count(), 2);
await video.evaluate(node => { const video = node as HTMLVideoElement; video.muted = true; video.pause(); video.currentTime = 0.5 });
@@ -81,12 +81,12 @@ describe('馆藏 JAV 官方预览', () => {
assert.ok(await frame.locator('[data-carousel-below]').isVisible());
const restoredBox = await player.boundingBox();
assert.ok(restoredBox && videoBox && Math.abs(restoredBox.width - videoBox.width) < 2 && Math.abs(restoredBox.height - videoBox.height) < 2);
- await frame.locator('video').evaluate(node => { const video = node as HTMLVideoElement; video.muted = true; void video.play() });
+ await frame.locator('video.vjs-tech').evaluate(node => { const video = node as HTMLVideoElement; video.muted = true; void video.play() });
await page.waitForFunction(() => (document.querySelector<HTMLVideoElement>('[data-item-gallery] video')?.currentTime || 0) > 0);
await frame.getByRole('button', { name: '预览 2', exact: true }).click();
await frame.locator('[data-catalog-picture]').waitFor({ state: 'visible' });
assert.match(await frame.locator('[data-catalog-picture]').getAttribute('src') || '', /n=3$/);
- assert.ok(await frame.locator('video').evaluate(node => (node as HTMLVideoElement).paused), '查看图片暂停正片');
+ assert.ok(await frame.locator('video.vjs-tech').evaluate(node => (node as HTMLVideoElement).paused), '查看图片暂停正片');
assert.ok(await frame.locator('.video-js').isHidden());
await page.keyboard.press('Tab');
await frame.getByRole('button', { name: '预览 1', exact: true }).focus();
@@ -100,7 +100,7 @@ describe('馆藏 JAV 官方预览', () => {
await page.waitForFunction(() => document.querySelector('[data-catalog-picture]')?.getAttribute('src')?.endsWith('n=1'));
await frame.getByRole('button', { name: '播放正片', exact: true }).click();
await frame.locator('.video-js').waitFor({ state: 'visible' });
- assert.ok(await frame.locator('video').evaluate(node => (node as HTMLVideoElement).currentTime > 0), '切回正片保留位置');
+ assert.ok(await frame.locator('video.vjs-tech').evaluate(node => (node as HTMLVideoElement).currentTime > 0), '切回正片保留位置');
await settle(page);
const geometry = await layout(page);
assert.ok(geometry.scrollWidth <= geometry.viewportWidth + 1);
@@ -131,7 +131,7 @@ describe('馆藏 JAV 官方预览', () => {
await frame.getByRole('status', { name: '正在读取样图' }).waitFor();
await page.waitForFunction(() => (document.querySelector<HTMLVideoElement>('[data-item-gallery] video')?.readyState || 0) >= 3);
await player.evaluate(node => { (node as HTMLElement).dataset.galleryProbe = 'kept' });
- await frame.locator('video').evaluate(node => { const video = node as HTMLVideoElement; video.pause(); video.currentTime = 0.5 });
+ await frame.locator('video.vjs-tech').evaluate(node => { const video = node as HTMLVideoElement; video.pause(); video.currentTime = 0.5 });
const normalFrame = await frame.boundingBox();
release();
await frame.getByRole('button', { name: '预览 11', exact: true }).waitFor();
@@ -146,7 +146,7 @@ describe('馆藏 JAV 官方预览', () => {
assert.ok(await player.isHidden());
await frame.getByRole('button', { name: '播放正片', exact: true }).click();
assert.equal(await player.getAttribute('data-gallery-probe'), 'kept');
- assert.ok(await frame.locator('video').evaluate(node => Math.abs((node as HTMLVideoElement).currentTime - 0.5) < 0.1));
+ assert.ok(await frame.locator('video.vjs-tech').evaluate(node => Math.abs((node as HTMLVideoElement).currentTime - 0.5) < 0.1));
const imageReads = images;
await frame.getByRole('button', { name: '预览 1', exact: true }).click();
await frame.locator('[data-jav-picture]').waitFor();
diff --git a/frontend/e2e/jav-detail.test.ts b/frontend/e2e/jav-detail.test.ts
index 30d6347a2..e5ba2f915 100644
--- a/frontend/e2e/jav-detail.test.ts
+++ b/frontend/e2e/jav-detail.test.ts
@@ -258,7 +258,7 @@ describe('库外 JAV 作品详情', () => {
await page.getByRole('button', { name: '上一项媒体', exact: true }).click();
await page.getByRole('button', { name: '视频预览', exact: true }).first().click();
await page.waitForFunction(() => { const video = document.querySelector<HTMLVideoElement>('[data-jav-video] video'); return video && video.readyState >= 1 && Number.isFinite(video.duration) && video.duration > 0 });
- assert.ok(await page.locator('[data-jav-video] video').evaluate(video => (video as HTMLVideoElement).paused), '预览等待用户播放');
+ assert.ok(await page.locator('[data-jav-video] video.vjs-tech').evaluate(video => (video as HTMLVideoElement).paused), '预览等待用户播放');
const preview = page.locator('[data-jav-video]');
const playerBox = await preview.locator('.video-js').boundingBox();
assert.ok(playerBox && Math.abs(playerBox.width / playerBox.height - 16 / 9) < 0.02, JSON.stringify(playerBox));
@@ -266,16 +266,16 @@ describe('库外 JAV 作品详情', () => {
assert.ok(playerBox && indicatorBox && indicatorBox.y >= playerBox.y + playerBox.height, '视频 indicator 位于播放器下方');
await preview.getByRole('button', { name: '播放', exact: true }).waitFor({ state: 'visible' });
assert.equal(await preview.locator('.vjs-control-bar').evaluate(el => getComputedStyle(el).visibility), 'visible');
- await preview.locator('video').evaluate(node => { (node as HTMLVideoElement).muted = true });
+ await preview.locator('video.vjs-tech').evaluate(node => { (node as HTMLVideoElement).muted = true });
await preview.getByRole('button', { name: '播放', exact: true }).click();
await page.waitForFunction(() => (document.querySelector<HTMLVideoElement>('[data-jav-video] video')?.currentTime || 0) > 0);
await preview.getByRole('button', { name: '暂停', exact: true }).click();
- assert.ok(await preview.locator('video').evaluate(node => (node as HTMLVideoElement).paused));
+ assert.ok(await preview.locator('video.vjs-tech').evaluate(node => (node as HTMLVideoElement).paused));
await preview.getByRole('button', { name: '设置', exact: true }).click();
await preview.getByRole('menuitem', { name: /播放速度/ }).waitFor({ state: 'visible' });
await preview.getByRole('button', { name: '设置', exact: true }).click();
await page.getByRole('button', { name: '查看图片', exact: true }).click();
- assert.equal(await page.locator('[data-jav-video] video').count(), 0, '切回图片卸下预览播放器');
+ assert.equal(await page.locator('[data-jav-video] video.vjs-tech').count(), 0, '切回图片卸下预览播放器');
const frames = await page.evaluate(() => (window as unknown as { detailHeightFrames: { width: number; height: number }[] }).detailHeightFrames);
assert.ok(frames.length > 3);
for (const width of new Set(frames.map(frame => frame.width))) {
diff --git a/frontend/e2e/smoke.test.ts b/frontend/e2e/smoke.test.ts
index 67cfcb7a4..65cbf8731 100644
--- a/frontend/e2e/smoke.test.ts
+++ b/frontend/e2e/smoke.test.ts
@@ -136,7 +136,7 @@ const ROUTES: readonly Route[] = [
path: `/assets/${requiredEnv('PEACH_E2E_ITEM')}`,
body: (page) => {
const stage = page.getByRole('dialog', { name: '作品详情' });
- return [stage, stage.locator('video')];
+ return [stage, stage.locator('video.vjs-tech')];
},
},
];
diff --git a/frontend/e2e/video-wall.test.ts b/frontend/e2e/video-wall.test.ts
index 2b6d352dc..cb77e239d 100644
--- a/frontend/e2e/video-wall.test.ts
+++ b/frontend/e2e/video-wall.test.ts
@@ -269,7 +269,7 @@ describe('播放墙的浏览与详情', () => {
const requested = page.waitForRequest(request => new URL(request.url()).pathname === '/api/item' && new URL(request.url()).searchParams.get('id') === String(target));
await page.locator(`[data-wall-source="${target}"]`).click();
await requested;
- await page.locator('[data-wall-player] video').waitFor();
+ await page.locator('[data-wall-player] video.vjs-tech').waitFor();
assert.equal(new URL(page.url()).pathname, '/wall');
assert.equal(await page.getByText('请打开详情选择分卷或版本', { exact:true }).count(), 0);
await page.getByRole('button', { name:'切换分卷或版本', exact:true }).click();
@@ -288,8 +288,8 @@ describe('播放墙的浏览与详情', () => {
const requested = page.waitForRequest(request => new URL(request.url()).pathname === '/api/item' && new URL(request.url()).searchParams.get('id') === '41');
await page.locator('[data-wall-source="41"]').click();
await requested;
- await page.locator('[data-wall-focus][data-wall-id="41"] [data-wall-player] video').waitFor();
- assert.equal(await page.locator('[data-wall-player] video').count(), 1);
+ await page.locator('[data-wall-focus][data-wall-id="41"] [data-wall-player] video.vjs-tech').waitFor();
+ assert.equal(await page.locator('[data-wall-player] video.vjs-tech').count(), 1);
assert.equal(new URL(page.url()).pathname, '/wall');
} finally { await opened.close() }
});
diff --git a/frontend/test/react/media-source-marks.test.tsx b/frontend/test/react/media-source-marks.test.tsx
new file mode 100644
index 000000000..663b6f1a8
--- /dev/null
+++ b/frontend/test/react/media-source-marks.test.tsx
@@ -0,0 +1,25 @@
+import { expect, it, vi } from 'vitest';
+import { MEDIA_SOURCE_REGISTRY } from '../../src/core/media-sources';
+import { MEDIA_SOURCE_ICONS } from '../../src/ui-kit/media-source-icons';
+import { SourceSelect } from '../../src/react/settings/folder-rows';
+import { SourceMark } from '../../src/react/settings/section';
+import { mount } from './render';
+
+vi.mock('@peach/legacy/ui', async (original) => ({
+ ...await original<Record<string, unknown>>(),
+ MEDIA_SOURCE_ICONS: (await import('../../src/ui-kit/media-source-icons')).MEDIA_SOURCE_ICONS,
+}));
+
+it.each(MEDIA_SOURCE_REGISTRY)('$label 的选择项与状态使用同一来源标识', async (source) => {
+ const mark = MEDIA_SOURCE_ICONS[source.id]!;
+ const host = await mount(<>
+ <SourceSelect index={0} value={source.id} onChange={() => undefined} />
+ <SourceMark mark={mark} />
+ </>);
+ if (mark.startsWith('data:')) {
+ expect([...host.querySelectorAll('img')].map((image) => image.getAttribute('src'))).toEqual([mark, mark]);
+ } else {
+ expect(host.querySelectorAll(`use[href="#i-${mark}"]`)).toHaveLength(2);
+ }
+ expect(host.querySelector('[src*="studio="]')).toBeNull();
+});
diff --git a/src/peach/media_processing_policy.py b/src/peach/media_processing_policy.py
index 44a45e987..91803946c 100644
--- a/src/peach/media_processing_policy.py
+++ b/src/peach/media_processing_policy.py
@@ -27,17 +27,3 @@ def save(state_root: Path, value: bool) -> None:
raise ValueError('请选择视频预览生成状态')
atomic_write_text(Path(state_root) / FILENAME,
json.dumps({'metadata_only': value}) + '\n')
-
-
-def q_media_processing(contract, _args):
- return {'metadata_only': metadata_only(contract.follow_state_root)}
-
-
-def w_media_processing(contract, body):
- value = (body or {}).get('metadata_only')
- save(contract.follow_state_root, value)
- if value:
- from .web_timeline_thumbnails import write_mode
- write_mode('off', Path(contract.follow_state_root) / 'timeline-thumbnails.json')
- contract.thumbnail_job.stop(resume=False)
- return q_media_processing(contract, {})
diff --git a/src/peach/web_router.py b/src/peach/web_router.py
index c0c531b4f..e9b237e4b 100644
--- a/src/peach/web_router.py
+++ b/src/peach/web_router.py
@@ -94,7 +94,6 @@ from .web_custom_metadata import q_custom_metadata, w_custom_metadata
from .web_resource_sync import w_purge_missing, w_resource_sync_apply, w_resource_sync_scan
from .web_review import q_review, w_review_decision, w_review_genre
from .web_settings import q_settings, w_settings
-from .media_processing_policy import q_media_processing, w_media_processing
from .web_library_shortcuts import q_library_shortcuts, w_library_shortcuts
from .web_folders import q_folders, w_folder_preview, w_folder_rule
from .web_scraping import (
@@ -103,7 +102,9 @@ from .web_scraping import (
)
from .web_state import WebContract, path_version
from .web_tasks import q_tasks
-from .web_timeline_thumbnails import q_thumbnail_jobs, q_timeline, w_thumbnail_jobs
+from .web_timeline_thumbnails import (
+ q_media_processing, q_thumbnail_jobs, q_timeline, w_media_processing, w_thumbnail_jobs,
+)
from .web_wants import q_wants, q_want_magnets, w_wants
from .web_stats import (
q_quality_goals,
diff --git a/src/peach/web_timeline_thumbnails.py b/src/peach/web_timeline_thumbnails.py
index aba68a4f6..bd35f300c 100644
--- a/src/peach/web_timeline_thumbnails.py
+++ b/src/peach/web_timeline_thumbnails.py
@@ -12,7 +12,7 @@ from .config import FFMPEG_DIR, STATE_DIR
from .ffmpeg import FFmpegResolver
from .fsutil import atomic_path
from .jobs import DiskGuard
-from .media_processing_policy import metadata_only
+from .media_processing_policy import metadata_only, save as save_processing_policy
from .platform import system_volume
#: 采集期间系统盘至少留这么多 GiB。数字和抽帧脚本的默认值同一个:真正会把系统盘写满的
@@ -42,6 +42,19 @@ def write_mode(mode: str, path: Path | None = None) -> None:
encoding='utf-8')
+def q_media_processing(contract, _args):
+ return {'metadata_only': metadata_only(contract.follow_state_root)}
+
+
+def w_media_processing(contract, body):
+ value = (body or {}).get('metadata_only')
+ save_processing_policy(contract.follow_state_root, value)
+ if value:
+ write_mode('off', Path(contract.follow_state_root) / 'timeline-thumbnails.json')
+ contract.thumbnail_job.stop(resume=False)
+ return q_media_processing(contract, {})
+
+
def q_timeline(contract, args):
"""一部片子的时间轴索引。没铺到就回空对象,页面据此决定要不要画这一层。
diff --git a/tests/test_fastapi_api.py b/tests/test_fastapi_api.py
index cdf3deeaf..2b14c4b54 100644
--- a/tests/test_fastapi_api.py
+++ b/tests/test_fastapi_api.py
@@ -3400,6 +3400,9 @@ PUBLIC_ROUTES = {
# 绑定单个资产与公开 Origin,验证后仍逐次检查媒体根目录。
("GET,HEAD", "/external-stream/{id}"),
("GET", "/external-playlist/{id}.m3u"),
+ # STRM 的 HLS 子资源供浏览器和外部播放器共用:处理函数验证浏览器会话,
+ # 或绑定资产与 Origin 的限时 HMAC;两条分支都检查媒体根目录及资源归属。
+ ("GET,HEAD", "/strm-resource/{id}/{key}"),
}
diff --git a/tests/test_guangya_sources.py b/tests/test_guangya_sources.py
index c1e6172b7..76c201d89 100644
--- a/tests/test_guangya_sources.py
+++ b/tests/test_guangya_sources.py
@@ -8,7 +8,7 @@ import unittest
from unittest.mock import Mock, patch
from peach import media_configuration, onboarding, organize, resource_identification, settings_file
-from peach import web_batch, web_catalog, web_organize, web_resource_sync
+from peach import web_batch, web_organize, web_resource_sync
from peach.media_sources import READ_ONLY_LOCATIONS, SCANNABLE_LOCATIONS, cost_for
from support.ledger import fresh_ledger
diff --git a/tests/test_rm_web.py b/tests/test_rm_web.py
index 3e9412f14..86c57fae7 100644
--- a/tests/test_rm_web.py
+++ b/tests/test_rm_web.py
@@ -1150,6 +1150,7 @@ class WebDataTests(unittest.TestCase):
"/api/tasks",
"/api/library-processing",
"/api/library-processing/issues",
+ "/api/media-processing",
"/api/thumbnail-jobs", "/api/timeline", "/api/media-repair",
"/api/scraping", "/api/scraping/cover", "/api/scraping/amane-bridge",
"/api/items", "/api/item", "/api/entity", "/api/entity/shapes", "/api/photos", "/api/photo-set",
@@ -1174,6 +1175,7 @@ class WebDataTests(unittest.TestCase):
self.assertEqual(set(rm_web.POST_HANDLERS), {
"/api/downloads", "/api/downloads/cancel", "/api/downloads/postprocess",
"/api/library-processing", "/api/thumbnail-jobs", "/api/media-repair",
+ "/api/media-processing",
"/api/scraping/settings", "/api/scraping/check", "/api/scraping/cover",
"/api/scraping/amane-bridge/check", "/api/scraping/amane-bridge/rebuild",
"/api/activity", "/api/play", "/api/feedback", "/api/watch-later",
diff --git a/tests/test_source_assertion_ratchet.py b/tests/test_source_assertion_ratchet.py
index 151e38d3b..07d2e6e27 100644
--- a/tests/test_source_assertion_ratchet.py
+++ b/tests/test_source_assertion_ratchet.py
@@ -47,7 +47,7 @@ BASELINE: dict[str, int] = {
"test_repo_hygiene.py": 2,
"test_scripts.py": 13,
"test_social_avatar_harvest.py": 2,
- "test_studio_icon_variants.py": 4,
+ "test_studio_icon_variants.py": 2,
"test_studio_site_harvest.py": 1,
"test_subprocess_encoding.py": 2,
"test_tray.py": 3,
diff --git a/tests/test_studio_icon_variants.py b/tests/test_studio_icon_variants.py
index 4655ed425..1e0b8e764 100644
--- a/tests/test_studio_icon_variants.py
+++ b/tests/test_studio_icon_variants.py
@@ -378,17 +378,8 @@ class PageSourceTests(unittest.TestCase):
with self.subTest(snippet=snippet):
self.assertIn(snippet, source)
- def test_one_disk_has_one_mark_wherever_it_shows_up(self):
- """网盘的图形只有一份,不因为取图入口不同而长成两枚。
-
- 来源角标、侧栏的来源筛选、媒体库切换器和配置页问的是同一件事「这是哪个网盘」。
- 其中一处改走 `/logo?studio=115`,同一块屏上就会同时出现站标和官方字标两枚 115,
- 读出来像两个来源;而厂牌那条取图链本来就不认网盘,115 能从那里取到只是名字
- 碰巧撞上了一个厂牌文件名。
- """
- source = (self.application / 'preferences.js').read_text(encoding='utf-8')
- self.assertIn('\'115\':`<img class="source-icon" src="${MEDIA_SOURCE_ICONS[\'115\']}" alt="">`,', source)
- self.assertIn('pikpak:`<img class="source-icon" src="${MEDIA_SOURCE_ICONS.pikpak}" alt="">`,', source)
+ def test_media_sources_do_not_request_studio_logos(self):
+ """网盘使用来源标识,实际图形由前端渲染回归核对;厂牌字标链不接收网盘名称。"""
for path in sorted((ROOT / 'frontend/src').rglob('*')):
if path.suffix in {'.js', '.ts', '.tsx'}:
self.assertNotIn("studio=115", path.read_text(encoding='utf-8'))
diff --git a/tests/test_web_e2e.py b/tests/test_web_e2e.py
index 8a98b5c7d..702a9e254 100644
--- a/tests/test_web_e2e.py
+++ b/tests/test_web_e2e.py
@@ -571,6 +571,7 @@ class MissingPrerequisiteTests(unittest.TestCase):
log_root = Path(folder).resolve()
case = WebE2ESmokeTests("test_every_route_holds_the_layout_and_runtime_invariants")
case.origin, case.item, case.chrome, case.node = "http://fixture", 1, "chrome", "node"
+ case.ffmpeg = "ffmpeg"
failed = subprocess.CompletedProcess([], 1, "# pass 1\n# fail 1\n", "failure")
batches = ((("e2e/first.test.ts",), 1), (("e2e/second.test.ts",), 1))
with mock.patch.dict(os.environ, {"PEACH_E2E_FILES": "[]"}), \