File: badfiles.rst

package info (click to toggle)
beets 2.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,536 kB
  • sloc: python: 45,608; javascript: 7,997; xml: 334; sh: 261; makefile: 119
file content (63 lines) | stat: -rw-r--r-- 2,202 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Bad Files Plugin
================

The ``badfiles`` plugin adds a ``beet bad`` command to check for missing and
corrupt files.

Configuring
-----------

First, enable the ``badfiles`` plugin (see :ref:`using-plugins`). The default
configuration defines the following default checkers, which you may need to
install yourself:

* `mp3val`_ for MP3 files
* `FLAC`_ command-line tools for FLAC files

You can also add custom commands for a specific extension, like this::

    badfiles:
        check_on_import: yes
        commands:
            ogg: myoggchecker --opt1 --opt2
            flac: flac --test --warnings-as-errors --silent

Custom commands will be run once for each file of the specified type, with the
path to the file as the last argument. Commands must return a status code
greater than zero for a file to be considered corrupt.

You can run the checkers when importing files by using the `check_on_import`
option. When on, checkers will be run against every imported file and warnings
and errors will be presented when selecting a tagging option.

.. _mp3val: http://mp3val.sourceforge.net/
.. _flac: https://xiph.org/flac/

Using
-----

Type ``beet bad`` with a query according to beets' usual query syntax. For
instance, this will run a check on all songs containing the word "wolf"::

    beet bad wolf

This one will run checks on a specific album::

    beet bad album_id:1234

Here is an example where the FLAC decoder signals a corrupt file::

    beet bad title::^$
    /tank/Music/__/00.flac: command exited with status 1
      00.flac: *** Got error code 2:FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH
      00.flac: ERROR while decoding data
                 state = FLAC__STREAM_DECODER_READ_FRAME

Note that the default ``mp3val`` checker is a bit verbose and can output a lot
of "stream error" messages, even for files that play perfectly well.
Generally, if more than one stream error happens, or if a stream error happens
in the middle of a file, this is a bad sign.

By default, only errors for the bad files will be shown. In order for the
results for all of the checked files to be seen, including the uncorrupted
ones, use the ``-v`` or ``--verbose`` option.