示例#1
0
文件: embedart.py 项目: pkess/beets
 def extract_func(lib, opts, args):
     if opts.outpath:
         art.extract_first(self._log, normpath(opts.outpath), lib.items(decargs(args)))
     else:
         filename = bytestring_path(opts.filename or config["art_filename"].get())
         if os.path.dirname(filename) != "":
             self._log.error(u"Only specify a name rather than a path for -n")
             return
         for album in lib.albums(decargs(args)):
             artpath = normpath(os.path.join(album.path, filename))
             artpath = art.extract_first(self._log, artpath, album.items())
             if artpath and opts.associate:
                 album.set_art(artpath)
                 album.store()
示例#2
0
 def extract_func(lib, opts, args):
     if opts.outpath:
         art.extract_first(self._log, normpath(opts.outpath),
                           lib.items(decargs(args)))
     else:
         filename = bytestring_path(opts.filename
                                    or config['art_filename'].get())
         if os.path.dirname(filename) != '':
             self._log.error(u"Only specify a name rather than a path "
                             u"for -n")
             return
         for album in lib.albums(decargs(args)):
             artpath = normpath(os.path.join(album.path, filename))
             artpath = art.extract_first(self._log, artpath,
                                         album.items())
             if artpath and opts.associate:
                 album.set_art(artpath)
                 album.store()