diff --git a/beetsplug/missing.py b/beetsplug/missing.py index ac1561648..1fcb0d68c 100644 --- a/beetsplug/missing.py +++ b/beetsplug/missing.py @@ -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] diff --git a/docs/plugins/missing.rst b/docs/plugins/missing.rst index 2418333d5..c128b84b8 100644 --- a/docs/plugins/missing.rst +++ b/docs/plugins/missing.rst @@ -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 -` and :doc:`Path Formats `. +With this plugin enabled, the ``$missing`` template field expands to the +number of tracks missing from each album. Examples --------