Commit graph

1327 commits

Author SHA1 Message Date
Adrian Sampson
02fd9bf809 convert: embed into destination file, not source file
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.
2012-10-24 15:17:00 -07:00
Adrian Sampson
dcb9ad7373 fix several non-unicode logging statements
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.
2012-10-24 15:14:33 -07:00
Adrian Sampson
3fbce8dfdd merge 2012-10-21 15:26:50 -07:00
Adrian Sampson
1a94d9e4b7 warnings about using syspath with some utils
Also pertaining to #58: for most utility functions, paths should *not* be
`syspath`-ified. (This only occurs right before a path is sent to the OS.) In
fact, as @Wessie discovered, using the result of `syspath` with `ancestry` leads
to incorrect behavior. I checked and this should not currently happen anywhere,
but these docstring changes make that requirement explicit.
2012-10-21 14:27:40 -07:00
Philippe Mongeau
78f2003eb0 simplify the random print code
We don't need the 'if opts.album' since we print with the same function and
argsuments.
2012-10-21 11:39:23 -04:00
Philippe Mongeau
e80dce6930 fuzzy: use the new print_obj function 2012-10-21 11:29:21 -04:00
Jakob Schnitzer
d6f20e91bd Speedup 'beet ls' if no format is specified 2012-10-21 13:54:24 +02:00
Jakob Schnitzer
54f29812cf convert: fix breakage due to recent API changes 2012-10-21 13:35:41 +02:00
Adrian Sampson
16f207e927 make syspath/bytestring_path roundtrip on Windows
This is an alternative to #58 that makes bytestring_path perform more like the
inverse of syspath on Windows. This way, we can convert to syspath, operate on
the path, and then bring back to internal representation without data loss. This
involves looking for the magic prefix on the Unicode string and removing it
before encoding to the internal (UTF-8) representation.
2012-10-20 23:49:43 -07:00
Adrian Sampson
1f8fff7445 fix tests for recent API changes in commands 2012-10-20 21:19:50 -07:00
Adrian Sampson
91ad913399 #62: simplify list (and random) code
With the new centralized print_obj function, we can greatly simplify the code
for the list command. This necessitated a couple of additional tweaks:

- For performance reasons, print_obj can now take a compiled template. (There's
  still an issue with using the default/configured template, but we can cross
  that bridge later).
- When listing albums, $path now expands to the album's item dir. So the format
  string '$path' now exactly corresponds to passing the -p switch.

As an added bonus, we can now also reduce copypasta in the random plugin (which
behaves almost exactly the same as list).
2012-10-20 21:10:39 -07:00
Adrian Sampson
2770b7d6fc #62: move format/print utilities to beets.ui
Now that these functions are generally useful, this is the right home for them.
Plugins should also use print_obj.
2012-10-20 20:55:14 -07:00
Adrian Sampson
93a7251b57 #62: use list_format_* in non-list commands
The list_format_album and list_format_item options now *actually* affect the
display in commands other than "beet list". This replaces the -f/--format flags
-- if any users want to control this on the command line, we can reconsider this
decision.

