mirror of
https://github.com/beetbox/beets.git
synced 2025-12-29 12:02:44 +01:00
Add 'count' and 'total' parameters
- count: count missing tracks per album - total: count total missing tracks
This commit is contained in:
parent
bed7c5ae88
commit
69877f2013
1 changed files with 13 additions and 0 deletions
|
|
@ -105,6 +105,8 @@ class MissingPlugin(BeetsPlugin):
|
|||
super(MissingPlugin, self).__init__()
|
||||
|
||||
self.config.add({'format': None})
|
||||
self.config.add({'count': False})
|
||||
self.config.add({'total': False})
|
||||
|
||||
self._command = Subcommand('missing',
|
||||
help=__doc__,
|
||||
|
|
@ -115,10 +117,21 @@ class MissingPlugin(BeetsPlugin):
|
|||
help='print with custom FORMAT',
|
||||
metavar='FORMAT')
|
||||
|
||||
self._command.parser.add_option('-c', '--count', dest='count',
|
||||
action='store_true',
|
||||
help='count missing tracks per album')
|
||||
|
||||
self._command.parser.add_option('-t', '--total', dest='total',
|
||||
action='store_true',
|
||||
help='count total of missing tracks')
|
||||
|
||||
def commands(self):
|
||||
def _miss(lib, opts, args):
|
||||
self.config.set_args(opts)
|
||||
fmt = self.config['format'].get()
|
||||
count = self.config['count'].get()
|
||||
total = self.config['total'].get()
|
||||
|
||||
|
||||
for album in lib.albums(decargs(args)):
|
||||
for item in _missing(album):
|
||||
|
|
|
|||
Loading…
Reference in a new issue