-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add musicbrainz id option to importer #1808
Changes from 9 commits
1c95b7c
48c92fb
865be11
c12e974
4e5ddac
39cf465
b526227
4eedd2b
79d84c0
4f51302
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -734,7 +734,7 @@ def choose_match(self, task): | |
search_id = manual_id(False) | ||
if search_id: | ||
_, _, candidates, rec = autotag.tag_album( | ||
task.items, search_id=search_id | ||
task.items, search_ids=search_id.split() | ||
) | ||
elif choice in extra_ops.keys(): | ||
# Allow extra ops to automatically set the post-choice. | ||
|
@@ -786,8 +786,8 @@ def choose_item(self, task): | |
# Ask for a track ID. | ||
search_id = manual_id(True) | ||
if search_id: | ||
candidates, rec = autotag.tag_item(task.item, | ||
search_id=search_id) | ||
candidates, rec = autotag.tag_item( | ||
task.item, search_ids=search_id.split()) | ||
elif choice in extra_ops.keys(): | ||
# Allow extra ops to automatically set the post-choice. | ||
post_choice = extra_ops[choice](self, task) | ||
|
@@ -1022,6 +1022,11 @@ def import_func(lib, opts, args): | |
'--pretend', dest='pretend', action='store_true', | ||
help='just print the files to import' | ||
) | ||
import_cmd.parser.add_option( | ||
'-S', '--search-id', dest='search_ids', action='append', | ||
metavar='BACKEND_ID', | ||
help='restrict matching to a specific metadata backend ID' | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a tiny nitpick, but these technically don't need to be MBIDs. Other backends can also interpret these IDs (for now, just the Discogs plugin). Alas, I don't have a great idea for another option name since |
||
import_cmd.func = import_func | ||
default_commands.append(import_cmd) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,11 @@ Optional command flags: | |
option. If set, beets will just print a list of files that it would | ||
otherwise import. | ||
|
||
* If you already have a metadata backend ID that matches the items to be | ||
imported, you can instruct beets to restrict the search to that ID instead of | ||
searching for other candidates by using the ``--search_id SEARCH_ID`` option. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Itsy-bitsy typo: |
||
Multiple IDs can be specified by simply repeating the option several times. | ||
|
||
.. _rarfile: https://pypi.python.org/pypi/rarfile/2.2 | ||
|
||
.. only:: html | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably describe
search_ids
in the docstring. (Although I note we didn't documentsearch_id
before—bad @sampsyo!)