doc correction and refactoring for #275

Plugin-provided template fields are not available for queries. (Perhaps they
should be, though!)
This commit is contained in:
Adrian Sampson 2013-05-17 12:07:53 -07:00
parent a6a0256bf9
commit 1ffc56b85a
2 changed files with 11 additions and 10 deletions

View file

@ -135,17 +135,19 @@ class MissingPlugin(BeetsPlugin):
print(sum([_missing_count(a) for a in albums]))
return
# Default format string for count mode.
if count and not fmt:
fmt = '$albumartist - $album: $missing'
for album in albums:
if count:
missing = _missing_count(album)
if missing:
if not fmt:
fmt = '$albumartist - $album: $missing'
print_obj(album, lib, fmt=fmt.format(missing))
continue
print_obj(album, lib, fmt=fmt)
for item in _missing(album):
print_obj(item, lib, fmt=fmt)
else:
for item in _missing(album):
print_obj(item, lib, fmt=fmt)
self._command.func = _miss
return [self._command]

View file

@ -60,12 +60,11 @@ total
The ``total`` option (default: false) prints a single
count of missing tracks in all albums
Metadata fields
Template Fields
---------------
With this plugin enabled, templates can reference ``$missing`` as they
can any standard metadata field for use in :doc:`Queries
</reference/query>` and :doc:`Path Formats </reference/pathformat>`.
With this plugin enabled, the ``$missing`` template field expands to the
number of tracks missing from each album.
Examples
--------