extractSearchTerms dropped a filename's {tmdb-…} ID whenever the movie was
already tagged (name+release-date+media-kind present), returning a bare title
and ignoring the embedded ID — so a search on a tagged or previously-searched
file came back as a fuzzy title list. That branch now also parses the filename,
so the direct ID lookup fires regardless of prior tagging.
Also rank movie title-search results so exact title matches sort to the top of
the fuzzy provider list, and recover the release year from the filename
(ParseFilename strips it from the title without reporting it) to pick the
default entry: exact+year, then exact, then year-only, then the provider's own
order (a stable sort, so relevance survives within each band). Applied in the
search sheet, the queue metadata action, and both AppleScript commands with
identical ranking so scripted indexes stay aligned; the sheet now highlights
the default pick. Bracketed years win over bare dot/space years so
resolutions like .1920.1080p don't win.
Bump the fork version to 1.9.5mkv2.
Co-Authored-By: Claude Code <noreply@anthropic.com>
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>
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>
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>