Peach: Local-first video metadata scraper and media manager.
fix(marks): 排除 Life Promotion 内置标识分发
longmeidao7204aaa0cf15
diff --git a/docs/REUSE.md b/docs/REUSE.mdindex b276f91f6..df5939b15 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -1,5 +1,11 @@# 复用清单+## 第三方标识的发行边界++`resources/marks/` 保存用于实体身份展示的内置标识,来源记录与文件哈希见同目录 `manifest.json`。来源可追溯不等于取得图片版权或商标授权,图片也不因与应用同仓库就自动适用 AGPL。++Life Promotion 标识的公开分发授权依据未取得,发行资源不收录其图片。`scripts/sync_brand_marks.py` 的发行排除项同时覆盖裸文件、`icon` 和 `logo`,保留用户本机已有图片及实体来源链接;缺少本机图片时沿用界面的文字/首字回退。此项不改变 ADR-0026 对其他实体标识的收录边界。+## GitLab 与 R2 发布Windows 构建路径解析复用 PowerShell 7 的原生 [`GetUnresolvedProviderPathFromPSPath`](https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.pathintrinsics.getunresolvedproviderpathfrompspath);以当前 PowerShell 工作位置解析尚未创建的文件,无新增依赖或安装体积。安装更新验收使用 GitLab 官方[预定义变量](https://docs.gitlab.com/ci/variables/predefined_variables/)识别受保护版本标签及指定作业,沿用 Windows 注册表的既有安装检查。离线 PowerShell 回归覆盖进程工作目录与脚本工作位置不同的输入;主机检查覆盖受保护作业、未知作业与既有安装登记。diff --git a/resources/marks/manifest.json b/resources/marks/manifest.jsonindex 1ccef300c..2ac367bf9 100644--- a/resources/marks/manifest.json+++ b/resources/marks/manifest.json@@ -849,39 +849,6 @@"content_type": "image/png","imported_at": "2026-09-23T08:53:28Z"},- {- "file": "Life_Promotion.icon.png",- "studio": "Life_Promotion",- "variant": "icon",- "source": "studio icon harvest",- "source_url": "https://pbs.twimg.com/profile_images/1269895774516592642/K8Dbc4uF.png",- "sha256": "8cd93df426b17edd1b95b7cc1628c980ee81fa6c3f5a5ca83f88cb2ed31326f4",- "bytes": 15717,- "content_type": "image/png",- "imported_at": "2026-09-05T07:17:37Z"- },- {- "file": "Life_Promotion.logo.png",- "studio": "Life_Promotion",- "variant": "logo",- "source": "studio icon harvest",- "source_url": "https://pbs.twimg.com/profile_images/1269895774516592642/K8Dbc4uF.png",- "sha256": "8cd93df426b17edd1b95b7cc1628c980ee81fa6c3f5a5ca83f88cb2ed31326f4",- "bytes": 15717,- "content_type": "image/png",- "imported_at": "2026-09-05T07:17:37Z"- },- {- "file": "Life_Promotion.png",- "studio": "Life_Promotion",- "variant": "",- "source": "studio icon harvest",- "source_url": "https://life-promotion.com/",- "sha256": "f8fb22416679dbd29f48f4fe2740d3892019556c24407ab6a3eefd71f54b6d98",- "bytes": 12750,- "content_type": "image/png",- "imported_at": "2026-09-05T00:57:33Z"- },{"file": "Luminous_Promotion.png","studio": "Luminous_Promotion",diff --git a/resources/marks/studios/Life_Promotion.icon.png b/resources/marks/studios/Life_Promotion.icon.pngdeleted file mode 100644index a28756c57..000000000Binary files a/resources/marks/studios/Life_Promotion.icon.png and /dev/null differdiff --git a/resources/marks/studios/Life_Promotion.logo.png b/resources/marks/studios/Life_Promotion.logo.pngdeleted file mode 100644index a28756c57..000000000Binary files a/resources/marks/studios/Life_Promotion.logo.png and /dev/null differdiff --git a/resources/marks/studios/Life_Promotion.png b/resources/marks/studios/Life_Promotion.pngdeleted file mode 100644index 65cf6c820..000000000Binary files a/resources/marks/studios/Life_Promotion.png and /dev/null differdiff --git a/scripts/sync_brand_marks.py b/scripts/sync_brand_marks.pyindex 24aa0f31b..02072bd8c 100644--- a/scripts/sync_brand_marks.py+++ b/scripts/sync_brand_marks.py@@ -42,6 +42,9 @@ from peach.previews import LOGO_VARIANTS#: 一一对应,否则收得进去、运行时认不出类型。EXTENSIONS = {mime: ext for ext, mime in brand_marks.CONTENT_TYPES.items()}+# 发行排除项只限制随仓库分发,不删除用户的本机缓存。+DISTRIBUTION_EXCLUSIONS = {"life_promotion": "标识公开分发的授权依据未取得"}+def variant_of(stem: str) -> str:"""`Attackers.icon` → `icon`;裸文件返回空串。"""@@ -57,6 +60,10 @@ def collect(source: Path) -> tuple[list[dict], list[dict]]:skipped: list[dict] = []for path in sorted(source.glob("*.img")):stem = path.name[:-len(".img")]+ studio = stem.rsplit(".", 1)[0] if variant_of(stem) else stem+ if studio.casefold() in DISTRIBUTION_EXCLUSIONS:+ skipped.append({"name": stem, "reason": "distribution_excluded"})+ continuesidecar = path.with_name(f"{path.name}.provenance.json")meta = {}if sidecar.is_file():@@ -79,7 +86,7 @@ def collect(source: Path) -> tuple[list[dict], list[dict]]:continuetaken.append({"file": f"{stem}{extension}",- "studio": stem.rsplit(".", 1)[0] if variant_of(stem) else stem,+ "studio": studio,"variant": variant_of(stem),"source": meta.get("source", ""),"source_url": url,diff --git a/tests/test_brand_marks.py b/tests/test_brand_marks.pyindex 7c5a9934c..25c8ae115 100644--- a/tests/test_brand_marks.py+++ b/tests/test_brand_marks.py@@ -215,6 +215,28 @@ class SyncScriptTests(unittest.TestCase):found, _type = service.logo("Baked", variant)self.assertEqual(target / "studios" / "Baked.png", found)+ def test_distribution_exclusions_preserve_local_files(self):+ """发行排除项的各变体留在本机,普通标识照常收录。"""+ png = b"\x89PNG\r\n\x1a\n" + b"0" * 64+ with tempfile.TemporaryDirectory() as raw:+ base = pathlib.Path(raw).resolve()+ source, target = base / "logos", base / "marks"+ source.mkdir()+ names = ("Life_Promotion", "life_promotion.icon", "LIFE_PROMOTION.logo", "Other")+ for name in names:+ self._fixture(source, name, png, {"source_url": "https://x.test/a.png"})+ result = self._run(source, target, "--apply")+ self.assertEqual(1, result["taken"])+ self.assertEqual(3, result["skipped"])+ self.assertEqual(["distribution_excluded"], result["reasons"])+ self.assertEqual({"Other.png"}, {p.name for p in (target / "studios").iterdir()})+ self.assertTrue(all((source / f"{name}.img").is_file() for name in names))+ service = PreviewService.__new__(PreviewService)+ service.logo_root = source+ service.marks_root = target / "studios"+ found, _type = service.logo("Life Promotion", "icon")+ self.assertTrue(found.samefile(source / "life_promotion.icon.img"))+def test_dry_run_writes_nothing(self):png = b"\x89PNG\r\n\x1a\n" + b"0" * 64with tempfile.TemporaryDirectory() as raw: