Commit Graph
1047 Commits
Author SHA1 Message Date
Scott GarrettandClaude Code 80ca3970ec Retag queued Matroska files in place instead of converting to MP4
The queue now mirrors the document window for .mkv/.mka/.mks sources.
The window's whole save branching (importer-order track snapshot, chapter
row snapshot, staleness guard, tag-writer-vs-remuxer choice) moved out of
Document into a shared MatroskaSaver used by both Document and QueueItem
so the two paths cannot drift. Queue items import tags-only, keep the
Matroska extension (in place, or stream-copy into a destination folder),
MP4-only actions no-op on them, and send-to-queue hands the item the
document's model plus its identity pairing baseline via attachMatroskaSaver.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-29 20:33:47 -05:00
Scott GarrettandClaude Code dd956fa783 Offer VobSub conversion for PGS subtitle tracks
The subtitle import sheet gains a VobSub action for PGS-format tracks
(default following the bitmap-subtitle conversion preference), which
muxes them as real subp tracks via the framework's new
MP42PgsToVobSubConverter instead of only offering OCR'd tx3g text.
Localized for all six shipping languages.

Also names any flagged subtitle track "SDH" (the recognized community
tokens now share one name) and documents the MKV conversion-path naming
and the PGS-to-VobSub machinery in CLAUDE.md.

Bumps the MP42Foundation submodule for the converter and the
filename/TrackName SDH recognizer.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-28 20:01:04 -05:00
Scott GarrettandClaude Code f20ad7ee45 Search metadata directly from IDs embedded in file names
ParseFilename's movie-IMDB pattern now recognizes parenthesized years and
brace-wrapped service IDs, so names like "Movie (2024) {tmdb-1015812}" no
longer truncate to "Movie (2024) {tmdb". The ID kind is captured (imdb,
tmdb, tvdb, tt; IDs widened to 7-9 digits for modern IMDb IDs) and
emitted as an "id:<kind>:<value>" line.

Parsed IDs ride along in MetadataSearchTerms.movie as a MetadataFileID.
TheMovieDB answers direct lookups (movie/{id} for TMDb IDs, find +
external_source=imdb_id for IMDb IDs) as a movieIDSearch; the search
sheet, the queue metadata action, and the AppleScript fetch-metadata
command try the direct lookup first and fall back to the title search
when the ID is unknown or the provider doesn't support it. Index-based
AppleScript result commands keep the name search by design.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-28 13:10:25 -05:00
Scott GarrettandClaude Code 06ecb0af5f Route AppleScript chapter imports and make File > Optimize work on MKV
importFilesDirectly mirrors the open panel's extension dispatch, so
AppleScript `import file` now sends .txt/.csv to addChapters/
updateChapters and everything else to FileImportController; the chapter
track created on an MKV doc gets the tags-only trackId/
updateChangeCount bookkeeping in didSelect(chapters:). searchChapters
moves to the always-valid validation group, though CLAUDE.md now
records that it is orphaned dead code with no UI entry point.

File > Optimize on a Matroska document forces writeMatroska's
structural branch: a full remuxer rebuild from the existing tracks,
the container-equivalent of atom-order optimize. Its validation uses
fileURL instead of hasFileRepresentation, which is always false for
tags-only models and kept the menu disabled forever.

Bump MP42Foundation for the tagsOnly importer fix that mirrors the
file's chapter atoms verbatim (offset first starts and tied zero
starts survive an edit); harness matrix PASS=324/0.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-26 19:14:59 -05:00
Scott GarrettandClaude Code f457b4e89c Make chapter tracks deletable, insertable, and language-editable
Delete: the phase-1 gate against deleting the chapter pseudo-track on
Matroska documents is obsolete now that chapter changes ride the
stream-copy remuxer — a removed pseudo-track simply makes the model
report "no chapters", which removes the Chapters element on save (the
same path emptying the Chapters tab already took). The toolbar Delete
button's validation is corrected too; it still rejected chapter-only
selections after deleteSelection was opened up.

Insert: the Actions toolbar gets a single "Insert a chapter" item, and
"Insert a chapter every" (previously MP4-only) is enabled on Matroska.
Both create the chapter track when the document has none, doing the
tags-only bookkeeping the model needs (dense display trackId,
updateChangeCount). A single insert lands 1s after the latest start,
clamped to the track duration, so it can never tie with a stored
chapter — ties get clamped +1ms on write and would silently shift the
user's own chapter times.

