Add folder transcoding#5799
Open
spaceXrace wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds directory input support to the omarchy-transcode script (transcoding all matching direct children with a single format/resolution prompt) and reworks the Nautilus context-menu integration so multi-file selections prompt only once per media type. A migration is added to refresh the Nautilus extension on update.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
bin/omarchy-transcode: factor outtranscode_file/transcode_directory, addmedia_type_for_format, accept directory input and skip files whose media type doesn't match the chosen output format.default/nautilus-python/extensions/transcode.py: track(media_type, path)per selected file, add_batch_commandthat prompts once per media type and runs the chosen format/resolution against all matching paths.migrations/1778424449.sh: re-runinstall/config/nautilus-python.shso existing installs pick up the updated extension.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| bin/omarchy-transcode | Adds directory mode, helper functions, format/resolution prompts for directories |
| default/nautilus-python/extensions/transcode.py | Switches selection model to per-media-type batches with single format/resolution prompt |
| migrations/1778424449.sh | Migration that re-sources the Nautilus python install script |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+67
to
+69
| commands.append(self._batch_command(binary, "picture", picture_paths)) | ||
| if video_paths: | ||
| commands.append(self._batch_command(binary, "video", video_paths)) |
Comment on lines
+33
to
+52
| def _batch_command(self, binary, media_type, paths): | ||
| if media_type == "picture": | ||
| format_options = "jpg png" | ||
| resolution_options = "high medium low" | ||
| else: | ||
| format_options = "mp4 gif" | ||
| resolution_options = "4k 1080p 720p" | ||
|
|
||
| commands = [ | ||
| f"format=$(omarchy-menu-select 'Select {media_type} format' {format_options}) || exit 1", | ||
| f"resolution=$(omarchy-menu-select 'Select {media_type} resolution' {resolution_options}) || exit 1", | ||
| ] | ||
|
|
||
| for path in paths: | ||
| commands.append( | ||
| f"echo {shlex.quote(f'Transcoding {path}')} && " | ||
| f"{shlex.join([binary, path])} \"$format\" \"$resolution\" || true" | ||
| ) | ||
|
|
||
| return "; ".join(commands) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This pull request aims to make transcoding multiple files faster and more convenient:
Adding directory support to the transcode functions like img2jpg. For example,
img2jpg folder/transcodes all images in folder/.Changing the Nautilus integration to only ask about the output format once when multiple files are selected.
Changes
bin/omarchy-transcodedefault/nautilus-python/extensions/transcode.pymigrations/1778424449.shinstall/config/nautilus-python.sh.Testing
I tested the following scenarios:
🤖 Generated with GPT-5.5 low