Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows DV7toDV8.sh script to work on non-Mac hardware #14

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ajyey
Copy link

@ajyey ajyey commented Mar 27, 2024

This MR allows the script to run on non-mac hardware.

My home media server runs on Linux and I do most of my work there, so being able to run this on Linux seemed like it would also be helpful for other users.

This MR:

  • Adds support for additional command line arguments
  • Updates the README to reflect those arguments
  • Slightly rewords some things in the README
  • Only prompts the user for language codes via applescript if the user is running on a Mac and they have not passed in the language codes via command line argument

@ajyey
Copy link
Author

ajyey commented Apr 4, 2024

@nekno thoughts?

Copy link
Owner

@nekno nekno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ajyey! Thanks for your patience (while I've been traveling) and these contributions!

I've requested some changes for you to approve/make while I test out these changes on macOS.


## Options

### -k or --keep-files
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### -k or --keep-files
### `-k` or `--keep-files`


Keeps intermediate files generated during the conversion process.

### -t or --target
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### -t or --target
### `-t` or `--target`


Specifies the target directory where .mkv files are located. Defaults to the current directory if not specified.

### -l
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### -l
### `-l` or `--languages`


Specifies comma-separated language codes for audio and subtitle tracks to include in the final .mkv file. If not specified, all tracks are included.

### -u or --use-local
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### -u or --use-local
### `-u` or `--use-local`


Uses local system binaries of `mkvtoolnix` and `dovi_tool` if available, instead of the versions bundled with the script.

### -h or --help
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### -h or --help
### `-h` or `--help`


languageCodes=$(osascript "$languageCodesPath")

# If we're running on a mac and the language code(s) are not provided, get them from the user
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# If we're running on a mac and the language code(s) are not provided, get them from the user
# If we're running on a Mac and the language code(s) are not provided, get them from the user

echo "Options:"
echo "-k|--keep-files Keep working files"
echo "-t|--target PATH Specify the target directory (default: current directory)"
echo "-l|languages LANG Specify the language codes (comma-separated) for audio and subtitle tracks. If not specified, default to all tracks."
Copy link
Owner

@nekno nekno Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "-l|languages LANG Specify the language codes (comma-separated) for audio and subtitle tracks. If not specified, default to all tracks."
echo "-l|--languages LANGS Specify comma-separated ISO 639-1 (en,es,de) or ISO 639-2 language codes (eng,spa,ger) for audio and subtitle tracks to keep (default: keep all tracks)"

@@ -98,7 +146,7 @@ do

if [[ $? != 0 ]] || [[ ! -f "$DV8_BL_RPU_HEVC" ]]
then
echo "File to convert BL+RPU. Quitting."
echo "Failed to convert BL+RPU. Quitting."
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch 😨


### -l

Specifies comma-separated language codes for audio and subtitle tracks to include in the final .mkv file. If not specified, all tracks are included.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Specifies comma-separated language codes for audio and subtitle tracks to include in the final .mkv file. If not specified, all tracks are included.
Specifies comma-separated language codes for audio and subtitle tracks to include in the final `.mkv` file. You can provide [ISO 639-1 codes (`en,es,de`) or ISO 639-2 codes (`eng,spa,ger`)](https://www.loc.gov/standards/iso639-2/php/English_list.php). If not specified, all tracks are included.

Comment on lines +66 to +67
*) # preserve positional arguments
PARAMS="$PARAMS $1"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless you're moving the script or the mkv files into the same folder each time, the one required param for the script has been the target directory.

It's perfectly fine to support that use case, but what do you think about defaulting to the present working directory (as you've done) but then setting targetDir here, as the one unlabeled argument, rather than using the -t/--target label?

I think it's more common that you wouldn't be moving the files around, the script will have a home and your working files will be in different folders each time, so I think using an unlabeled arg for the target directory makes the most sense.

If -t/--target were to be required, then we'd need to update the Platypus app config file to reflect this change in the script as part of this PR.

@THX723 THX723 mentioned this pull request Jun 8, 2024
@nekno nekno assigned nekno and ajyey and unassigned nekno Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants