mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
changelog, little style tweak for #272
Changed single-triple quotes to double-triple quotes, just for consistency with the rest of the codebase.
This commit is contained in:
parent
e1f7027abc
commit
f086fb6fd7
3 changed files with 30 additions and 33 deletions
|
|
@ -12,8 +12,8 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
'''list missing tracks
|
||||
'''
|
||||
"""List missing tracks.
|
||||
"""
|
||||
import logging
|
||||
|
||||
from beets.autotag import hooks
|
||||
|
|
@ -21,19 +21,19 @@ from beets.library import Item
|
|||
from beets.plugins import BeetsPlugin
|
||||
from beets.ui import decargs, print_obj, Subcommand
|
||||
|
||||
plugin = 'missing'
|
||||
PLUGIN = 'missing'
|
||||
log = logging.getLogger('beets')
|
||||
|
||||
|
||||
def _missing_count(album):
|
||||
'''Return number of missing items in `album`.
|
||||
'''
|
||||
"""Return number of missing items in `album`.
|
||||
"""
|
||||
return album.tracktotal - len([i for i in album.items()])
|
||||
|
||||
|
||||
def _missing(album):
|
||||
'''Query MusicBrainz to determine items missing from `album`.
|
||||
'''
|
||||
"""Query MusicBrainz to determine items missing from `album`.
|
||||
"""
|
||||
item_mbids = map(lambda x: x.mb_trackid, album.items())
|
||||
|
||||
if len([i for i in album.items()]) < album.tracktotal:
|
||||
|
|
@ -44,20 +44,20 @@ def _missing(album):
|
|||
if track_info.track_id not in item_mbids:
|
||||
item = _item(track_info, album_info, album.id)
|
||||
log.debug('{}: track {} in album {}'
|
||||
.format(plugin,
|
||||
.format(PLUGIN,
|
||||
track_info.track_id,
|
||||
album_info.album_id))
|
||||
yield item
|
||||
|
||||
|
||||
def _item(track_info, album_info, album_id):
|
||||
'''Build and return `item` from `track_info` and `album info`
|
||||
"""Build and return `item` from `track_info` and `album info`
|
||||
objects. `item` is missing what fields cannot be obtained from
|
||||
MusicBrainz alone (encoder, rg_track_gain, rg_track_peak,
|
||||
rg_album_gain, rg_album_peak, original_year, original_month,
|
||||
original_day, length, bitrate, format, samplerate, bitdepth,
|
||||
channels, mtime.)
|
||||
'''
|
||||
"""
|
||||
t = track_info
|
||||
a = album_info
|
||||
|
||||
|
|
@ -97,8 +97,8 @@ def _item(track_info, album_info, album_id):
|
|||
|
||||
|
||||
class MissingPlugin(BeetsPlugin):
|
||||
'''List missing tracks
|
||||
'''
|
||||
"""List missing tracks
|
||||
"""
|
||||
def __init__(self):
|
||||
super(MissingPlugin, self).__init__()
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ Changelog
|
|||
1.1.1 (in development)
|
||||
----------------------
|
||||
|
||||
* New :doc:`/plugins/missing`: Find albums in your library that are missing
|
||||
tracks. Thanks to Pedro Silva.
|
||||
* When using queries to match on quantitative fields, you can now use
|
||||
**numeric ranges**. For example, you can get a list of albums from the '90s
|
||||
by typing ``beet ls year:1990..1999`` or find high-bitrate music with
|
||||
|
|
|
|||
|
|
@ -19,21 +19,19 @@ Enable the plugin by putting ``missing`` on your ``plugins`` line in
|
|||
Configuration
|
||||
-------------
|
||||
|
||||
The plugin accepts the following configuration directives, either in
|
||||
your configuration file::
|
||||
By default, the ``beet missing`` command lists the names of tracks that your
|
||||
library is missing from each album. You can customize the output format, count
|
||||
the number of missing tracks per album, or total up the number of missing
|
||||
tracks over your whole library. These options can either be specified in the
|
||||
config file::
|
||||
|
||||
missing:
|
||||
format: FMTSTR
|
||||
count: bool
|
||||
total: bool
|
||||
format: $albumartist - $album - $title
|
||||
count: no
|
||||
total: no
|
||||
|
||||
or in the command-line::
|
||||
or on the command-line::
|
||||
|
||||
$ beet missing --help
|
||||
Usage: beet missing [options]
|
||||
|
||||
Options:
|
||||
-h, --help show this help message and exit
|
||||
-f FORMAT, --format=FORMAT
|
||||
print with custom FORMAT
|
||||
-c, --count count missing tracks per album
|
||||
|
|
@ -43,27 +41,26 @@ or in the command-line::
|
|||
format
|
||||
~~~~~~
|
||||
|
||||
The ``format`` option (default: ``None``) lets you specify a specific
|
||||
format with which to print every track. This uses the same template
|
||||
syntax as beets’ :doc:`path formats </reference/pathformat>`. The usage
|
||||
is inspired by, and therefore similar to, the :ref:`list <list-cmd>`
|
||||
command.
|
||||
The ``format`` option (default: :ref:`list_format_item`) lets you specify a
|
||||
specific format with which to print every track. This uses the same template
|
||||
syntax as beets’ :doc:`path formats </reference/pathformat>`. The usage is
|
||||
inspired by, and therefore similar to, the :ref:`list <list-cmd>` command.
|
||||
|
||||
count
|
||||
~~~~~
|
||||
|
||||
The ``count` option (default: ``False``) prints a count of missing
|
||||
The ``count`` option (default: false) prints a count of missing
|
||||
tracks per album, with ``format`` hard-coded to ``'$album: $count'``.
|
||||
|
||||
total
|
||||
~~~~~
|
||||
|
||||
The ``total`` option (default: ``False``) prints a single
|
||||
The ``total`` option (default: false) prints a single
|
||||
count of missing tracks in all albums
|
||||
|
||||
|
||||
Examples
|
||||
-------------------------
|
||||
--------
|
||||
|
||||
List all missing tracks in your collection::
|
||||
|
||||
|
|
@ -92,6 +89,4 @@ TODO
|
|||
|
||||
- Add caching.
|
||||
|
||||
--------------
|
||||
|
||||
.. _spark: https://github.com/holman/spark
|
||||
|
|
|
|||
Loading…
Reference in a new issue