コード例 #1
0
ファイル: embedart.py プロジェクト: RobbeeUA/Music
        def embed_func(lib, opts, args):
            if opts.file:
                imagepath = normpath(opts.file)
                if not os.path.isfile(syspath(imagepath)):
                    raise ui.UserError(u'image file {0} not found'.format(
                        displayable_path(imagepath)))

                items = lib.items(decargs(args))

                # Confirm with user.
                if not opts.yes and not _confirm(items, not opts.file):
                    return

                for item in items:
                    art.embed_item(self._log, item, imagepath, maxwidth, None,
                                   compare_threshold, ifempty)
            else:
                albums = lib.albums(decargs(args))

                # Confirm with user.
                if not opts.yes and not _confirm(albums, not opts.file):
                    return

                for album in albums:
                    art.embed_album(self._log, album, maxwidth, False,
                                    compare_threshold, ifempty)
                    self.remove_artfile(album)
コード例 #2
0
ファイル: embedart.py プロジェクト: SerhatG/nzbToMedia
        def embed_func(lib, opts, args):
            if opts.file:
                imagepath = normpath(opts.file)
                if not os.path.isfile(syspath(imagepath)):
                    raise ui.UserError(u'image file {0} not found'.format(
                        displayable_path(imagepath)
                    ))

                items = lib.items(decargs(args))

                # Confirm with user.
                if not opts.yes and not _confirm(items, not opts.file):
                    return

                for item in items:
                    art.embed_item(self._log, item, imagepath, maxwidth, None,
                                   compare_threshold, ifempty)
            else:
                albums = lib.albums(decargs(args))

                # Confirm with user.
                if not opts.yes and not _confirm(albums, not opts.file):
                    return

                for album in albums:
                    art.embed_album(self._log, album, maxwidth, False,
                                    compare_threshold, ifempty)
                    self.remove_artfile(album)
コード例 #3
0
ファイル: embedart.py プロジェクト: 15502119602/beets
 def process_album(self, album):
     """Automatically embed art after art has been set
     """
     if self.config['auto']:
         max_width = self.config['maxwidth'].get(int)
         art.embed_album(self._log, album, max_width, True,
                         self.config['compare_threshold'].get(int),
                         self.config['ifempty'].get(bool))
コード例 #4
0
 def process_album(self, album):
     """Automatically embed art after art has been set
     """
     if self.config['auto']:
         max_width = self.config['maxwidth'].get(int)
         art.embed_album(self._log, album, max_width, True,
                         self.config['compare_threshold'].get(int),
                         self.config['ifempty'].get(bool))
コード例 #5
0
ファイル: embedart.py プロジェクト: pkess/beets
 def embed_func(lib, opts, args):
     if opts.file:
         imagepath = normpath(opts.file)
         if not os.path.isfile(syspath(imagepath)):
             raise ui.UserError(u"image file {0} not found".format(displayable_path(imagepath)))
         for item in lib.items(decargs(args)):
             art.embed_item(self._log, item, imagepath, maxwidth, None, compare_threshold, ifempty)
     else:
         for album in lib.albums(decargs(args)):
             art.embed_album(self._log, album, maxwidth, False, compare_threshold, ifempty)
             self.remove_artfile(album)
コード例 #6
0
 def embed_func(lib, opts, args):
     if opts.file:
         imagepath = normpath(opts.file)
         if not os.path.isfile(syspath(imagepath)):
             raise ui.UserError(u'image file {0} not found'.format(
                 displayable_path(imagepath)))
         for item in lib.items(decargs(args)):
             art.embed_item(self._log, item, imagepath, maxwidth, None,
                            compare_threshold, ifempty)
     else:
         for album in lib.albums(decargs(args)):
             art.embed_album(self._log, album, maxwidth, False,
                             compare_threshold, ifempty)
コード例 #7
0
ファイル: embedart.py プロジェクト: pkess/beets
 def process_album(self, album):
     """Automatically embed art after art has been set
     """
     if self.config["auto"] and ui.should_write():
         max_width = self.config["maxwidth"].get(int)
         art.embed_album(
             self._log,
             album,
             max_width,
             True,
             self.config["compare_threshold"].get(int),
             self.config["ifempty"].get(bool),
         )
         self.remove_artfile(album)
コード例 #8
0
        def embed_func(lib, opts, args):
            if opts.file:
                imagepath = normpath(opts.file)
                if not os.path.isfile(syspath(imagepath)):
                    raise ui.UserError(u'image file {0} not found'.format(
                        displayable_path(imagepath)))
                for item in lib.items(decargs(args)):
                    art.embed_item(self._log, item, imagepath, maxwidth, None,
                                   compare_threshold, ifempty)
            else:
                for album in lib.albums(decargs(args)):
                    art.embed_album(self._log, album, maxwidth, False,
                                    compare_threshold, ifempty)

                    if remove_art_file and album.artpath is not None:
                        if os.path.isfile(album.artpath):
                            self._log.debug(
                                u'Removing album art file '
                                u'for {0}', album)
                            os.remove(album.artpath)
                            album.artpath = None
                            album.store()
コード例 #9
0
ファイル: embedart.py プロジェクト: drm00/beets
        def embed_func(lib, opts, args):
            if opts.file:
                imagepath = normpath(opts.file)
                if not os.path.isfile(syspath(imagepath)):
                    raise ui.UserError(u'image file {0} not found'.format(
                        displayable_path(imagepath)
                    ))
                for item in lib.items(decargs(args)):
                    art.embed_item(self._log, item, imagepath, maxwidth, None,
                                   compare_threshold, ifempty)
            else:
                for album in lib.albums(decargs(args)):
                    art.embed_album(self._log, album, maxwidth, False,
                                    compare_threshold, ifempty)

                    if remove_art_file and album.artpath is not None:
                        if os.path.isfile(album.artpath):
                            self._log.debug(u'Removing album art file '
                                            u'for {0}', album)
                            os.remove(album.artpath)
                            album.artpath = None
                            album.store()