option to specify destination root
Bug #525318 reported by
intuited
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dir2ogg |
Triaged
|
Undecided
|
Unassigned |
Bug Description
It would be nice to be able to specify a destination root, and have dir2ogg create the converted files there. I often want to convert files on-the-fly when copying them over from another drive or another server, and there's no convenient way to do that: currently it's necessary to copy them, then convert, which is like, totally inefficient.
Thanks for creating this useful tool! I would love to see it be generalized to be able to convert to other formats — the absence of a standard tool for audio conversion almost makes me want to use one of those "gooey" applications for this stuff.
To post a comment you must log in.
Hi,
While looking around for some CLI app that would convert my whole music folder with different aduio file types, I stumbled on dir2ogg and was thrilled to see that it did exactly what I wanted, except for the fact that I couldn't specify a destination directory.
So, since it was coded in python (w00t !) and the script wasn't too complicated I modified it a bit and added 2 new options : --output-dir and --strip-path. You can go get my version of the script at http:// github. com/gregory- sanderson/ dir2ogg.
--output-dir does what you would expect, it moves all converted files into the specified directory. It even keeps copies the directory structure if you convert recursively. But, a slight problem that I discovered after testing a bit is that if you put a path like '~/music', python's os.path.normpath will transform it to '/home/user/music'. So, if ever you do something like dir2ogg --output-dir /path/to/ media-player ~/music you'll end up with your converted files in /path/to/ media-player/ home/user/ music. That's why, as a temporary measure, i also added --strip-path
--strip-path will remove all leading directories in the file path when placing converted files. Let's say for example that you have this directory structure :
music/file.mp3 file1.mp3 folder2/ file2.mp3
music/folder1/
music/folder1/
and that you want to place converted files in the directory 'converted'. with --strip-path you'll get this:
converted/file.mp3
converted/file1.mp3
converted/file2.mp3
That's pretty much it ! Let me know what you think ;) I'm planning on expanding the functionality of --strip-path so that you can configure up to where you want to strip.