Skip to content

Commit

Permalink
Add 'tmpdir' option to convert plugin
Browse files Browse the repository at this point in the history
Closes #1382

Add tmpdir setting

document tmpdir setting
  • Loading branch information
astralarya committed Mar 27, 2015
1 parent 86559bc commit ddca1b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion beetsplug/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def __init__(self):
},
u'max_bitrate': 500,
u'auto': False,
u'tmpdir': None,
u'quiet': False,
u'embed': True,
u'paths': {},
Expand Down Expand Up @@ -388,7 +389,8 @@ def convert_on_import(self, lib, item):
fmt = self.config['format'].get(unicode).lower()
if should_transcode(item, fmt):
command, ext = get_format()
fd, dest = tempfile.mkstemp('.' + ext)
tmpdir = self.config['tmpdir'].get()
fd, dest = tempfile.mkstemp('.' + ext, dir=tmpdir)
os.close(fd)
_temp_files.append(dest) # Delete the transcode later.
try:
Expand Down
2 changes: 2 additions & 0 deletions docs/plugins/convert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ file. The available options are:
default configuration) non-MP3 files over the maximum bitrate before adding
them to your library.
Default: ``no``.
- **tmpdir**: The directory where temporary files will be stored during import.
Default: none (system default),
- **copy_album_art**: Copy album art when copying or transcoding albums matched
using the ``-a`` option. Default: ``no``.
- **dest**: The directory where the files will be converted (or copied) to.
Expand Down

0 comments on commit ddca1b2

Please sign in to comment.