When set to true, this config option chooses copying over converting when the
source file is in a lossy format. At the moment, everything except ape, flac,
alac and wav is considered lossy.
There were a number of problems with the changes to the util melange:
- It used print rather than logging, and its string formatting was probably
not Unicode-ready.
- The shell-command-like print lines were not quite compatible, which makes
their general usefulness questionable.
- Used an unsafe/leaky global variable for mkdirall.
- Used deprecated sets.Set.
Seemed better just to add this to the plugin where we need it so it's easier
to see where this goes.
It also seems unnecessary to me to print `mkdir -p` commands. They just
clutter up the output for me when I really just want to see the transcoding
commands.
This option allows the user to specify the format on the command line
instead of editing the configuration.
The commit also includes some refactoring. In particular adding
arguments to functions to avoid dependence on global state.
Doc and Changelog in next commit
Partially resolves#877 showing:
- Directory creation
- Copies
- Deletes
- Moves
- Encodings
Information about tagging and plugins on _after_convert_ is not
currently shown. That requires changing the plugins to support the
pretend option, so a lot of work may be needed and it doesn't seem to be
helpful enough for me.
Video feeds may be found in flac files, and the current ffmpeg
conversion command does not ignore them, causing beets to fail
to convert the file.
Add `-vn` to the command line to fix the problem.
Fix issue #712.
Convert used to split the user command at whitespaces and pass it to `Popen`.
This approach is to naive, it also was not consistent with output from the
logs. Instead we pass the whole command to a subshell.
* `encode()` raises an error when the command returns with non-zero exit
status. We catch that in the higher-level conversion functions and skip to
the next item without writing tags.
* Simplified the handling of the `keep_new` flag.
Symmetrical to item.read(), this allows us to update the tags of files that are
not in the library. The motivation was this issue [1].
The commit also includes a nasty hack in the plugin code that prevents breaking
other plugins.
[1]: https://github.com/geigerzaehler/beets-check/issues/1
These config options make it easier to customize the command (no need to make
a single-element formats dict). And the opt config option provides backwards
compatibility with the previous style.
The format key is now the (lower-cased) format name string used by beets,
which means we can precisely detect which transcodes would be unnecessary. To
facilitate this, I added an ALIASES dict which allows more convenient names to
work for this (e.g., "wma" is easier to remember than "windows media").
This avoids naming conflicts in the source directory. In particular, when
encoding MP3 -> MP3, the previous scheme would overwrite the original file
(and hang ffmpeg waiting for input). This should also work in
situations where the source directory is read-only.
I introduced a regression a few commits ago when I started using
lib.destination with the basedir keyword argument as opposed to doing
os.path.join manually.
The major functional change here is how files move around when in keep_new
mode. Now, files are first moved to the destination directory and then
copied/transcoded back into the library.
This avoids problems where naming conflicts could occur when transcoding from
MP3 to MP3 (and thus not changing the filename).
Instead of flac and lame the convert plugin now uses ffmpeg. This adds
support for more input formats and simplifies the code. ffmpeg also uses
the lame encoder internally and has equivalents of all the -V<num>
presets which should be sufficient.
Paging @yagebu: I think the old version of the code would embed album art into
the wrong file. Please correct me (and accept my apologies) if I'm wrong
though.
A user reported a problem with one of the logging statements where .format()
tried to convert a Unicode string to bytes because the log message was '', not
u''. As a rule, we should ensure that all logging statements use Unicode
literals.
Eliminate the __subclasses__ trick for finding all plugins. Now we explicitly
look in each plugin module for a plugin class. This allows us to import plugin
modules with unintentionally loading them. This lets us reuse the image
embedding machinery without copypasta.