Commit graph

343 commits

Author SHA1 Message Date
Luna
6b624a72cd Narrow bare except blocks so real errors aren't swallowed (roadmap A4)
Replaced all 46 bare 'except:' across the package with specific exception
types, and logged the cases that indicate a real problem:

- config load/save: FileNotFoundError is the silent first-run case; other
  OSError/ValueError/UnicodeDecodeError are logged.
- ffprobe/avprobe: JSON parse failures are now logged (previously a media
  file that ffprobe couldn't read just silently failed to import); decode
  fallbacks -> UnicodeDecodeError; duration parse -> ValueError/TypeError/
  KeyError; install check -> OSError/SubprocessError.
- executor: pre_/post_function and progress-polling hooks now use hasattr
  checks, and a real exception inside a defined hook is logged instead of
  swallowed; decode fallbacks and numeric parses narrowed.
- best-effort filesystem ops (makedirs/unlink) -> OSError.
- all backend check_is_installed probes -> OSError/SubprocessError.
- shutdown: also fixes a latent NameError ('failure' was only set in the
  except branch, so a successful logind PowerOff would crash the handler).

No bare 'except:' remain. Full suite (51 tests) green; GUI starts clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 01:02:33 -07:00
Luna
63f10f3aa0 Mark roadmap A3 (error surfacing) done
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 12:23:27 -07:00
Luna
8cb6e1aa52 Surface the real failure cause in the error dialog (roadmap A3)
On failure the error window showed a generic message with the whole log
buried in an expander. Lead instead with a focused summary: which step
failed (the process label), its command, and the last stderr lines, while
keeping the full log below. The runner passes the failing process to
error_window, which reads the executor's bounded stderr_data.

build_summary/_stderr_tail are static and unit-tested (tests/
test_error_summary.py): tail extraction, CR handling, blank-line skipping,
stdout fallback, long-line truncation, and Pango-markup escaping of paths/
messages containing & < ' so set_markup can't choke.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 12:22:55 -07:00
Luna
00fdbd50df Mark roadmap A1 (tests/CI) and A2 (subprocess hardening) done
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:53:19 -07:00
Luna
46c6d162a0 Harden subprocess I/O against pipe-backpressure deadlock (roadmap A2)
The executor drained child stdout/stderr via GLib.IOChannel watches on the
main loop, so a stalled or wedged GUI stopped draining the pipes and the
child would block on a full (~64KB) pipe forever — the cascade that froze a
batch when the editor/terminal died.

Replace the main-loop watches with per-stream background reader threads that
drain pipes with blocking reads into thread-safe buffers; a GLib timer on the
main thread consumes the buffers and does all parsing/UI (threads never touch
GObject/GTK). Now the child can never block on a pipe we own, regardless of
main-loop state. Also: stdout can go straight to a file when requested, stdin
is fed from a file in a thread, the retained end-of-job log is bounded, and
wait_end is guarded to run once.

Tests (tests/test_executor_io.py): line parsing incl. CR progress lines,
2MB output with no loss/deadlock, completion with the main loop never running
(the wedged-GUI case), cancel, stdout-to-file, and exit-code propagation.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:52:09 -07:00
Luna
691664095b Add pytest suite and CI (roadmap A1)
37 headless tests covering the logic that is cheap to break:
- split planner: plan_disc_split, chapter helpers (whole-fit, multi-disc
  partition, single-movie chapter/even-cut split, contiguous coverage)
- High-profile fill-disc bitrate math (disc count + bounds + capacity)
- ffmpeg command generation: profiles, text/image hardsub, 2-pass, nice,
  progress-to-file, even pad/crop + positive offsets, -ss seek, and the
  AC3 448k audio-clamp regression
- ffprobe subtitle detection: text/image classification, tags/disposition

tests/conftest.py makes the in-tree package importable and installs the
gettext _ builtin so modules run headless. Forgejo Actions workflow runs
the suite on push/PR. Update CLAUDE.md's testing section accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 22:26:22 -07:00
Luna
b5a6cfe25f Add project roadmap
Prioritized A/B/C plan: safety net (tests, subprocess hardening, error
surfacing) first, then finishing fork features, then modernization.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 05:22:14 -07:00
Luna
3d1ce504b9 Complete High-quality profile and add menus to split discs
High profile is now fully automatic instead of relying on the manual
"adjust disc usage" button:
- compute_high_profile_bitrate() (pure, unit-tested) picks the fewest discs
  that hold the content down to a quality floor, then fills each disc; a 2h
  movie lands on one filled disc (~3750k), a 4h movie on two, a 30min clip
  on one near the 9000k cap.
- apply_high_profile_bitrate() applies that rate to every title and forces
  2-pass; it runs before split planning so the existing splitter reuses it.

Split discs now get a per-disc menu (listing that disc's titles) when the
project has a menu enabled, honoring the startup/play-all settings; they
still auto-play when menus are off.

Fix: _adjust_audio_bitrate capped its table at 384 (an MP2 limit) and
silently clamped the High profile's 448k AC3 down to 384; extend the table
to AC3 rates (448/512/640) in both the ffmpeg and avconv backends.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 05:18:33 -07:00
Luna
5fe1013be8 Add CLAUDE.md and harden .gitignore
Document the fork's architecture and dev/verify workflow for future work
(no test framework; verify via pure-logic functions and generated
command_var). Extend .gitignore to exclude .claude/ local config
(machine-specific paths + personal permission allowlists), common secret
file patterns, and editor/OS junk, while keeping the shipped base_*.mpg
package data tracked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 04:50:16 -07:00
Luna
480ec59ba4 Read ffmpeg progress from a file, not a pipe, to avoid deadlock
Driving -progress over pipe:1 made ffmpeg block on the progress write
whenever the GUI stopped draining the pipe (e.g. the parent terminal or
the app's event loop wedging), deadlocking every running encode.

Write -progress to a temp file instead: a file write never blocks, so the
encoder runs to completion regardless of GUI state. The executor calls
optional start_/stop_progress_polling hooks; ffmpeg polls the file on a
500ms GLib timer and removes it when done. Verified an encode completes
with no reader at all (previously a hard deadlock).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 04:39:20 -07:00
Luna
7f574897c7 Fix progress reporting and desktop responsiveness during encode
The progress bar barely moved and the window showed "not responding"
during long encodes: ffmpeg's carriage-return stats line flushes rarely
over a pipe, and the transcode saturated the CPU.

- Drive progress from ffmpeg's structured `-progress pipe:1` output
  (`-stats_period 0.5 -nostats`) and parse out_time/progress in
  process_stdout, giving steady frequent updates (verified ~2/sec via the
  live executor pipe vs ~1 per whole encode before).
- Run the encoder under `nice -n 10` so the compositor keeps a CPU slice
  (avconv gets the nice prefix too).

Also round pad/crop targets to even dimensions and use positive crop
offsets, fixing an odd-height (e.g. 1079) MPEG-2 error surfaced when
burning in subtitles on a 1080p source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 04:31:05 -07:00
Luna
6cddd72792 Default to all-but-one core for encoding
Using every core for a parallel batch starves the compositor and makes
the GUI show "not responding". Default multicore to cores-1 so the
desktop keeps headroom; the user can still raise it in Preferences.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 04:30:37 -07:00
Luna
128e0f087d Document the hardsub/auto-split fork
Add FORK_NOTES.md describing the new features, a README pointer, and keep
the known-good baseline encoder as contrib/dvd-safe-converter.sh (the
reference the Compatibility profile is modelled on).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 12:54:37 -07:00
Luna
4f1ecb55ee Split over-long DVD projects across multiple discs
When a DVD project does not fit one disc at the chosen quality, offer to
split it into several full-quality discs instead of only degrading the
bitrate:

- A pure, unit-tested planner distributes whole titles across discs and
  time-splits a single over-long movie at the chapter boundary nearest each
  disc's capacity (even-time fallback when it has no chapters).
- on_create_disc_clicked asks split / reduce-bitrate / cancel, then authors
  each disc into its own subfolder and emits name-discN.iso per disc.
- dvdauthor_converter takes per-title segment lengths so a split segment's
  chapter markers stay inside the segment.

Also adds the project-level encode-profile selector (with custom-bitrate
fields) next to the disc-size control.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 12:52:50 -07:00
Luna
8b041f0725 Add DVD encode profiles and subtitle hardsub burn-in
Introduce three project-level DVD encode profiles (Compatibility 4500k /
High quality VBR / Custom) via new config keys, and burn a chosen
embedded subtitle track into the picture:

- file_movie carries the hardsub selection (index/kind), persists it, and
  builds a subtitle-picker combobox in its properties page; set_final_rates
  maps the profile to the final video/audio bitrate.
- ffmpeg burns text subs with the subtitles= filter after scaling and image
  subs with an overlay filtergraph before scaling; NTSC DVD audio is now AC3
  for all profiles. A start_offset (-ss) is threaded through for segmenting.
- avconv gets the text-sub path and start_offset for parity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 12:45:36 -07:00
Luna
a158119d41 Detect embedded subtitle tracks in analyzers
Add a subtitle branch to the ffprobe/avprobe stream loops that collects
each embedded subtitle track (index, codec, language, title, default/
forced flags) and classifies it as text or image by codec. This is the
basis for letting the user pick a track to burn into the picture.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 00:39:13 -07:00
Rastersoft
75aa10e4c8 Merge branch 'master' into 'master'
po: Add Georgian translation

See merge request rastersoft/devedeng!91
2026-02-22 22:06:23 +00:00
Ekaterine Papava
ffd1ef834b po: Add Georgian translation 2026-02-22 14:16:20 +00:00
Sergio Costas
b259a57a37 Update version in toml 2026-02-19 19:53:01 +01:00
Sergio Costas
041f6f2819 Update debian files 2026-02-19 19:48:12 +01:00
Sergio Costas
739beb853c Fix Fedora
Fedora doesn't support importlib_metadata; instead it uses
importlib.metadata. Since it works in everything else, the
change is sensible.
2026-02-19 19:45:53 +01:00
Sergio Costas
8b6f4538e6 Fix version number 2026-02-18 19:34:11 +01:00
Sergio Costas
3007f379c2 Fix dependencies 2026-02-18 19:33:10 +01:00
Sergio Costas
b5808a806a Updated HISTORY.md 2026-02-17 22:45:55 +01:00
Sergio Costas
e5cc3b2403 Update version 2026-02-17 22:16:20 +01:00
Rastersoft
708c595357 Merge branch 'fix-pkg-config' into 'master'
Remove pkg-config

See merge request rastersoft/devedeng!90
2026-02-17 20:36:09 +00:00
Sergio Costas
27e4ff04eb Remove pkg-config
pkg-config has been removed, so importlib.metadata should be used
instead.
2026-02-15 20:05:31 +01:00
Sergio Costas
18fa425dd9 Update the license comments 2025-08-29 18:26:12 +02:00
Sergio Costas
bee74f937a Update to version 4.21.0 2025-02-08 19:57:43 +01:00
Sergio Costas
9bd6d94c6c Change to menu defaults if files not found on open
When opening an old devede project, if the background picture or
music files aren't there, an exception would happen. This can
happen even with the defaults, because in the last version, they
were migrated into a different folder.

Now, if the files aren't found, the new defaults will be used.
2025-02-08 19:57:43 +01:00
Rastersoft
4143d9dd49 Merge branch 'patch-1' into 'master'
Add developer tag to AppStream metadata

See merge request rastersoft/devedeng!89
2025-01-25 12:00:54 +00:00
AsciiWolf
0be36de127 Add developer tag to AppStream metadata
To make the metadata compatible with future AppStream standard version
2025-01-25 11:10:08 +00:00
Sergio Costas
6086e8e59e Version 4.20.0 2025-01-18 22:50:12 +01:00
Sergio Costas
13a38f5e76 Fixed translations 2025-01-18 21:35:43 +01:00
Sergio Costas
887e0b17c0 Trying to fix the translations 2025-01-18 21:04:40 +01:00
Sergio Costas
eebf4b5370 Use regexp to detect version number 2025-01-18 20:41:52 +01:00
Sergio Costas
f92e52a4af Ensure translations are included in .deb
Also fix debug and required programs dialogs, ensuring that all
the text is shown.
2025-01-05 15:09:53 +01:00
Sergio Costas
f42b11d7e3 Update HISTORY.md 2024-12-21 23:59:34 +01:00
Sergio Costas
31a6da7f01 Migrate to pyproject.toml 2024-12-21 23:20:22 +01:00
Rastersoft
20c4fdbeb8 Merge branch 'asciiwolf-master-patch-54193' into 'master'
Add empty OARS metadata and developer_name tag

See merge request rastersoft/devedeng!87
2024-11-28 23:13:16 +00:00
AsciiWolf
75203c9973 Add empty OARS metadata and developer_name tag
Some AppStream parsers require them nowadays

Also add a developer_name tag that is required too
2024-11-28 22:14:31 +01:00
Rastersoft
f14af13061 Merge branch 'fix-appdata-name' into 'master'
Fix AppStream metadata file name

See merge request rastersoft/devedeng!86
2024-11-28 20:10:44 +00:00
AsciiWolf
7194a3691f Fix AppStream metadata file name
It should have the same name as the rDNS app id
2024-11-28 20:30:24 +01:00
Sergio Costas
668be31105 Better check 2024-08-13 23:23:27 +02:00
Sergio Costas
a959d120cc Remove FIFO filter
It has been removed from ffmpeg
2024-08-13 22:17:52 +02:00
Rastersoft
bd0f802681 Merge branch 'yjwork-cn-master-patch-70850' into 'master'
Update po/zh_CN.po

See merge request rastersoft/devedeng!83
2024-08-13 19:16:50 +00:00
Rastersoft
8cd457b494 Merge branch 'fix-error-when-duration-is-NA' into 'master'
Fix error when duration is N/A

See merge request rastersoft/devedeng!85
2023-12-17 20:28:25 +00:00
Rastersoft
a84aea081b Fix error when duration is N/A 2023-12-17 20:28:25 +00:00
Sergio Costas
cf386691b0 Fixed non translated string 2022-11-17 14:11:09 +01:00
Rastersoft
61202653f6 Merge branch 'devede-3.17-nl' into 'master'
Update Dutch translation (nl).

See merge request rastersoft/devedeng!84
2022-11-17 13:09:27 +00:00