Skip to content

Commit 1754de5

Browse files
committed
Add immutable plan snapshots and mux verification
Refactor muxing workflow from single-pass to plan-execute model with stale-input checking, structural verification, and atomic output replacement. Add config migration, diagnostics export, background GUI jobs with progress tracking, and comprehensive integration tests. Improve safety with archive resource limits, font conflict detection, and shared resource cleanup coordination. Introduce new models (EpisodeIdentity, SourceTrackInfo, FileSnapshot, MuxPlanSnapshot) and rewrite matcher for global confidence assignment. Replace pymkv subprocess library use with direct mkvmerge -J JSON verification.
1 parent 09fd8b1 commit 1754de5

62 files changed

Lines changed: 3182 additions & 1218 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/integration.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: real-media-integration
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main, refactor]
7+
tags: ["v*"]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
mkvmerge:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
17+
with:
18+
persist-credentials: false
19+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
20+
with:
21+
python-version: "3.12"
22+
- run: sudo apt-get update && sudo apt-get install -y ffmpeg mkvtoolnix p7zip-full
23+
- run: python -m pip install -e ".[dev]"
24+
- run: python -m pytest -m integration -v
25+

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
release:
12+
runs-on: windows-latest
13+
steps:
14+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
15+
with:
16+
persist-credentials: false
17+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
18+
with:
19+
python-version: "3.12"
20+
- name: Verify tag matches package version
21+
shell: pwsh
22+
run: |
23+
$expected = "v$(python -c 'import plexmuxy; print(plexmuxy.__version__)')"
24+
if ($env:GITHUB_REF_NAME -ne $expected) { throw "Tag $env:GITHUB_REF_NAME does not match $expected" }
25+
- run: python -m pip install -e ".[dev,build,gui]"
26+
- run: python -m pytest -m "not integration"
27+
- run: python -m build
28+
- run: python -m PyInstaller --clean --noconfirm plexmuxy-cli.spec
29+
- run: python -m PyInstaller --clean --noconfirm plexmuxy-gui.spec
30+
- name: Package executables and checksums
31+
shell: pwsh
32+
run: |
33+
Compress-Archive -Path dist/plexmuxy/* -DestinationPath dist/plexmuxy-windows-x64.zip
34+
Compress-Archive -Path dist/plexmuxy-gui/* -DestinationPath dist/plexmuxy-gui-windows-x64.zip
35+
Get-ChildItem dist -File | ForEach-Object {
36+
$hash = (Get-FileHash -Algorithm SHA256 -LiteralPath $_.FullName).Hash.ToLower()
37+
"$hash $($_.Name)" | Add-Content -Encoding ascii dist/SHA256SUMS.txt
38+
}
39+
- name: Create GitHub release
40+
shell: pwsh
41+
env:
42+
GH_TOKEN: ${{ github.token }}
43+
run: gh release create $env:GITHUB_REF_NAME (Get-ChildItem dist -File | ForEach-Object FullName) --verify-tag --generate-notes --title "PlexMuxy $env:GITHUB_REF_NAME"
44+

.github/workflows/security.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: dependency-security
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "17 8 * * 1"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
audit:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
16+
with:
17+
persist-credentials: false
18+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
19+
with:
20+
python-version: "3.12"
21+
- run: python -m pip install -e . pip-audit
22+
- run: python -m pip_audit

.github/workflows/test.yml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,54 @@ permissions:
88
contents: read
99

1010
jobs:
11-
test:
12-
runs-on: windows-latest
11+
unit:
12+
name: ${{ matrix.os }} / Python ${{ matrix.python }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
os: [ubuntu-latest, windows-latest, macos-latest]
18+
python: ["3.10", "3.11", "3.12", "3.13"]
19+
steps:
20+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
21+
with:
22+
persist-credentials: false
23+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
24+
with:
25+
python-version: ${{ matrix.python }}
26+
- run: python -m pip install -e ".[dev]"
27+
- run: python -m pytest -m "not integration"
28+
29+
quality:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
33+
with:
34+
persist-credentials: false
35+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
36+
with:
37+
python-version: "3.12"
38+
- run: python -m pip install -e ".[dev]"
39+
- run: python -m ruff check plexmuxy plexmuxy_gui tests
40+
- run: python -m mypy plexmuxy plexmuxy_gui
41+
- run: python -m pytest -m "not integration" --cov --cov-report=term --cov-fail-under=75
42+
43+
package:
44+
runs-on: ubuntu-latest
1345
steps:
1446
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5
1547
with:
1648
persist-credentials: false
1749
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
1850
with:
1951
python-version: "3.12"
20-
- run: pip install -e ".[dev]"
21-
- run: pytest
52+
- run: python -m pip install build
53+
- run: python -m build
54+
- name: Test wheel in a clean environment
55+
run: |
56+
python -m venv /tmp/plexmuxy-wheel-test
57+
/tmp/plexmuxy-wheel-test/bin/pip install dist/*.whl
58+
cd /tmp
59+
/tmp/plexmuxy-wheel-test/bin/plexmuxy --help
60+
/tmp/plexmuxy-wheel-test/bin/plexmuxy show-config
61+
/tmp/plexmuxy-wheel-test/bin/python -m plexmuxy --help

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
__pycache__
2+
.coverage
3+
.mypy_cache/
4+
.ruff_cache/
5+
.pytest_cache/
6+
*.egg-info/
7+
dist/
28
.idea
39
*.bat
410
*.exe
511
build/
612
main.spec
7-
*.mo
13+
*.mo

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Changelog
2+
3+
All notable changes follow Keep a Changelog categories.
4+
5+
## [Unreleased]
6+
7+
### Added
8+
9+
- Immutable, serializable plan snapshots and `execute-plan`.
10+
- Versioned config migration, atomic config saving, backup reports, and diagnostics export.
11+
- Background GUI jobs with progress, cancellation, accessible live status, and safe DOM construction.
12+
- Real-media integration suite, multi-platform/Python CI, coverage, static checks, wheel verification, PyInstaller release builds, and SHA-256 generation.
13+
- ASS/SSA referenced-font discovery, archive resource limits, conflict handling, and source-track plan metadata.
14+
15+
### Changed
16+
17+
- Matching now performs global confidence assignment and skips ambiguity by default.
18+
- Muxing uses cancellable subprocesses, temporary outputs, structural verification, and bounded concurrency.
19+
- Source tracks are preserved by default; filtering remains opt-in future work.
20+
21+
### Fixed
22+
23+
- Prevented movie fallback across multi-video directories.
24+
- Prevented cleanup before output verification and premature cleanup of shared resources.
25+
- Prevented failed or partial mux output from replacing a valid destination.
26+
27+
### Security
28+
29+
- Added plan tamper/staleness checks, archive traversal/resource defenses, atomic writes, and double confirmation for destructive actions.
30+
31+
### Deprecated
32+
33+
- `main.py`, top-level `config.py`, `subtitle_utils.py`, and legacy `thread_count` configuration.

0 commit comments

Comments
 (0)