Commit graph

694 commits

Author SHA1 Message Date
Dang Mai
f91362a069 Cosmetic refactors based on feedback 2016-10-21 16:56:03 -04:00
Dang Mai
406f3ce843 Add tests and make sure they pass 2016-10-20 21:07:12 -04:00
Dang Mai
f17601e4cd Fix update test failures 2016-10-20 20:25:38 -04:00
Dang Mai
acd2b0ef77 First attempt for selective field updates 2016-10-20 00:04:07 -04:00
Johnny Robeson
7a2bdf502f s/utf8/utf-8/ in all encoding/decoding contexts
This matches up with the python documentation.
2016-09-06 23:10:24 -04:00
Adrian Sampson
e1d598aced Less verbose metavariable in --search-id help 2016-08-16 20:48:46 -04:00
Johnny Robeson
fcbfce3984 replace deprecated log.warn() with log.warning() 2016-08-09 00:33:38 -04:00
Johnny Robeson
15a8409535 add python version to beet --version 2016-07-31 02:48:07 -04:00
Adrian Sampson
386f582364 Invent a new utility to deal with native strings 2016-06-29 22:25:03 -07:00
Johnny Robeson
a2a4926598 replace .decode('utf-8') with as_string() from #2094
They are strings in py3, so they need to stay that way
2016-06-29 23:42:14 -04:00
Adrian Sampson
d5205915cc Avoid dangerous string conversions (#2094)
This rolls back the places in #2094 where `six.text_type(s)` was used where
`s` might be a bytestring. We almost never want that conversion, because it
uses the default encoding (almost always ASCII). The need for it indicates a
problem somewhere else, where bytes were produced when we were expecting
unicode strings.
2016-06-29 10:30:26 -07:00
Johnny Robeson
6b3cc6ff37 adapt print_() callers to send unicode strings 2016-06-29 03:17:02 -04:00
Adrian Sampson
10a47e98d0 Merge branch 'master' of github.com:beetbox/beets 2016-06-28 20:41:14 -07:00
Adrian Sampson
f46bfdf219 Fix index display with per_disc_numbering
If `medium_index` is missing, as it is from the Beatport source, the display
would show "None" instead of the global index (a fallback). This is half of
the problem in #2085.
2016-06-28 20:34:04 -07:00
Johnny Robeson
5d4e3396d2 wrap a path in displayable_path in commands 2016-06-28 23:28:58 -04:00
Johnny Robeson
edb1cbc5fc replace iter{items|values} with six.iter{items|values} 2016-06-24 05:53:55 -04:00
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Johnny Robeson
4b2c4ced6c wrap extra_ops.keys() in a list in ui/commands 2016-06-14 01:55:47 -04:00
Jack Wilsdon
34b3cf36b7 Add --force option to beet remove 2016-06-08 19:22:24 +01:00
Adrian Sampson
1dc61491c6 Remove a bogus bash-completion path (#2038) 2016-06-08 09:36:00 -07:00
Adrian Sampson
77b0c17448 Merge pull request #2038 from bismark/patch-1
Support Homebrew's bash-completion2
2016-06-08 09:35:07 -07:00
Johnny Robeson
f7f249f6c6 wrap map() in a list() where necessary for py3
It's slightly more inefficient during the py3 transition, but
I still think it's worth minimizing the diff for.
2016-06-06 17:10:21 -04:00
Ryan Johnson
2fed1cf3f2 formatting 2016-06-06 17:11:09 +01:00
Ryan Johnson
cf397277d2 Support Homebrew's bash-completion2 2016-06-06 12:23:42 +01:00
Johnny Robeson
cd1f79340f remove explicit b' from sql query dict key names 2016-05-30 18:50:11 -04:00
Markus Unterwaditzer
f2f18d9d56 Fix variable names 2016-05-28 00:26:58 +02:00
Markus Unterwaditzer
1ae6ce04dd Run python-modernize across the codebase 2016-05-27 23:13:01 +02:00
Adrian Sampson
eac7d64545 Merge branch 'master' into no_unicode_literals 2016-02-28 15:21:43 -08:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Adrian Sampson
59e54d1792 Fix #1891: Missing syspath in beet stats -e 2016-02-22 00:02:58 -08:00
Peter Kessen
2048a4fbcb Removed unicode_literals from ui 2016-02-19 23:28:22 +01:00
Adrian Sampson
2aeed21f80 A little more documentation massaging for #1843
To make the docstirng fit in with the standard style.
2016-02-07 14:50:38 -08:00
Adrian Sampson
abc2ff066b Refine naming and docs for #1843
Most urgently, this function doesn't just work on *items*; it works on
arbitrary objects (and, in particular, albums).
2016-02-07 14:48:45 -08:00
Adrian Sampson
6e3d72afa6 Merge pull request #1846 from diego-plan9/interactiveedit
edit: allow interactive editing during the importer
2016-02-07 14:34:54 -08:00
Peter Kessen
19f2cea5bf Merge branch 'selective_modify2'
Conflicts:
	docs/changelog.rst

closes #1843
2016-02-04 17:57:35 +01:00
Peter Kessen
8412bd0f23 renamed print_modify_item to print_and_modify 2016-01-30 09:45:50 +01:00
Diego Moreda
b472e1e450 Merge branch 'master' of github.com:sampsyo/beets into interactiveedit 2016-01-29 20:20:56 +01:00
Peter Kessen
34e455b2ea changed docstring for print_modify_item 2016-01-29 16:21:39 +01:00
Adrian Sampson
7b88dc5760 Couple printer function with fields_func (#1818)
This isn't really a generic utility, since it is hard-coded to print the "key"
field of the result. So let's pair it with the place it's used.
2016-01-28 13:50:10 -08:00
Adrian Sampson
5ff14742b8 Simpler row lookup (#1818) 2016-01-28 13:48:20 -08:00
Adrian Sampson
6707eda4e4 Merge pull request #1818 from GuilhermeHideki/fields-print-flexattr
beet fields: Print flexible attributes
2016-01-28 13:46:40 -08:00
Peter Kessen
fafc73077d fixed broken tests 2016-01-28 22:26:55 +01:00
Peter Kessen
4863a945a2 introduced -t option for move command 2016-01-28 22:22:21 +01:00
Peter Kessen
2937607d52 Removed duplicate (Y/n) Question from output 2016-01-28 22:09:56 +01:00
Peter Kessen
c28eaee7d0 implemented interactive selection in modify 2016-01-28 21:50:37 +01:00
Peter Kessen
6b39751337 introduced print_modify_item as seperate function
preparation to implement interactive selection in modify command
2016-01-28 21:49:33 +01:00
Guilherme Danno
ff01015b61 Fields: Print flexible attributes 2016-01-28 17:30:36 -02:00
Diego Moreda
b7a2a42d9c Fix docs on plugin prompt choices conflict solving
* Fix docstring and `plugins.rst` regarding how the PromptChoices that
use the same short letter are handled (they are discarded instead of
raising an Exception).
2016-01-28 13:01:44 +01:00
Diego Moreda
79d84c0e4f Style and doc fixes for MB_id importer argument
* Rename the importer argument and related variables to make it more
generic, as the feature should be independent of the backend used and
not restricted to MusicBrainz.
* Update documentation and docstrings accordingly.
* Add changelog entry.
2016-01-22 16:31:00 +01:00
Diego Moreda
b526227482 Cleanup and documentation for MB_id importer arg
* Style cleanup and fixes for the "--musicbrainzid" import argument.
* Allow the input of several IDs (separated by spaces) on the "enter Id"
importer prompt.
* Add basic documentation.
2016-01-21 17:08:53 +01:00
Diego Moreda
c12e974852 Merge remote-tracking branch 'upstream/master' into mbid 2016-01-19 21:58:10 +01:00
Diego Moreda
48c92fbf5a Allow multiple MB ids to be passed to the importer
* Modify the "--musicbrainzid" argument to the importer so multiple IDs can be
specified by the user instead of a single one.
* Revise autotag.match.tag_album and autotag.match.tag_item signature to expect
a list of IDs (search_ids) instead of a single one (search_id), and add logic
for handling and returning multiple matches for those IDs.
* Update calls to those functions in other parts of the code.
2016-01-19 21:43:32 +01:00
Adrian Sampson
231981de0c Fix #1806: handle OSError in stats -e 2016-01-11 10:13:26 -08:00
Diego Moreda
1c95b7c46f Add musicbrainz id option to importer
* Add '-m', '--musicbrainzid' option to the import command, allowing the user
to specify a single MusicBrainz ID to be used for the candidate lookup instead
of trying to find suitable candidates.
* Modify lookup_candidates() of ImportTask and SingletonImportTask to use the
musicbrainz id if present.
2016-01-11 17:39:05 +01:00
Adrian Sampson
963a66a40c Refactor try_sync to also include moving
This will remove a bunch of duplication we currently have for moving files
*inside the library directory* when their metadata changes.
2016-01-08 14:56:52 -08:00
Jesse Weinstein
d4ccc10667 Fix typo: judment -> judgement 2016-01-06 01:31:01 -08:00
Adrian Sampson
f582e045e9 Add a comment for #1584 2016-01-01 13:05:07 -08:00
François-Xavier Thomas
50789e88fe Fix 1583: Move command only shows modified files 2016-01-01 17:49:53 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Diego Moreda
fc08b4665d Prompt event cleanup, conflict solving, singleton
* Simplify PromptChoice so "plugin" and "id" fields are removed, updating the
loops and the rest of the code to reflect this change.
* Solve short letter conflicts by keeping one of the choices and removing the
rest, instead of by raising an Exception.
* Misc cleanups as suggested on #1758 discussion.
2015-12-16 19:10:30 +01:00
Diego Moreda
70cefb516f Prompt event style changes and cleanup
* Rename "ExtraChoice" to "PromptChoice", and add an attribute for the short
letter used by the choice (short).
* Add TerminalImportSession._get_plugin_options() for isolating the sending
of the event and the processing of the returned values (flattening, check for
letter conflicts).
* Remove unnecessary TODO lines and other style cleanups.
2015-12-15 19:43:31 +01:00
Diego Moreda
a15dffad1d Add "before_choose_candidate" event
* Add "before_choose_candidate" event, sent to the plugins during
TerminalImportSession.choose_match(). This event allows plugins to append
additional choice to the user prompt during importer.
* The event is sent on the main loop of choose_match(), with session and task
parameters. The plugins are responsible for checking the task status in order
to append choices in a sensible way.
* Add "ExtraChoice" namedtuple to improve readability and encapsulate the
concept of a single extra choice.
2015-12-11 15:58:52 +01:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Adrian Sampson
d5b7ce64da Move EDITOR discovery to a util function 2015-11-14 13:23:51 -08:00
Adrian Sampson
80bfd186ae Use should_write for modify, update, and mbsync
This should address the surprising situation in #1697, where `import` went
fine but then `update` unexpectedly changed filenames.
2015-11-07 13:34:47 -08:00
Adrian Sampson
5b761f029e A new should_write configuration wrapper
The idea is that it is so common to check whether we need to write tags (or
move files), and we're constantly re-implementing the same logic everywhere.
It's not even the prettiest logic, as it commingles the importer settings with
general settings. So it's important that we encapsulate the decision so we can
make it better in the future.
2015-11-07 13:14:33 -08:00
Adrian Sampson
cc5aba8294 Roll back PR #1358: regression on recent duplicate
This should fix #1652, which found that this code did the wrong thing when
there were *no* `found_duplicates`: that is, when the duplicate actually came
from the `seen_keys` list, so the album is not in the database yet. This
handling was confusing "no non-empty duplicates" with "no in-database
duplicates", and incorrectly bypassing the duplicates prompt.

Since having empty albums in the database is a rare case (it should be
impossible!), and we should no longer *crash* when it happens, I am
considering it unnecessary to handle it specially. The user will now just see
"Old: 0 items" and that's that.
2015-10-24 12:46:27 -07:00
nath@home
9c663432bd Refactor util/interactive_open: multiple targets
interactive_open should now be invoked with at least the list of
targets and optionally the command to open the targets with.
This allows beets-play to pass multiple file paths directly to
the configured command.

The changes to the existing invocations are pretty trivial in
order to comply to this refactor.
2015-09-01 23:42:42 +02:00
Adrian Sampson
9e83c76762 Changelog for #1582 2015-08-29 12:57:59 -07:00
Adrian Sampson
3f490440b6 Reduce footprint of #1582
No need for a separate function since we only use this once.
2015-08-29 12:56:39 -07:00
Peter Kessen
b857320105 fixed tox style suggestions
also following the "no contrived examples" rule by using
beatles as artist in example
2015-08-28 08:47:25 +02:00
Peter Kessen
eb68d4ddb5 Added extra output for help with subcommand list
An example including output format is given now
2015-08-26 18:38:04 +02:00
Adrian Sampson
5420599839 New all_keys() method on dbcore.Model
Rather than the ad-hoc one on library classes. This also avoids some confusing
duplication in the `beet fields` output, at the cost of turning off the plugin
distinction.
2015-07-28 22:27:43 -07:00
Tom Jaspers
12295376eb Create empty user config file if it does not exist
Running `beet config -e` with a non-existing configuration file
does not always work (e.g., OSX uses `open` by default, which requires
the file to exist). This could occur during e.g. initial setup.

Resolve #1480
2015-07-07 22:56:02 +01:00
Jesse Weinstein
6df54f35ec Fix flake8 warnings 2015-06-26 00:46:30 -07:00
Jesse Weinstein
fa7b780b86 Fix singular/plural issue in move subcommand. 2015-06-24 23:08:28 -07:00
Jesse Weinstein
85244ec177 Fix singular vs plural noun usage 2015-06-24 22:53:16 -07:00
Tom Jaspers
be484f2af0 Implement --pretend option for the move command
The method `show_path_changes` takes a list of tuples (source, destination)
that will be printed on either single / double line, as proposed in #1405.
2015-05-20 13:03:18 +02:00
Pedro Silva
132dc4c617 refactor fields_func logic into Item/Album __dir__ 2015-05-16 15:49:42 +02:00
Barsanuphe
f72172aaa2 Fixed variable referenced before assignment. 2015-04-16 23:44:49 +02:00
Adrian Sampson
58c3e43b78 Ensure we always send bytes to sys.stdout
This is most pertinently important for interacting with nose's
output-capturing, which crashes when we mix bytes and unicode output. It's
also nice to have just for consistency.

Maybe we should enforce in the future that `print_` only gets Unicode
arguments. It's a pain supporting bytes calls and we should really only be
outputting text.

Python 3 can't come soon enough. 😢
2015-04-14 11:28:16 -07:00
Adrian Sampson
018f479ced Revert extra variables and whitespace from #1402 2015-04-07 22:50:37 -05:00
multikatt
c32bb850ca Remove redundant sort() 2015-04-07 21:26:30 -04:00
multikatt
956fa2cc52 Sorting printing of fields 2015-04-07 21:21:03 -04:00
Adrian Sampson
8452a1645c Sort plugin names in version output 2015-04-05 14:28:07 -07:00
Adrian Sampson
c37561c74b Redact by default (#1376) 2015-03-29 14:26:16 -07:00
Adrian Sampson
37860bf2ef --redacted is now --redact
Seems more direct to me.
2015-03-27 22:44:32 -04:00
Adrian Sampson
b477f4a53f Merge pull request #1376 from tomjaspers/config-redacted-fields
Config: new option -r redacts sensitive fields

Conflicts:
	beets/util/confit.py
2015-03-27 22:11:24 -04:00
Tom Jaspers
778138f2cd Config: redact sensitive fields with -r option
- `config -r` will show 'REDACTED' instead of the actual value
- Has a default list of field names that should be redacted (e.g., 'password')
- Plugins can add redacted fields that they introduce
2015-03-24 17:00:37 +01:00
Bruno Cauet
9b5d78bad0 Fix album emptiness test in duplicates resolution
Fix #1367.
Tests are missing for I've not found yet a satisfying way to build them.
2015-03-23 19:11:09 +01:00
Bruno Cauet
bcfdcdc4b7 Automatically remove dups when they're all empty 2015-03-18 17:38:24 +01:00
Bruno Cauet
8e25a70e40 summarize_items(): sort format by decr. freq
Make the summary deterministic.
2015-03-16 14:41:43 +01:00
Bruno Cauet
18fc0cd3de summarize_items(): work even with 0 items
It crashed on empty albums.

Fix #1357
2015-03-16 14:28:56 +01:00
Bruno Cauet
6234fee67d Option parser: add common options with a method
Add a new OptionParser subclass: CommonOptionsOptionParser, which
provides facilities for adding --album, --path and --format options. The
last one is quite versatile.

Update base commands (from beets.ui.commands) to use those.
2015-03-05 15:01:20 +01:00
Adrian Sampson
ca0e9a8c03 Merge pull request #1329 from brunal/play-interactive
play command is now interactive

Conflicts:
	docs/changelog.rst
2015-02-17 17:22:03 -05:00
Bruno Cauet
c47221555f Add beets.util.interactive_open() find cmd + execute
interactive_open() takes a target and an optional command, if it does not
receive a command then it uses open_anything().

It parses command and lexes it with shlex.split(), revieling the client
from that task.

"config -e" command uses it, and gives a better error message in case of
problem. "play" plugin uses it as well, as side-effect being that the
command is now interactive, as requested in issue #1321.

Fix issue #1321.
2015-02-16 12:26:17 +01:00
Bruno Cauet
5d9128aff3 util.interactive_open() return open/xdg-open/start
Depending on the platform return the correct automatic execution
command.
2015-02-16 11:35:13 +01:00
Tom Jaspers
d70a82449e Fields: show computed and flexible fields
- Computed fields from the _getters
- Flexible fields for which a type is defined
  (in _types or in a plugins' item_types/album_types)

Fix #1030
2015-02-16 10:34:35 +01:00
Bruno Cauet
d267741ff3 Delete 'format' variables that shadow the built-in
Also cleanup the 'the' plugin a bit: delete unused variables.

Relates to #1300.
2015-02-11 16:26:16 +01:00
Tom Jaspers
1341ad9b1d Importer UI: Display number of missing/unmatched tracks
Fix #1088
2015-02-03 10:23:52 +01:00
Tom Jaspers
6ed0b2e0f3 Expose an Item's filesize as a field
- Update test-case for info to make sure the item's path is pointing to an actual file.

See #1291
2015-02-02 21:52:23 +01:00
Tom Jaspers
43e9044843 Duplicate album-import summary shows old/new filesize
E.g.:
Old: 13 items, MP3, 256kbps, 44:32, 101MB
New: 13 items, MP3, 320kbps, 44:31, 128MB

Fix #1291
2015-01-31 22:11:43 +01:00
Tom Jaspers
927a53d59b Merge pull request #1281 from tomjaspers/configurable-colors
Colors are now user configurable.

Conflicts:
	beets/ui/__init__.py
	beets/ui/commands.py
2015-01-30 13:48:19 +01:00
Tom Jaspers
f483012183 Colorize is now to be called with the abstract color_name instead of the color.
E.g., `colorize('text_success', 'hello world')`

To ensure compatibility with 3rd party plugins, a valid color ('red') can still be passed,
but it will be logged.
2015-01-29 14:33:57 +01:00
Adrian Sampson
790c41a73d write: Do not try to write non-writable fields
Fix #1268.
2015-01-27 15:03:19 -08:00
Adrian Sampson
b8dab9cf9f Merge pull request #1247 from brunal/future
Use all __future__ imports in beets core

Conflicts:
	beetsplug/web/__init__.py
	test/test_embedart.py
2015-01-26 17:02:07 -08:00
Bruno Cauet
4aba4320e6 Rollback ui.print_() auto-conv of args to string
Since this raises problems the best is probably to maintain the base
behaviour: expect byte strings or unicodes.
2015-01-26 23:47:12 +01:00
Bruno Cauet
4e904c78af Simplify LibModel format management
Delete `ui.format_` and then `ui.print_obj`. Simply ensure that when
there is no format it defaults to '' = default format = config option.
2015-01-26 23:09:56 +01:00
Tom Jaspers
d3fce35481 Colors are user configurable
- Colors are mapped on to a dictionary using abstract names (e.g., text_success)
- Add `colors` option under `ui` to allow users to choose their own color scheme
- Move configuration option `color` from top-level to `ui`
- Show deprecation warning if top-level `color` configuration is used (but respect it)

Fix #1238
2015-01-26 17:24:32 +01:00
Bruno Cauet
065cb59ce7 Restore show_change() logging: MatchInfo, not Item 2015-01-26 09:44:51 +01:00
Bruno Cauet
8165dec985 Delete manual formattings of album & item 2015-01-25 21:32:22 +01:00
Bruno Cauet
62cd6e37aa Update ui.print_obj_(), add ui.format_()
Code now relies on `format()` for items and albums displaying/logging.
`ui.print_()` calls `unicode()` or `str()` on the strings so for most
usages calling `ui.print_(obj)` replaces `ui.print_(obj, lib, None)`.

Where there is a special format `ui.print_(format(obj, fmt))` is fine,
but when `fmt` can be None then one has to call
`ui.print_(ui.format_(obj, fmt))` -- which is what `ui.print_obj` now
does.
2015-01-25 21:07:03 +01:00
Bruno Cauet
f263935a51 Prevent shlex.split from returning strange encodings 2015-01-20 16:57:20 +01:00
Bruno Cauet
8dd7bf0f0b unicode_literals in beets.ui and beets.autotag
Well, that was easy!
2015-01-19 17:18:50 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Adrian Sampson
6f2d9845b5 Add an assertion for summarize_items (#1232) 2015-01-17 14:20:53 -08:00
Bruno Cauet
8418fb6083 Use a standard logger for the import log
The import log now relies on a standard logger, named 'beets.importer'
and configured upon initialization of the import session.
2015-01-12 21:47:44 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Adrian Sampson
f6dc2cd81c Merge pull request #1198 from brunal/logging
Lazy {}-style logging everywhere
2015-01-05 17:34:30 -08:00
Bruno Cauet
30f158a95e Move "from beets import logging" statements
Move the import next to other beets-related imports
2015-01-05 10:05:21 +01:00
Adrian Sampson
e13e7ed727 config -e: Parse arguments in $EDITOR (fix #1200) 2015-01-04 17:46:08 -08:00
Adrian Sampson
1f3fc60bad Add missing space (fix #1199) 2015-01-04 17:35:16 -08:00
Bruno Cauet
f5c5666729 Attain pep8-cleanliness
No more E12 or E501
2015-01-04 17:29:31 +01:00
Bruno Cauet
7df8bef8b7 Update logging imports: logging → beets.logging 2015-01-04 17:02:27 +01:00
Bruno Cauet
e75f9a703d Convert beets core to lazy logging 2015-01-04 17:02:27 +01:00
Adrian Sampson
a892128996 Changelog and rewording for import --pretend
(#1162)
2014-12-23 09:10:28 -05:00
Malte Ried
440fe9a2ea Reduced the count of accesses of the pretend config option. Now it's only one place where it is read.
Changed the output to use the log system rather than print_.
2014-12-21 21:37:44 +01:00
Malte Ried
2db346388a Added option --pretend to only print the filenames of files to import without importing them 2014-12-21 15:56:56 +01:00
Thomas Scholtes
a5f097a883 Allow invalid configuration files to be edited
Fixes #1123.
2014-12-01 13:02:21 +01:00
Adrian Sampson
14b150090e Fix #1124: avoid crash when deleting fields 2014-11-30 11:42:40 -08:00
Adrian Sampson
2343387a68 beet stats output clarification (#1052)
Explicitly say that size calculation is approximate.
2014-11-01 12:46:14 -07:00
Adrian Sampson
44ff3f782a Remove prefix diff highlighting
This was well-intentioned but ended up being more confusing than it was worth.
It's always confused me when one digit gets un-highlighted in one of these
displays. The straw that broke the camel's back was when I got a "#1 -> #16"
change where the numeral "1" was un-highlighted. To fix this right would be
way more trouble than it's worth; I'm glad to be rid of this detail.

Conflicts:
	docs/changelog.rst
2014-10-04 16:47:00 -07:00
Adrian Sampson
2795a01e28 Default sort configuration is global (#953)
It would be nice to cache the Sort object so we didn't have to re-parse this
every time...
2014-09-16 14:34:21 -07:00
Adrian Sampson
72436644a6 Merge pull request #909 from arogl/master
Clean up of logging messages as described here
2014-09-14 13:14:35 -07:00
Thomas Scholtes
1613a199fa Combine try_write() and store() as try_sync()
This makes sure we store the updated file `mtime`. By providing the
same interface on `Album` and `item` we can also reduce some code
duplication in the `modify` command.
2014-09-14 14:44:32 +02:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
d3386df056 Merge remote-tracking branch 'origin/master'
Conflicts:
	beets/importer.py
	beets/ui/commands.py
	beetsplug/lyrics.py
2014-09-09 12:05:38 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
816e4fb152 clean up after rebase 2014-09-09 11:53:44 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
2100dab379 displayable_path clean up error 2014-09-09 11:31:45 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
65de93941d flake8 cleanup
Cleanup after cleanup
2014-09-09 11:28:43 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
66aee8094f Clean up of logging messages as described here
All logging now prefers the ' (single quote) over the " (double quote)

https://github.com/sampsyo/beets/wiki/Hacking
2014-09-09 11:28:43 +10:00
Adrian Sampson
b227aabfee Merge pull request #917 from geigerzaehler/stats
Improvements for stats command
2014-08-25 08:44:55 -07:00
Thomas Scholtes
6d67365df6 PEP8 fix 2014-08-25 17:17:02 +02:00
Thomas Scholtes
9f4b3b811d Refactor modfiy command and tests
Parsing of the modify command line is handled by `modfiy_parse_args()`.
Test use the command line.
2014-08-25 15:46:57 +02:00
Thomas Scholtes
2d2c84b505 Stats only count albums in the database
Items might have the `album` field set without belonging to an album in
the beets database. We only count the albums that are represented in
the database.
2014-08-25 11:34:40 +02:00
Thomas Scholtes
9e2b6d0253 Show album artist stats
See #855
2014-08-25 11:33:10 +02:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
5f5ee40172 displayable_path clean up error 2014-08-23 12:17:24 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
89c5448ef5 flake8 cleanup
Cleanup after cleanup
2014-08-23 11:26:44 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
bd3f1ca5c0 Merge branch 'master' of https://github.com/sampsyo/beets 2014-08-23 11:00:23 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
a8daba2a75 Clean up of logging messages as described here
All logging now prefers the ' (single quote) over the " (double quote)

https://github.com/sampsyo/beets/wiki/Hacking
2014-08-23 09:26:34 +10:00
Adrian Sampson
eb579cf14b Merge pull request #823 from PierreRust/sortquery
Sorting support in beets query mecanism (dbcore)
2014-08-22 14:59:44 -07:00
Harry Khanna
4944686090 Change flag from --always to --force for symmetry with other beets commands 2014-08-19 14:07:17 -04:00
Harry Khanna
2ffd3e287f Add --always flag for write subcommand
Forces a write of tags to file even if the file's tags match the database.
This is useful to force plugins that respond to write (e.g., Scrub and Zero) to run on those tags.
This may also make the TODO comment in zero.py less important since creates a way to manually run the zero plugin on a file imported as-is.
2014-08-19 13:43:16 -04:00
Adrian Sampson
a45415fd77 Duplicate summaries work with singletons (#900) 2014-08-18 22:07:50 -07:00
Adrian Sampson
0ec285f96c Formatting and style refinements for #900 2014-08-18 21:37:13 -07:00
Howard Jones
4aa783f09d Final reshuffle to put summarize_items in beets.ui
Also improved duration display.
2014-08-18 12:21:45 +01:00
Howard Jones
3ec7426a35 Pass found duplicates between task and session 2014-08-18 10:35:01 +01:00
Howard Jones
a15cf2b001 Moved summarize_items to utils. Cleaned up output
Output now uses K for bitrate.
summarize function now in util
2014-08-18 08:57:59 +01:00
Howard Jones
4bf07aa8a6 Changed to not require collections
collections library is only available in Py 2.7+
2014-08-17 19:11:01 +01:00
Howard Jones
af347d957e Basic summary information for duplicates
Added a one-line summary of each album (in lib, and import target) so
you can easily tell if (for example) you are about to overwrite your
FLAC copy with a low-bitrate mp3 from somewhere else.
2014-08-17 18:53:02 +01:00
Thomas Scholtes
dc53f7907a Fix completion script 2014-07-08 17:52:46 +02:00
Thomas Scholtes
d2e848f75c Refactor help command and cli parsers
* Control flow and implementation of help command is now
  similar to the other commands.
* Simplifies and flattens some code and removes unused method.
* Makes SubcommandOptionParser agnostic of Subcommand.parser.
2014-07-08 17:10:39 +02:00
Pierre Rust
ebd2da14dc Fix error on default sort configuration
Fix crash when using several criteria for default sort in the
configuration file.
2014-06-15 22:32:25 +02:00
Pierre Rust
86c34f8740 Moves default sort specification from code to conf
Default sort order can be set in configuration file with the
`sort_album` and `sort_item` keys.
2014-06-15 22:32:25 +02:00
Heinz Wiesinger
d36b54cd56 Make beet write not show item names for items without changes. 2014-06-09 13:27:10 +02:00
Adrian Sampson
30c5f4ddf4 Changelog for #810 (fix #320) 2014-06-08 17:27:06 +01:00
Bruno Cauet
f40517b09e Show file path when deleting items
Using `beets remove -d <target>" now shows the file path when asking for
confirmation.

The format string is '$path - $title'.

Fix issue #320.
2014-06-08 17:22:15 +02:00
Adrian Sampson
e9355f336b Rename remove_duplicates and do_remove_duplicates 2014-04-26 20:21:20 -07:00
Thomas Scholtes
8fc9f3463f Add more paths to search for bash completion 2014-04-17 13:39:06 +02:00
Thomas Scholtes
151b451c33 Add more paths to search for bash completion 2014-04-16 23:53:45 +02:00
Adrian Sampson
033cf9ec21 spell check 2014-04-15 21:17:23 -07:00
Adrian Sampson
4e227d66a3 tiny indentation fix 2014-04-14 12:34:01 -07:00
Adrian Sampson
fcb55145e6 standardize placement of command setup
This groups together all of the optparse setup calls separately from the
functions. This comes at the expense of showing the command-line options above
the code that interprets them.

Making me wish for a more declarative CLI setup style...
2014-04-14 12:11:49 -07:00
Adrian Sampson
03bea61ac0 commands.py is flake8-clean 2014-04-14 10:53:32 -07:00
Adrian Sampson
fc143ecd54 changelog & style tweaks for #686 2014-04-14 10:43:09 -07:00
Mook
12a5215afa beet modify: Add simple argument parsing tests. 2014-04-13 21:24:45 -07:00
Mook
52d0c19fb7 beet modify: Treat arguments with : before = as queries, not modifications
This can be useful if the value being queried contains an equal sign.
2014-04-13 19:41:22 -07:00
Thomas Scholtes
1df6303222 Notify user when moving files 2014-04-13 13:18:41 +02:00
Adrian Sampson
4c9daa12cc Merge pull request #676 from geigerzaehler/item-try-write
Add item.try_write() to log errors
2014-04-10 11:33:06 -07:00
Thomas Scholtes
5d753b4f38 Remove ALBUM_* constants. Closes #650 2014-04-10 17:44:39 +02:00
Thomas Scholtes
f6f974ec87 Remove ITEM_* constants
We might consider renaming `Item._fields` to `Item.fields` since other parts of
beets use it as a replacement for `ITEM_KEYS`.

See also #650.
2014-04-10 17:11:21 +02:00
Thomas Scholtes
c3ea1ded30 Add item.try_write() to log errors
Many commands and plugins use `item.write()` to update tags. Since the success
of the call is not critical to the functionality of most consumers we want to
catch any exceptions, log an error and continue with our task. The new method
encapsulates this logic.

This fixes #675.
2014-04-10 15:26:05 +02:00
Adrian Sampson
323be89d4d fold OrderedEnum into autotag module
This puts the OrderedEnum generic class next to where it is actually used. It
also refers to the recipe it is taken from on docs.python.org. I also took the
opportunity to give this a capitalized name (since it's a proper type).
2014-04-08 17:10:50 -07:00
Adrian Sampson
b3f31cbc0a rename Item.media_fields to _media_fields
Following the convention of the other field sets and such. This helps avoid
any confusion with user-specified fields (although it's unlikely people will
want to name a flexible field "media_fields" :).
2014-04-07 20:21:20 -07:00
Adrian Sampson
c6451cfc50 write: fix undefined reference to MediaFile 2014-04-07 19:44:21 -07:00
Adrian Sampson
28556a0c37 catch ReadError when calling item.read() 2014-04-07 19:42:54 -07:00
Thomas Scholtes
55e5381bbd Merge branch 'extendable-mediafile'
Conflicts:
	beets/library.py
	docs/dev/plugins.rst
2014-04-07 23:49:29 +02:00
Thomas Scholtes
4b1a1e3d65 Remove ITEM_KEYS_WRITABLE 2014-04-04 00:03:40 +02:00
Thomas Scholtes
3c7dd13b72 Add Item.media_fields
This new property controls which fields to read from a media file.
2014-04-03 23:35:33 +02:00
Adrian Sampson
ac99622ec7 Merge branch 'single-files'
Conflicts:
	docs/changelog.rst
2014-04-03 13:20:53 -07:00
Adrian Sampson
b683f239f0 some style tweaks for #638 2014-04-02 21:18:41 -07:00
Adrian Sampson
c9141a6adf import single files and one-track albums
An alternate proposal for what's being discussed in #640.
2014-04-02 17:14:48 -07:00
Bruno Tournay
cd70e92b7f Modify command: ability to delete/reset an attribute (beet modify field!) 2014-04-01 22:38:33 +02:00
Adrian Sampson
05ebd6d28e FileOperationError: also include the file path
This makes the errors fully self-descriptive, which simplifies logging them as
errors (you just have to `log.error(exc)` to get a reasonable message). We
also now handle these at the top level in case someone forgets to add a
handler. But in this case, we also send the full traceback to the debug log.
2014-03-25 22:41:28 -07:00
Thomas Scholtes
574903e986 Add FileOperationError and handling in item.write() 2014-03-24 14:22:27 +01:00
Thomas Scholtes
85b16e4e3d Remove unused code 2014-03-22 13:25:25 +01:00
Thomas Scholtes
a399f294e8 Handle exceptions in item.write and use plugin abort 2014-03-22 13:25:25 +01:00
Thomas Scholtes
a744e8ea59 Fix missing import 2014-03-22 13:25:25 +01:00
Thomas Scholtes
ddf5233daa Add _item_write method and remove duplicate code 2014-03-22 13:25:25 +01:00
Thomas Scholtes
13cbcad581 Unify exception handling of item.write() in UI
Don’t abort the program when there is something wrong with the filesystem.
2014-03-22 13:25:25 +01:00
Thomas Scholtes
002d360039 Show only changed and writable values with the write command 2014-03-10 23:57:19 +01:00