How to use the beets.ui.decargs function in beets

To help you get started, we’ve selected a few beets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rembo10 / headphones / lib / beetsplug / fetchart.py View on Github external
def func(lib, opts, args):
            batch_fetch_art(lib, lib.albums(ui.decargs(args)), opts.force,
                            self.maxwidth)
        cmd.func = func
github clinton-hall / nzbToMedia / libs / beetsplug / embedart.py View on Github external
def clear_func(lib, opts, args):
            art.clear(self._log, lib, decargs(args))
        clear_cmd.func = clear_func
github beetbox / beets / beetsplug / lastgenre / __init__.py View on Github external
def lastgenre_func(lib, opts, args):
            write = ui.should_write()
            self.config.set_args(opts)

            for album in lib.albums(ui.decargs(args)):
                album.genre, src = self._get_genre(album)
                self._log.info(u'genre for album {0} ({1}): {0.genre}',
                               album, src)
                album.store()

                for item in album.items():
                    # If we're using track-level sources, also look up each
                    # track on the album.
                    if 'track' in self.sources:
                        item.genre, src = self._get_genre(item)
                        item.store()
                        self._log.info(u'genre for track {0} ({1}): {0.genre}',
                                       item, src)

                    if write:
                        item.try_write()
github beetbox / beets / beetsplug / fetchart.py View on Github external
def func(lib, opts, args):
            self.batch_fetch_art(lib, lib.albums(ui.decargs(args)), opts.force,
                                 opts.quiet)
        cmd.func = func
github rembo10 / headphones / lib / beets / ui / commands.py View on Github external
def list_func(lib, opts, args):
    if opts.path:
        fmt = '$path'
    else:
        fmt = opts.format
    list_items(lib, decargs(args), opts.album, fmt)
list_cmd.func = list_func
github beetbox / beets / beetsplug / ipfs.py View on Github external
album)

                    self.ipfs_add(album)
                    album.store()

            if opts.get:
                self.ipfs_get(lib, ui.decargs(args))

            if opts.publish:
                self.ipfs_publish(lib)

            if opts._import:
                self.ipfs_import(lib, ui.decargs(args))

            if opts._list:
                self.ipfs_list(lib, ui.decargs(args))

            if opts.play:
                self.ipfs_play(lib, opts, ui.decargs(args))
github beetbox / beets / beetsplug / fetchart.py View on Github external
def func(lib, opts, args):
            self.batch_fetch_art(lib, lib.albums(ui.decargs(args)), opts.force)
        cmd.func = func
github beetbox / beets / beets / ui / commands.py View on Github external
def write_func(lib, opts, args):
    write_items(lib, decargs(args), opts.pretend)
github beetbox / beets / beetsplug / web / __init__.py View on Github external
def func(lib, opts, args):
            args = ui.decargs(args)
            if args:
                self.config['host'] = args.pop(0)
            if args:
                self.config['port'] = int(args.pop(0))

            app.config['lib'] = lib
            # Normalizes json output
            app.config['JSONIFY_PRETTYPRINT_REGULAR'] = False

            app.config['INCLUDE_PATHS'] = self.config['include_paths']

            # Enable CORS if required.
            if self.config['cors']:
                self._log.info(u'Enabling CORS with origin: {0}',
                               self.config['cors'])
                from flask_cors import CORS
github clinton-hall / nzbToMedia / libs / beetsplug / lyrics.py View on Github external
def func(lib, opts, args):
            # The "write to files" option corresponds to the
            # import_write config value.
            write = ui.should_write()
            for item in lib.items(ui.decargs(args)):
                self.fetch_item_lyrics(
                    lib, item, write,
                    opts.force_refetch or self.config['force'],
                )
                if opts.printlyr and item.lyrics:
                    ui.print_(item.lyrics)