From 8814f907807a3eb9a5e489b90061112e1f753ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Sat, 29 Aug 2026 02:05:50 +0100 Subject: [PATCH] slim-embedded-art: strip the ID3v1 appendix on rewrite (v1=0) Redundant with the v2 frames, 128 bytes of legacy, and the thing whose sync update tripped the audio guard. Applies to files being rewritten; files already slimmed before this keep their synced v1. --- scripts/slim-embedded-art.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/slim-embedded-art.py b/scripts/slim-embedded-art.py index bb8f0b2..1f43ea7 100755 --- a/scripts/slim-embedded-art.py +++ b/scripts/slim-embedded-art.py @@ -137,7 +137,10 @@ def process(path, apply): t.delall("PIC") t.add(APIC(encoding=0, mime="image/jpeg", type=3, desc="", data=jpeg)) v2 = 4 if tag.version >= (2, 4, 0) else 3 - t.save(v2_version=v2, padding=lambda info: 0) + # v1=0 REMOVES any trailing ID3v1 tag: it is a 128-byte legacy appendix fully redundant + # with the v2 frames, and keeping it in sync is what tripped the audio guard before the + # guard learned to exclude it. Decided 2026-08-29: strip it wherever we rewrite. + t.save(v1=0, v2_version=v2, padding=lambda info: 0) if audio_region_hash(tmp) != before: raise RuntimeError("audio bytes changed - keeping original") os.replace(tmp, path)