Skip to content

Instantly share code, notes, and snippets.

@pajp pajp/README
Created Nov 20, 2011

Embed
What would you like to do?
Encode mkv files to Apple TV format and add them to iTunes
# Moved here: https://github.com/pajp/add-to-itunes
@stisti

This comment has been minimized.

Copy link

stisti commented Nov 20, 2011

Why the timeout on line 25? Otherwise it looks great. Code review passed :)

@stisti

This comment has been minimized.

Copy link

stisti commented Nov 20, 2011

Hmm... If you added the timeout because osascript complains if iTunes takes too long to answer, consider using "ignoring application responses" block around the tell.

@stisti

This comment has been minimized.

Copy link

stisti commented Nov 20, 2011

And one more thing: when processing command line arguments with a for loop, just "for f; do" is enough.

@pajp

This comment has been minimized.

Copy link
Owner Author

pajp commented Nov 21, 2011

Thanks for the comments!

Yes, the timeout is there because the default timeout of 2 seconds (or so) is not enough since my iTunes is configured to copy the added file to the iTunes media library (1080p content often weighs in on a gigabyte or two). And if I googled properly "ignoring application responses" would make the add return immediately. However, I actually want it to block until the media has been added so that I can safely rm it afterwards. But please do correct me if I'm wrong. :-)

@stisti

This comment has been minimized.

Copy link

stisti commented Nov 21, 2011

No, you're right. I don't know of a good way around that. Probably best the way you did it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.