Language: the chapter row's language popup stays editable on MKV
documents (the value rides the remuxer's chapter rebuild, not the tag
writer, since the pseudo-track has no TrackEntry), and the Matroska
chapters snapshot carries it so a language-only edit triggers the
remux. Pairs with the submodule's ChapterLanguage round trip.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-26 18:17:37 -05:00
Scott GarrettandClaude Code 8520d729c6 Edit and add chapters in Matroska documents
The chapters tab leaves read-only jail on MKV docs: didSelect exempts
ChapterViewController from the tags-only blanket, and chapter-less docs
can gain chapters through the same txt/csv dispatch MP4 documents use
(selectFile's MKV branch and drag-drop now allow .txt/.csv alongside
the subtitle extensions; addChapters/updateChapters assign the display
trackId and flag the document dirty on MKV).

Chapter edits ride the remuxer, never the tag writer: Chapters sits
before the Clusters, so any size change shifts every following byte.
Document.mkvChaptersSnapshot holds the baseline rows and drives a
chaptersChanged check against the model (model-vs-model, because the
reader itself drops duplicate zero-timestamp atoms and those must not
look like user edits); when changed, remuxMatroska passes mp4.chapters
(or an empty track to delete every chapter) as the remuxer's
replacementChapters, then refreshes the snapshot so an untouched save
goes back to the byte-stable tag-writer path.

Verified live: add a chapter row in the UI, File>Save — the file gains
the atom (ties clamped to 1ms), mkvmerge/ffmpeg both read it, a
forced no-op re-save is byte-identical, and reopening shows all rows.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-26 12:54:58 -05:00
Scott GarrettandClaude Code 330236735d Add subtitle tracks to open Matroska documents
MKV docs can now import .srt/.ssa/.ass subtitle files, written as
S_TEXT/UTF8 by MP42MkvRemuxer (submodule bump). Video/audio adds and
other subtitle formats stay refused by both sides.

- DocumentWindowController: split selectFile: validation so MKV docs
  get an Import panel restricted to matroskaSubtitleExtensions (kept
  in sync with the remuxer's gate); showImportSheet routes MKV docs
  to importSubtitleTracksForMatroska, which imports each file with a
  plain MP42FileImporter (no track-selection sheet), attaches the
  conversion-settings defaults addTrack: asserts on, and assigns the
  next display trackId. Drag-drop already funnels through
  showImportSheet. didSelect skips
  organizeAlternateGroups/inferMediaCharacteristics on MKV docs —
  same TrackEntry-pairing protection as delete.
- Document: the tagsChanged check already caught additions; the
  post-remux snapshot now appends the added tracks behind the kept
  ones, matching the TrackEntry order in the written file, so a
  later tags-only save pairs correctly instead of double-appending.
- ScriptCommand: the AppleScript "save as" command called
  mp4.write(to:) directly, which muxed a QuickTime MP4 over a
  Matroska document. Route isMatroska documents through
  Document.save(saveAsOperation) so writeMatroska picks the
  tag-writer/remux path and enforces the mkv destination.

Verified with the /tmp/subler-mkv-test harness (matrix PASS=276: add
srt/ass, add+drop mix, no-cues source, bad-file and drop-all
refusals, idempotent re-save, post-add tag edit) and against the
live app (scripted import + save on a fixture copy; output checked
with mkvmerge/mkvextract/ffmpeg and reopened cleanly).

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-26 11:53:50 -05:00
Scott GarrettandClaude Code eb386a52c3 Open and edit Matroska files in place, including track removal
.mkv/.mka/.mks now open directly into a tags-only document instead of
forcing the convert-import sheet:

- Metadata, cover art, and the four per-track fields Matroska stores
  (name, language, enabled, subtitle forced) save back into the same
  file via MP42MkvTagWriter; MP4-only properties stay read-only.
- Real tracks can be deleted and Save-As is enabled; both go through
  MP42MkvRemuxer's stream-copy rebuild (Document keeps an importer-order
  track snapshot and pairs TrackEntry elements by object identity).
  Destinations must stay .mkv/.mka/.mks.
- Info.plist: the Matroska document type becomes Editor so NSDocument
  offers .mkv Save-As instead of defaulting to the MP4 type.
- Delete on MKV docs skips organizeAlternateGroups/
  inferMediaCharacteristics because they reorder the model, which the
  TrackEntry pairing depends on; chapter rows stay undeletable.

Bumps MP42Foundation for the Matroska tagging/remux support.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-25 19:48:34 -05:00
Damiano Galassi 0c3d7de364 Fix wobbling preference panels switch animation caused by macOS 27.2 2026-10-20 15:06:01 +02:00
Damiano Galassi a3e15e725a Update Italian localization 2026-10-05 08:16:39 +02:00
Damiano Galassi b58346eda7 Improve selection restoration 2026-10-05 08:07:52 +02:00
Damiano Galassi 4c7a26a175 Move the 4k checkbox to the metadata preferences panel 2026-10-05 08:07:14 +02:00
Brett Pynn 85854a2f06 Add preference to allow 4k hd video metadata auto detection (#164) 2026-10-05 07:57:25 +02:00
Damiano Galassi a3f73cf1f8 Add missing classes to actions decoder
Fix #163.
2026-10-03 20:23:18 +02:00
Damiano Galassi a7739840ee Improve TVDB tv series name match 2026-10-03 20:17:52 +02:00
Damiano Galassi d0cd519460 Improve track view selection after an import 2026-10-03 17:59:29 +02:00
Damiano Galassi 1040f0dab6 Switch to the appropriate view after an action 2026-10-03 17:52:22 +02:00
Damiano Galassi dfdffb9332 Better preserve the UI state after an undo 2026-10-03 17:20:42 +02:00
Damiano Galassi 530ea2ed20 Use the newer actions icon on macOS 26 and later 2026-10-03 14:06:24 +02:00
Damiano Galassi 23f683626d Improve tracks and chapters undo 2026-10-03 14:06:06 +02:00
Damiano Galassi 934ae63b95 Expand undo/redo to all the document UI 2026-10-03 11:49:04 +02:00
Damiano Galassi 81d5f8902c Add artworks in a deterministic order 2026-10-01 10:54:42 +02:00
Damiano Galassi d930bdb0a6 Do not retrieve the iTunes Store artworks when using a different provider
The iTunes Store API seems quite broken lately, and it doesn't add anything of value
2026-09-30 18:01:34 +02:00
Damiano Galassi 8c0d366764 Increase the default metadata search sheet width 2026-09-30 17:22:04 +02:00
Damiano Galassi 33a7665c5a Order the top artworks to make to make the various size options easier to pick 2026-09-30 17:21:35 +02:00
Damiano Galassi b250450966 Use the localized folder names 2026-09-30 11:55:48 +02:00
Damiano Galassi 0305d5371c Clean up project folder 2026-09-29 12:14:37 +02:00
Damiano Galassi 73e27ef56c Disable drag & drop for muxed tracks 2026-09-29 10:41:57 +02:00
Damiano Galassi 59f085a7e4 Rename the 'Last used' save position to 'Automatic'
It's not always the last used position
2026-09-25 07:50:06 +02:00
Damiano Galassi 40107a9db1 Fix the jpeg check on macOS 11 and later
Fix #151.
2026-09-25 07:48:42 +02:00
Damiano Galassi ce011a4d37 Cleanup the Save As destination feature a bit 2026-09-23 21:29:18 +02:00
mindprint c8fb950854 Add a Save As location preference (#145)
Add a General preferences option controlling where the Save As panel
opens: the last used folder (default), the same folder as the
imported file, or a custom folder chosen by the user.
2026-09-23 21:15:08 +02:00
Damiano Galassi 94255d6e17 Add an additional space in the default toolbar set 2026-09-23 15:55:17 +02:00
Damiano Galassi a65fcf9bf2 Set the document window to use fullSizeContentView to avoid AppKit bugs 2026-09-23 15:54:48 +02:00
Damiano Galassi e12618bda4 Initial work to replace a deprecated API 2026-09-23 11:12:37 +02:00
Damiano Galassi e3f67451b0 Restore some code that might be useful in the future 2026-09-23 10:47:56 +02:00
Damiano Galassi fbdbb2006b Remove an unused var 2026-09-23 09:54:16 +02:00
Damiano Galassi 9ac32753d4 Fix the macOS version in an available check 2026-09-23 09:54:01 +02:00
Damiano Galassi d399af54b2 Increase the default document window size to workaround tableview wonky initial coloums size 2026-09-23 09:27:41 +02:00
Damiano Galassi 7990e816b2 Fix build on macOS 26 SDK 2026-09-22 20:34:17 +02:00
Damiano Galassi 9896d96e87 Fix the first launch toolbar styles 2026-09-22 20:03:06 +02:00
Damiano Galassi 334bc51906 Update localizations 2026-09-22 20:02:45 +02:00
Damiano Galassi 192de27e8d Fix even more deprecation warnings 2026-09-22 18:51:35 +02:00
Damiano Galassi abdfa38d2d Use UserNotifications on macOS 11 and later 2026-09-22 17:19:08 +02:00
Damiano Galassi f8667656ef Use the ellipsis icon on macOS 26 and later 2026-09-22 17:18:32 +02:00
Damiano Galassi 22c449f798 Use a gesture recognizer to handle the double click 2026-09-22 16:29:42 +02:00
Damiano Galassi 17c7d67b96 Use some modern APIs and fix warnings on the latest macOS SDK 2026-09-22 16:10:37 +02:00
Damiano Galassi beb7774761 Add a preference to overwrite or not existing metadata 2026-09-11 09:52:03 +02:00
Damiano Galassi 6c124ca5d0 Disable the track import checkbox if the track can't be imported 2026-09-11 09:34:26 +02:00
Konstantin Klitenik ed69edf45f Use .standard for portrait images in TheTVDB (#144) 2026-08-27 16:50:37 +02:00