Commit graph

5946 commits

Author SHA1 Message Date
Diego Moreda
0ba8f83929 edit: allow edit album+item fields in single yaml
* Add support for editing both the item fields and the album fields in
a single YAML file, by appending an Album-like object as the front of
the objects to be edited.
* The FakeAlbum class provides that object, mimicking the original
Album behaviour and including an _apply_changes() method that propagates
the changes read from the yaml onto the Items.
* Modify edit_objects() so the flattening of the objects takes into
account the type of object, using different fields for Albums and for
Items.
* Renamed apply() to apply_() to prevent an IDE warning about reusing a
reserved built-in symbol.
2016-02-03 17:34:39 +01:00
Diego Moreda
32f9bd5077 edit: add tests for interactive importer execution
* Add EditDuringImporterTest test case, covering the running of the
plugin during an import session. Includes editing the "album" field
and applying/discarding for both editing from items and editing from
a candidate; and editing and applying for singletons for both editing
from items and editing from a candidate.
2016-02-03 17:17:48 +01:00
Diego Moreda
0e649e549a edit: add RETAG support for singleton, fix logic
* Add support for the RETAG action to SingletonImportTask.
* Modify ImportTask.align_album_level_fields() so the source of the
information is a bit more intelligent in the RETAG case instead of
always assuming the items come from applied metadata.
2016-02-03 17:13:33 +01:00
Diego Moreda
b8ec22ca34 edit: use action.RETAG, cleanup
* Make the edit plugin return action.RETAG when invoked during an
interactive import session, making the importer handle the writing of
the tags to the files (if needed) properly.
* Move the logic relative to the "reference field" to
_set_reference_field(), simplifying a bit the functions that depend on
this field.
* Hide the "edit Candidates" choice if no candidates are found.
2016-02-01 18:57:03 +01:00
Diego Moreda
e23718dc0c Add importer RETAG action
* Add importer "RETAG" action, to represent the case where the files
metadata has been modified by some mean other than applying metadata
(via a plugin), and as a result needs to be written to disk if the
"write" config flag is set.
2016-02-01 18:51:24 +01:00
Diego Moreda
b472e1e450 Merge branch 'master' of github.com:sampsyo/beets into interactiveedit 2016-01-29 20:20:56 +01:00
Adrian Sampson
da46a62772 Merge pull request #1848 from diego-plan9/master
Update documentation copyright year to 2016
2016-01-29 11:18:26 -08:00
Diego Moreda
6eed42d2ab Update documentation copyright year to 2016 2016-01-29 20:11:26 +01:00
Diego Moreda
30927a901f Fix flake8 error 2016-01-29 19:54:23 +01:00
Diego Moreda
98abe69520 edit: invoke editor during importer, on Items
* Initial draft for invoking the edit plugin during an importer session.
* Add prompt choices for editing the original file tags ("eDit") and
apply a candidate and then edit ("edit Candidates").
* Modify plugin (_get_fields, apply_data, edit_objects) so "path" can be
used as a reference field instead of "id", as the Items are not still on
the database when the plugin is invoked via the importer.
* Modify ImportTask.manipulate_files() with a temporary flag for writing
the item tags even if ASIS was selected.
2016-01-29 17:09:12 +01:00
Adrian Sampson
d093ef9a47 A little more documentation for fields (#1818) 2016-01-28 13:52:07 -08: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
Guilherme Danno
4605016c65 Changelog for #1818 2016-01-28 18:18:08 -02:00
Guilherme Danno
ff01015b61 Fields: Print flexible attributes 2016-01-28 17:30:36 -02:00
Peter Kessen
6ee7c4f7c7 Merge pull request #1842 from pkess/extend_test_for_modify
Extend test for modify
2016-01-28 19:18:54 +01:00
Peter Kessen
7b2de49274 added test for abort of modify action 2016-01-28 19:03:33 +01:00
Peter Kessen
a707715b81 added testcase with no write and no move
improves coverage
2016-01-28 18:59:46 +01:00
Peter Kessen
e0ffae3be0 added test case for Modify without any change 2016-01-28 18:59:34 +01:00
Peter Kessen
8954f1a494 split of modify function in modify_test 2016-01-28 18:59:11 +01: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
Peter Kessen
d486b2a70c Merge pull request #1839 from pkess/testError
Fixed bug when running subset of testcases
2016-01-27 20:55:54 +01:00
Peter Kessen
c7fff52324 Fixed bug when running subset of testcases
Happens when invoking `tox -e py27 test.test_ui` directly.
`os.environ.get('HOME')` seems to return None and raises an Exception
in tearDown of class
2016-01-27 19:12:49 +01:00
Diego Moreda
db7fffbdcc Merge pull request #1836 from diego-plan9/gstreamertest
Skip GStreamer tests if plugins are missing
2016-01-27 17:47:28 +01:00
Diego Moreda
76d7c65c1b replaygain: refine test by subclassing exception
* Subclass FatalReplayGainError into FatalGstreamerPluginReplayGainError
in order to handle gstreamer plugin errors more cleanly on
test_replaygain.
2016-01-26 22:20:42 +01:00
Diego Moreda
d2cec48c65 Skip GStreamer tests if plugins are missing
* Add a check to ReplayGainGstCliTest that ensures that the required
initial gstreamer plugins can be loaded, skipping the test if it is not
the case instead of running it.
* Add a check to ReplayGainGstCliTest.test_cli_saves_track_gain for
checking if item.rg_track_peak and item.rg_track_gain is not None. If
they are None, it is assumed that the decoder plugins could not be
found, and the tests is skipped, as discussed on #1830.
2016-01-26 17:59:51 +01:00
Adrian Sampson
0c839ae235 Clean up changelog (ready for release?) 2016-01-25 13:53:38 -08:00
Adrian Sampson
4634c7a9b8 Add new livereload server for docs 2016-01-25 13:19:26 -08:00
Adrian Sampson
5f8e710e07 Fix configuration in ReplayGain tests (#1830) 2016-01-25 10:27:36 -08:00
Adrian Sampson
33422c7cb1 Merge pull request #1828 from diego-plan9/autostubusage
Fix unrestored AutotagStub on two TestCases
2016-01-22 15:30:04 -08:00
Adrian Sampson
a07cb837aa Fix #1826: include test_completion.sh in sdist 2016-01-22 15:25:43 -08:00
Adrian Sampson
a18d0e4b3b Make bash-completion test more robust
I found some infelicities while investigating #1826. This test was hard-coding
a specific path for bash-completion, which was the wrong one for my system, so
it was being skipped every time. This searches the list of paths used by the
actual command.
2016-01-22 15:22:48 -08:00
Adrian Sampson
cb447f792f Merge pull request #1808 from diego-plan9/mbid
Add musicbrainz id option to importer
2016-01-22 15:04:34 -08:00
Diego Moreda
b49426046a Fix unrestored AutotagStub on two TestCases
* Call AutotagStub.restore() during the tearDown of
test_mbsubmit.MBSubmitPluginTest and test_plugins.PromptChoicesTest,
which could potentially lead to other tests calling mocked versions
of autotag.mb.match_album, .match_track, .album_for_id and .track_for_id
instead of the real functions.
2016-01-22 21:33:33 +01:00
Diego Moreda
4f51302d09 Fix typo on importer search by id documentation 2016-01-22 19:48:22 +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
Adrian Sampson
ba5b39cd46 Avoid including .pyc in source distribution
Fix #1825. Inspired by:
https://github.com/mitsuhiko/flask/blob/master/MANIFEST.in
2016-01-21 13:57:24 -08:00
Diego Moreda
4eedd2bd8d Store user-supplied MB ids on the Tasks
* Store the user-supplied MusicBrainz IDs (via the "--musicbrainzid"
importer argument) on ImporTask.task.musicbrainz_ids during the
lookup_candidates() pipeline stage.
* Update test cases to reflect the changes.
2016-01-21 20:33:54 +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
39cf4651b8 Fix singleton candidate ordering when using MB id
* Fix an issue that caused the candidates for a singleton not to be
returned ordered by distance from autotag.match.tag_item(), when
searching multiple MusicBrainz ids (ie. several "--musicbrainzid"
arguments). The candidates are now explicitely reordered before being
returned and before the recommendation is computed.
* Fix test_importer.mocked_get_recording_by_id so that the artist is
nested properly (and as a result, taken into account into the distance
calculations).
2016-01-20 20:22:48 +01:00
Diego Moreda
4e5ddac949 Avoid querying MB during ImportMusicBrainzIdTest
* Replace the entities used on ImportMusicBrainzIdTest mocking the calls to
musicbrainzngs.get_release_by_id and musicbrainzngs.get_recording_by_id instead
of querying MusicBrainz.
* Other cleanup and docstring fixes.
2016-01-20 17:03:16 +01:00
Diego Moreda
c12e974852 Merge remote-tracking branch 'upstream/master' into mbid 2016-01-19 21:58:10 +01:00
Diego Moreda
865be11ba1 Add tests for importer musicbrainz id argument
* Add tests for the "--musicbrainzid" argument (one/several ids for matching
an album/singleton; direct test on task.lookup_candidates() for
album/singleton).
2016-01-19 21:51:41 +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
248b0b070c Remove stray space in docs 2016-01-18 16:08:54 -05:00
Adrian Sampson
f0818919ac Merge pull request #1815 from beetbox/more_tests
Add more test coverage for mpdstats
2016-01-16 10:13:06 -08:00
Jesse Weinstein
e3d19b0a0f flake8 fixes 2016-01-16 00:26:56 -08:00
Jesse Weinstein
da1c4545aa Add more test coverage for mpdstats 2016-01-16 00:11:10 -08:00
Adrian Sampson
1866264732 Docsring for #1812 2016-01-15 10:10:56 -08:00