Commit 3652e22
committed
fix: address 2 new review comments and CI mypy failures on PR #20
Two new review comments arrived after the previous round. This commit
addresses both plus the CI mypy failure they exposed.
CodeRabbit Major (comment #36) — race in _ensure_jobs initialization:
- plexmuxy_gui/api.py: pywebview runs exposed js_api methods on separate
threads, so the lazy first-access path in _ensure_jobs could create
duplicate JobStore/JobQueue instances over the same state store. Added a
threading.Lock (_jobs_lock) to __init__ and wrapped the lazy
initialization so concurrent callers cannot double-initialize.
CodeRabbit Minor (comment #37) — gate _embed_ass_subtitles on format:
- plexmuxy/muxer.py: scanner.py forwards configured subtitle_extensions
unchanged and the default config includes .ssa, so non-ASS inputs can
reach _embed_ass_subtitles. Added _ASS_SUBTITLE_SUFFIXES = {'.ass',
'.ssa'} and skip tracks whose suffix is not ASS/SSA compatible, leaving
them for normal muxing instead of passing them to embed_fonts_into_ass.
CI mypy failure (exposed by the earlier os.startfile change):
- plexmuxy_gui/api.py: os.startfile is Windows-only and absent from the
Linux CI type stubs. Kept the direct os.startfile(path) call inside the
sys.platform == 'win32' guard with '# type: ignore[attr-defined]'.
Verified with 'mypy --platform linux' (Success) since the ignore is
required and consumed on the Linux CI where os.startfile does not exist
in the stubs.
All 341 non-integration tests pass; ruff and mypy (Linux platform) report
no issues.1 parent bb29b20 commit 3652e22
2 files changed
Lines changed: 26 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
89 | 95 | | |
90 | 96 | | |
91 | 97 | | |
| |||
147 | 153 | | |
148 | 154 | | |
149 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
| |||
1107 | 1108 | | |
1108 | 1109 | | |
1109 | 1110 | | |
1110 | | - | |
1111 | | - | |
1112 | | - | |
1113 | | - | |
1114 | | - | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1115 | 1120 | | |
1116 | 1121 | | |
1117 | 1122 | | |
| |||
1376 | 1381 | | |
1377 | 1382 | | |
1378 | 1383 | | |
1379 | | - | |
1380 | | - | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
1381 | 1389 | | |
1382 | 1390 | | |
1383 | 1391 | | |
| |||
0 commit comments