| … | … | @@ -321,3 +321,20 @@ def test_the_summary_says_other_languages_are_not_checked(lib, monkeypatch): |
| 321 | 321 | addon._sync_subtitles(dest) |
| 322 | 322 | assert addon._subtitle_summary(dest) == \ |
| 323 | 323 | "English: corrected (was -2.25 s, speed 1.001) · 2 other languages not checked" |
| 324 | |
| 325 | |
| 326 | def test_a_track_the_user_kept_is_reported_and_never_re_synced(lib, monkeypatch): |
| 327 | """2026-10-04: the user restored two withdrawn Bleach tracks. They are |
| 328 | recorded as "kept" at the restored file's identity, so a later sync skips |
| 329 | them instead of withdrawing them again, and Watch says so.""" |
| 330 | dest, _ = lib |
| 331 | monkeypatch.setattr(addon, "SUBSYNC_LANGUAGES", ("en",)) |
| 332 | en = _srt(dest, "en") |
| 333 | with open(addon.SUBTITLE_SYNC_FILE, "w") as f: |
| 334 | json.dump({os.path.abspath(en): {"status": "kept", "offset": 22.18, |
| 335 | "scale": 1.0, |
| 336 | "identity": addon._file_identity(en)}}, f) |
| 337 | monkeypatch.setattr(addon, "_subsync_measure", |
| 338 | lambda *a: pytest.fail("re-measured a kept track")) |
| 339 | assert addon._sync_subtitles(dest)["tracks"] == 0 |
| 340 | assert addon._subtitle_summary(dest) == "English: kept as fetched (measured 22.18 s off)" |