Debian Codegraph @

docs/guides/tagger.rst

raw
1 .. _using-the-auto-tagger:
2
3 Using the Auto-Tagger
4 =====================
5
6 Beets' automatic metadata correcter is sophisticated but complicated and
7 cryptic. This is a guide to help you through its myriad inputs and options.
8
9 An Apology and a Brief Interlude
10 --------------------------------
11
12 I would like to sincerely apologize that the autotagger in beets is so fussy. It
13 asks you a *lot* of complicated questions, insecurely asking that you verify
14 nearly every assumption it makes. This means importing and correcting the tags
15 for a large library can be an endless, tedious process. I'm sorry for this.
16
17 Maybe it will help to think of it as a tradeoff. By carefully examining every
18 album you own, you get to become more familiar with your library, its extent,
19 its variation, and its quirks. People used to spend hours lovingly sorting and
20 resorting their shelves of LPs. In the iTunes age, many of us toss our music
21 into a heap and forget about it. This is great for some people. But there's
22 value in intimate, complete familiarity with your collection. So instead of a
23 chore, try thinking of correcting tags as quality time with your music
24 collection. That's what I do.
25
26 One practical piece of advice: because beets' importer runs in multiple threads,
27 it queues up work in the background while it's waiting for you to respond. So if
28 you find yourself waiting for beets for a few seconds between every question it
29 asks you, try walking away from the computer for a while, making some tea, and
30 coming back. Beets will have a chance to catch up with you and will ask you
31 questions much more quickly.
32
33 Back to the guide.
34
35 Overview
36 --------
37
38 Beets' tagger is invoked using the ``beet import`` command. Point it at a
39 directory and it imports the files into your library, tagging them as it goes
40 (unless you pass ``--noautotag``, of course). There are several assumptions
41 beets currently makes about the music you import. In time, we'd like to remove
42 all of these limitations.
43
44 - Your music should be organized by album into directories. That is, the tagger
45 assumes that each album is in a single directory. These directories can be
46 arbitrarily deep (like ``music/2010/hiphop/seattle/freshespresso/glamour``),
47 but any directory with music files in it is interpreted as a separate album.
48
49 There are, however, a couple of exceptions to this rule:
50
51 First, directories that look like separate parts of a *multi-disc album* are
52 tagged together as a single release. If two adjacent albums have a common
53 prefix, followed by "disc," "disk," "CD," "cassette," "digital media," or
54 "vinyl" and then a number, they are tagged together.
55
56 Second, if you have jumbled directories containing more than one album, you
57 can ask beets to split them apart for you based on their metadata. Use either
58 the ``--group-albums`` command-line flag or the *G* interactive option
59 described below.
60
61 - The music may have bad tags, but it's not completely untagged. This is because
62 beets by default infers tags based on existing metadata. But this is not a
63 hard and fast rule---there are a few ways to tag metadata-poor music:
64
65 - You can use the *E* or *I* options described below to search in
66 MusicBrainz for a specific album or song.
67 - The :doc:`Acoustid plugin </plugins/chroma>` extends the autotagger to
68 use acoustic fingerprinting to find information for arbitrary audio.
69 Install that plugin if you're willing to spend a little more CPU power
70 to get tags for unidentified albums. (But be aware that it does slow
71 down the process.)
72 - The :doc:`FromFilename plugin </plugins/fromfilename>` adds the ability
73 to guess tags from the filenames. Use this plugin if your tracks have
74 useful names (like "03 Call Me Maybe.mp3") but their tags don't reflect
75 that.
76
77 - Currently, MP3, AAC, FLAC, ALAC, Ogg Vorbis, Monkey's Audio, WavPack,
78 Musepack, Windows Media, Opus, and AIFF files are supported. (Do you use some
79 other format? Please `file a feature request`_!)
80
81 .. _file a feature request: https://github.com/beetbox/beets/issues/new?template=feature-request.md
82
83 Now that that's out of the way, let's tag some music.
84
85 .. _import-options:
86
87 Options
88 -------
89
90 To import music, just say ``beet import MUSICDIR``. There are, of course, a few
91 command-line options you should know:
92
93 - ``beet import -A``: don't try to autotag anything; just import files (this
94 goes much faster than with autotagging enabled)
95 - ``beet import -W``: when autotagging, don't write new tags to the files
96 themselves (just keep the new metadata in beets' database)
97 - ``beet import -C``: don't copy imported files to your music directory; leave
98 them where they are
99 - ``beet import -m``: move imported files to your music directory (overrides the
100 ``-c`` option)
101 - ``beet import -M``: don't move imported files to your music directory
102 (overrides the ``-m`` option)
103 - ``beet import -l LOGFILE``: write a message to ``LOGFILE`` every time you skip
104 an album or choose to take its tags "as-is" (see below) or the album is
105 skipped as a duplicate; this lets you come back later and reexamine albums
106 that weren't tagged successfully. Run ``beet import --from-logfile=LOGFILE``
107 rerun the importer on such paths from the logfile.
108 - ``beet import -q``: quiet mode. Never prompt for input and, instead,
109 conservatively skip any albums that need your opinion. The ``-ql`` combination
110 is recommended.
111 - ``beet import -t``: timid mode, which is sort of the opposite of "quiet." The
112 importer will ask your permission for everything it does, confirming even very
113 good matches with a prompt.
114 - ``beet import -p``: automatically resume an interrupted import. The importer
115 keeps track of imports that don't finish completely (either due to a crash or
116 because you stop them halfway through) and, by default, prompts you to decide
117 whether to resume them. The ``-p`` flag automatically says "yes" to this
118 question. Relatedly, ``-P`` flag automatically says "no."
119 - ``beet import -s``: run in *singleton* mode, tagging individual tracks instead
120 of whole albums at a time. See the "as Tracks" choice below. This means you
121 can use ``beet import -AC`` to quickly add a bunch of files to your library
122 without doing anything to them.
123 - ``beet import -g``: assume there are multiple albums contained in each
124 directory. The tracks contained a directory are grouped by album artist and
125 album name and you will be asked to import each of these groups separately.
126 See the "Group albums" choice below.
127
128 Similarity
129 ----------
130
131 So you import an album into your beets library. It goes like this:
132
133 ::
134
135 $ beet imp witchinghour
136 Tagging:
137 Ladytron - Witching Hour
138 (Similarity: 98.4%)
139 * Last One Standing -> The Last One Standing
140 * Beauty -> Beauty*2
141 * White Light Generation -> Whitelightgenerator
142 * All the Way -> All the Way...
143
144 Here, beets gives you a preview of the album match it has found. It shows you
145 which track titles will be changed if the match is applied. In this case, beets
146 has found a match and thinks it's a good enough match to proceed without asking
147 your permission. It has reported the *similarity* for the match it's found.
148 Similarity is a measure of how well-matched beets thinks a tagging option is.
149 100% similarity means a perfect match 0% indicates a truly horrible match.
150
151 In this case, beets has proceeded automatically because it found an option with
152 very high similarity (98.4%). But, as you'll notice, if the similarity isn't
153 quite so high, beets will ask you to confirm changes. This is because beets
154 can't be very confident about more dissimilar matches, and you (as a human) are
155 better at making the call than a computer. So it occasionally asks for help.
156
157 Choices
158 -------
159
160 When beets needs your input about a match, it says something like this:
161
162 ::
163
164 Tagging:
165 Beirut - Lon Gisland
166 (Similarity: 94.4%)
167 * Scenic World (Second Version) -> Scenic World
168 [A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums, Rescan directory, Enter search, enter Id, or aBort?
169
170 When beets asks you this question, it wants you to enter one of the capital
171 letters: A, M, S, U, T, G, R, E, I or B. That is, you can choose one of the
172 following:
173
174 - *A*: Apply the suggested changes shown and move on.
175 - *M*: Show more options. (See the Candidates section, below.)
176 - *S*: Skip this album entirely and move on to the next one.
177 - *U*: Import the album without changing any tags. This is a good option for
178 albums that aren't in the MusicBrainz database, like your friend's operatic
179 faux-goth solo record that's only on two CD-Rs in the universe.
180 - *T*: Import the directory as *singleton* tracks, not as an album. Choose this
181 if the tracks don't form a real release---you just have one or more loner
182 tracks that aren't a full album. This will temporarily flip the tagger into
183 *singleton* mode, which attempts to match each track individually.
184 - *G*: Group tracks in this directory by *album artist* and *album* and import
185 groups as albums. If the album artist for a track is not set then the artist
186 is used to group that track. For each group importing proceeds as for
187 directories. This is helpful if a directory contains multiple albums.
188 - *R*: Rescan the directory from disk and re-run the match. Use this if you want
189 to clean up the files (remove duplicates or junk, add missing tracks, etc.)
190 without restarting the whole ``beet import`` run---just make your changes on
191 disk before choosing this option.
192 - *E*: Enter an artist and album to use as a search in the database. Use this
193 option if beets hasn't found any good options because the album is mistagged
194 or untagged.
195 - *I*: Enter a metadata backend ID to use as search in the database. Use this
196 option to specify a backend entity (for example, a MusicBrainz release or
197 recording) directly, by pasting its ID or the full URL. You can also specify
198 several IDs by separating them by a space.
199 - *B*: Cancel this import task altogether. No further albums will be tagged;
200 beets shuts down immediately. The next time you attempt to import the same
201 directory, though, beets will ask you if you want to resume tagging where you
202 left off.
203
204 Note that the option with ``[B]rackets`` is the default---so if you want to
205 apply the changes, you can just hit return without entering anything.
206
207 Candidates
208 ----------
209
210 If you choose the M option, or if beets isn't very confident about any of the
211 choices it found, it will present you with a list of choices (called
212 candidates), like so:
213
214 ::
215
216 Finding tags for "Panther - Panther".
217 Candidates:
218 1. Panther - Yourself (66.8%)
219 2. Tav Falco's Panther Burns - Return of the Blue Panther (30.4%)
220 # selection (default 1), Skip, Use as-is, or Enter search, or aBort?
221
222 Here, you have many of the same options as before, but you can also enter a
223 number to choose one of the options that beets has found. Don't worry about
224 guessing---beets will show you the proposed changes and ask you to confirm them,
225 just like the earlier example. As the prompt suggests, you can just hit return
226 to select the first candidate.
227
228 .. _guide-duplicates:
229
230 Duplicates
231 ----------
232
233 If beets finds an album or item in your library that seems to be the same as the
234 one you're importing, you may see a prompt like this:
235
236 ::
237
238 This album is already in the library!
239 [S]kip new, Merge all, Remove old, Keep all, Upgrade?
240
241 Beets wants to keep you safe from duplicates, which can be a real pain, so you
242 have five choices in this situation. You can skip importing the new music,
243 choosing to keep the stuff you already have in your library; you can keep both
244 the old and the new music; you can remove the existing music and choose the new
245 stuff; or you can merge all the new and old tracks into a single album. If you
246 choose that "remove" option, any duplicates will be removed from your library
247 database---and, if the corresponding files are located inside of your beets
248 library directory, the files themselves will be deleted as well.
249
250 If you choose "merge", beets will try re-importing the existing and new tracks
251 as one bundle together. This is particularly helpful when you have an album
252 that's missing some tracks and then want to import the remaining songs. The
253 importer will ask you the same questions as it would if you were importing all
254 tracks at once.
255
256 If you choose "upgrade", beets compares each new track with its existing
257 counterpart and replaces the old track only when the new one has a higher
258 bitrate. New tracks without an existing counterpart are still added, while the
259 rest of the existing album remains untouched.
260
261 If you choose to keep two identically-named albums, beets can avoid storing both
262 in the same directory. See :ref:`aunique` for details.
263
264 Fingerprinting
265 --------------
266
267 You may have noticed by now that beets' autotagger works pretty well for most
268 files, but can get confused when files don't have any metadata (or have wildly
269 incorrect metadata). In this case, you need *acoustic fingerprinting*, a
270 technology that identifies songs from the audio itself. With fingerprinting,
271 beets can autotag files that have very bad or missing tags. The :doc:`"chroma"
272 plugin </plugins/chroma>`, distributed with beets, uses the Chromaprint_
273 open-source fingerprinting technology, but it's disabled by default. That's
274 because it's sort of tricky to install. See the :doc:`/plugins/chroma` page for
275 a guide to getting it set up.
276
277 Before you jump into acoustic fingerprinting with both feet, though, give beets
278 a try without it. You may be surprised at how well metadata-based matching
279 works.
280
281 .. _chromaprint: https://acoustid.org/chromaprint
282
283 Album Art, Lyrics, Genres and Such
284 ----------------------------------
285
286 Aside from the basic stuff, beets can optionally fetch more specialized
287 metadata. As a rule, plugins are responsible for getting information that
288 doesn't come directly from the MusicBrainz database. This includes :doc:`album
289 cover art </plugins/fetchart>`, :doc:`song lyrics </plugins/lyrics>`, and
290 :doc:`musical genres </plugins/lastgenre>`. Check out the :doc:`list of plugins
291 </plugins/index>` to pick and choose the data you want.
292
293 Missing Albums?
294 ---------------
295
296 If you're having trouble tagging a particular album with beets, check to make
297 sure the album is present in `the MusicBrainz database`_. You can search on
298 their site to make sure it's cataloged there. If not, anyone can edit
299 MusicBrainz---so consider adding the data yourself.
300
301 .. _the musicbrainz database: https://musicbrainz.org/
302
303 If you receive a "No matching release found" message from the Auto-Tagger for an
304 album you know is present in MusicBrainz, check that musicbrainz is in the
305 plugin list. Until version v2.4.0_ the default metadata source for the
306 Auto-Tagger, the :doc:`musicbrainz plugin </plugins/musicbrainz>`, had to be
307 manually disabled. At present, if the plugin list is changed, musicbrainz needs
308 to be added to the plugin list in order to continue contributing results to
309 Auto-Tagger.
310
311 If you think beets is ignoring an album that's listed in MusicBrainz, please
312 `file a bug report`_.
313
314 .. _file a bug report: https://github.com/beetbox/beets/issues
315
316 .. _v2.4.0: https://github.com/beetbox/beets/releases/tag/v2.4.0
317
318 I Hope That Makes Sense
319 -----------------------
320
321 If we haven't made the process clear, please post on `the discussion board`_ and
322 we'll try to improve this guide.
323
324 .. _the discussion board: https://github.com/beetbox/beets/discussions/