Note that this involved passing around a "config" object, which we previously
haven't done. This seems a little bit messy, but configuration is about to
change entirely to be more like this style -- so this isn't a huge liability.
2012-10-20 20:50:03 -07:00
Adrian Sampson
3952fbec62 docs & changelog for pervasive format config (#62)
This version of the (renamed) _print_obj function uses introspection to
determine whether we're printing an Album or an Item. It's like function
overloading for Python! 😁
2012-10-20 20:29:49 -07:00
Adrian Sampson
c0a04dc788 Merge pull request #62 from mk-fg/unified_presentation_format
Unified presentation format in ui commands
2012-10-20 20:07:15 -07:00
Adrian Sampson
00b23c39ef Merge pull request #61 from mk-fg/indentation_fix
Fix inconsistent three-space indentation
2012-10-20 17:08:35 -07:00
Adrian Sampson
b58e0ed7fc Merge pull request #60 from mk-fg/dont_update_mtime_for_different_path
library: don't set/update item mtime if read-path is passed to read()
2012-10-20 17:05:34 -07:00
Adrian Sampson
b9cc206093 changelog & cleanup for pull request #59 2012-10-20 16:57:56 -07:00
Adrian Sampson
d276a08205 Merge pull request #59 from mk-fg/log_read_failure_path
library: log path, reading of which has raised an exception
2012-10-20 16:53:17 -07:00
Adrian Sampson
9368075756 replaygain: reinstate albumgain config option 2012-10-20 16:49:52 -07:00
Adrian Sampson
848b56e54c replaygain: remove album noclip gain adjustment
as suggested by @kraYmer
2012-10-20 16:41:31 -07:00
Mike Kazantsev
037f290776 ui: add --format option to all commands that can use it 2012-10-20 23:06:58 +06:00
Mike Kazantsev
f8cf3817fc ui: use configured format when printing album/item from all commands 2012-10-20 22:58:05 +06:00
Mike Kazantsev
8b07ea157d Fix inconsistent three-space indentation 2012-10-20 21:45:14 +06:00
Mike Kazantsev
609e57f0a0 library: don't set/update item mtime if read-path is passed to read() 2012-10-20 20:10:29 +06:00
Mike Kazantsev
12cae9ee93 library: log path, reading of which has raised an exception 2012-10-20 20:07:27 +06:00
Jakob Schnitzer
492f168124 convert: Fix problem with "threads" config option 2012-10-20 13:25:25 +02:00
Adrian Sampson
4f164fb83e windows: use UTF-8 in displayable_path 2012-10-19 10:05:06 -07:00
Adrian Sampson
2c38c15fb8 replaygain: apply album gain in album mode 2012-10-18 11:33:13 -07:00
Adrian Sampson
da3eb7af58 Merge pull request #57 from mk-fg/fix_readme_links
readme: fix readthedocs.org links
2012-10-18 10:59:21 -07:00
Jakob Schnitzer
58ba4b3d75 convert: fix album art embedding 2012-10-18 18:35:25 +02:00
Mike Kazantsev
9d4d95fa27 readme: fix readthedocs.org links 2012-10-18 21:43:50 +06:00
Adrian Sampson
0ab3426bd9 replaygain: add command
You can now disable automatic analysis and instead use a command to manually
analyze albums or tracks.
2012-10-17 22:12:38 -07:00
Adrian Sampson
1a261db918 replaygain: style and light refactoring 2012-10-17 21:47:17 -07:00
Adrian Sampson
95910a366b replaygain: run in import stage
This is the "new way" to post-process files on import (superseding the imported
events).
2012-10-17 21:43:27 -07:00
Adrian Sampson
3a4e1ca4f7 replaygain: add fields to Item
This has been a long time coming, but we now finally keep track of ReplayGain
values in the database. This is an intermediate step toward a refactoring of the
RG plugin; at the moment, these values are not actually saved!
2012-10-17 20:28:24 -07:00
Adrian Sampson
83f3069d57 replaygain: remove albumgain setting
We now always calculate album gain when importing an album. This is "free" (no
performance cost) now and players are free to ignore the setting if they so
choose.
2012-10-17 20:11:20 -07:00
Adrian Sampson
3d68cf5deb replaygain: fix album nopeak adjustment
Removed the second tool invocation. We now adjust the album-level gain based on
track peaks in one fell swoop. Based on help from Fabrice via email.
2012-10-17 20:06:10 -07:00
Adrian Sampson
ce190fbe3b merge 2012-10-17 19:47:31 -07:00
Jakob Schnitzer
26dfe38bb0 convert: Write tags from library instead of copying them 2012-10-17 21:12:31 +02:00
Adrian Sampson
cc8ead7e34 convert: atomic mkdirall() call 2012-10-15 19:53:17 -07:00
Adrian Sampson
b81ac1d6e0 fix crash when stdin comes from pipe w/o encoding
This allows, for example, "yes | beet convert".
2012-10-15 14:58:59 -07:00
Adrian Sampson
6115fba765 replaygain: calculate when any file needs calculation
This ensures accurate album-level data. It also fixes a problem with the old way
of doing things where the MediaFiles and tool results would become misaligned if
a subset of the tracks needed recalculation.
2012-10-15 14:54:06 -07:00
Adrian Sampson
672ac78e76 replaygain: write album-level tags 2012-10-15 14:42:28 -07:00
Adrian Sampson
9afaed534c refactor output parsing code to use a dictionary 2012-10-15 14:31:31 -07:00
Adrian Sampson
8de8777b7e replaygain: use log messages instead of prints 2012-10-15 12:19:14 -07:00
Adrian Sampson
4adc896a86 replaygain: consolidate command invocation code
Invocations of the mp3gain/aacgain commands are now wrapped in a centralized
function that takes care of output capture and error handling. This avoids code
duplication for the various sites at which the tool needs to be invoked.

This change also avoids unintentionally modifying tags via the command-line
tool. The "-s s" option makes the tool *just* calculate RG values rather than
toying with tags at all.
2012-10-15 12:14:35 -07:00
Adrian Sampson
df6c244381 replaygain: fix some spacing and error messages 2012-10-15 09:57:44 -07:00
Jakob Schnitzer
4ebc5237d0 replaygain: Fix TypeError if command option is not set 2012-10-15 16:23:03 +02:00
Adrian Sampson
f2ab26d6a4 mbcollection: change chunk size to 200 releases 2012-10-14 20:35:03 -07:00