Commit graph

78 commits

Author SHA1 Message Date
Adrian Sampson
e5a9db1cac fix up some indentation warnings in plugins 2014-04-13 17:55:49 -07:00
Thomas Scholtes
b7a26811ef Add "shell" keyword for commands and use it in convert
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.
2014-04-09 20:41:30 +02:00
Thomas Scholtes
6402b664c6 More refactoring for convert 2014-04-07 20:17:55 +02:00
Thomas Scholtes
651bdf0acc Refactor convert plugin
* `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.
2014-04-07 18:24:59 +02:00
Thomas Scholtes
9d87a7fc02 Make convert --keep-new work again
Iincludes some more tests for the convert plugin. The test use the extended
TestHelper class and the new pathlib (see #621).
2014-04-07 18:07:43 +02:00
Thomas Scholtes
1b434a7dae Import original file when conversion fails.
Fixes previous test
2014-04-05 21:09:12 +02:00
Thomas Scholtes
766c8b190b Add path argument to item.write()
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
2014-04-04 14:56:10 +02:00
Adrian Sampson
d407db725f convert: catch OSErrors and display error message
This also adds close_fds (only available on Unixes) to the common subprocess
invocation utility.
2014-04-03 19:47:21 -07:00
Adrian Sampson
318649c16c convert: fix transcode on windows (#519) 2014-02-02 09:54:33 -08:00
Jakob Schnitzer
887e02c2ae convert: fix decision on which items to transcode 2013-10-27 17:10:55 +00:00
Adrian Sampson
2481dc244b convert: iterate over the right items (fix #439) 2013-10-26 11:08:52 -07:00
Adrian Sampson
54af040bc4 convert: extension is a bytestring (fix #390) 2013-10-06 12:13:14 -07:00
Adrian Sampson
a6798f9ba3 #380: Template.safe_substitute
This way, you almost never need to use the $$ escape sequence.
2013-10-06 12:01:42 -07:00
Adrian Sampson
dfea8ea05e convert: fix outdated reference, col wrap 2013-10-06 11:59:03 -07:00
Adrian Sampson
5e82b670f9 #380: shortcut/compatibility options
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.
2013-10-06 11:57:32 -07:00
Adrian Sampson
b7e2ba7795 convert: log transcoding command 2013-10-06 11:28:29 -07:00
Adrian Sampson
d828d7aae4 #380: correctly skip no-op transcodes
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").
2013-10-06 11:21:56 -07:00
Adrian Sampson
0d303ffde7 multi-format convert (#362): simpler validation
This removes the explicit config validation check and collapses it into the
config read step (which is the intended convenience of Confit's API).
2013-10-06 10:56:42 -07:00
Adrian Sampson
c5032f925e move Destination method to Item class 2013-09-17 09:09:10 -07:00
Rowan Lewis
80d060db07 Added 'quiet' operation mode, prevents start/finish announcements for each file. 2013-09-14 10:18:36 +10:00
Rowan Lewis
52d86f0e6a Added more format presets, updated documentation. 2013-09-14 09:35:25 +10:00
Rowan Lewis
d2327d2dcf Fixed validation, basically replace unfriendly errors with friendly errors. 2013-09-14 07:27:15 +10:00
Rowan Lewis
d3dae9f089 Reject lossy formats under a set bitrate. 2013-09-13 08:13:30 +10:00
Rowan Lewis
53aba3ce3f It's called Vorbis, not OGG. 2013-09-13 07:57:04 +10:00
Rowan Lewis
bfbf5a9215 Changed the configuration to allow for easier format selection. 2013-09-13 07:54:36 +10:00
Rowan Lewis
697e70f14b Problem with unicode filenames sorted. 2013-09-12 22:21:50 +10:00
Rowan Lewis
697cf3fd65 Removed reference to my testing plugin, oops. 2013-09-12 20:22:18 +10:00
Rowan Lewis
21c9855c4f Allow the convert plugin to convert to any format, not just mp3. 2013-09-12 20:09:53 +10:00
Adrian Sampson
5e09c5e473 convert: fix iteration over results 2013-08-22 17:33:56 -07:00
Adrian Sampson
c7fe017752 remove Library.{move,store} methods
These methods are now provided by LibModel, which makes dealing with items and
albums symmetric.
2013-08-21 15:34:45 -07:00
Adrian Sampson
26682f9168 docs/changelog for convert paths config (#285) 2013-05-22 15:00:53 -07:00
Lucas Duailibe
1e0290354c fix some debug code 2013-05-22 14:11:55 -03:00
Lucas Duailibe
76e310d811 different paths for convert
the paths configuration for converted files can be different from the importer
closes #232
2013-05-22 11:03:00 -03:00
Adrian Sampson
dd8d4c16cc spell check 2013-04-29 10:23:21 -07:00
Adrian Sampson
01a449ffa6 convert: auto (#212) now transcodes to /tmp
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.
2013-03-10 13:22:05 -07:00
Adrian Sampson
8736a0bb4c convert auto: changelog and de-cloning (#212) 2013-03-10 13:12:56 -07:00
Adrian Sampson
47a549a31c Merge pull request #212 from duailibe/auto_convert
Transcode files during import
2013-03-10 12:57:36 -07:00
Lucas Duailibe
c2c96d522f config name and docs update 2013-03-09 23:33:45 -03:00
Lucas Duailibe
a3d8105a5a small fix 2013-03-09 20:04:26 -03:00
Lucas Duailibe
27b1d6d7cc clean up old files and remove pdb 2013-03-09 19:36:34 -03:00
Lucas Duailibe
e49ca34f3c partial commit 2013-03-09 19:09:43 -03:00
Adrian Sampson
7d9fd0a2cf convert: fix unicode error in path construction
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.
2013-03-09 11:37:10 -08:00
Adrian Sampson
69f2659410 convert: read new audio metadata (#208) 2013-03-06 23:11:08 -08:00
Adrian Sampson
87d71abc28 changelog/cleanup/fixes for #209
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).
2013-03-06 18:21:42 -08:00
Lucas Duailibe
a338b95bb7 Changing behavior in "keep new files" 2013-03-06 22:04:05 -03:00
Lucas Duailibe
28522376be Adding "keep new files" option to convert plugin 2013-03-06 21:41:40 -03:00
Jakob Schnitzer
ef22ea5183 convert: add missing util.displayable_path 2013-03-01 16:16:28 +01:00
Adrian Sampson
c31eabe95c convert: add missing syspath call (closes #106) 2013-02-27 10:30:24 -08:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
6d68a4855e per-plugin configuration defaults in __init__()
This uses the new BeetsPlugin.config convenience view heavily. Things are
slowly getting less verbose.
2012-12-18 22:35:44 -08:00