def thumbnail_file_name(self, path): """Compute the thumbnail file name See http://standards.freedesktop.org/thumbnail-spec/latest/x227.html """ uri = self.get_uri(path) hash = md5(uri.encode('utf-8')).hexdigest() return util.bytestring_path("{0}.png".format(hash))
def thumbnail_file_name(self, path): """Compute the thumbnail file name See https://standards.freedesktop.org/thumbnail-spec/latest/x227.html """ uri = self.get_uri(path) hash = md5(uri.encode('utf-8')).hexdigest() return util.bytestring_path("{0}.png".format(hash))
import shutil from itertools import chain from pathlib import PurePosixPath import ctypes import ctypes.util from xdg import BaseDirectory from beets.plugins import BeetsPlugin from beets.ui import Subcommand, decargs from beets import util from beets.util.artresizer import ArtResizer, has_IM, has_PIL BASE_DIR = os.path.join(BaseDirectory.xdg_cache_home, "thumbnails") NORMAL_DIR = util.bytestring_path(os.path.join(BASE_DIR, "normal")) LARGE_DIR = util.bytestring_path(os.path.join(BASE_DIR, "large")) class ThumbnailsPlugin(BeetsPlugin): def __init__(self): super(ThumbnailsPlugin, self).__init__() self.config.add({ 'auto': True, 'force': False, 'dolphin': False, }) self.write_metadata = None if self.config['auto'] and self._check_local_ok(): self.register_listener('art_set', self.process_album)
import os import shutil from itertools import chain from pathlib import PurePosixPath import ctypes import ctypes.util from xdg import BaseDirectory from beets.plugins import BeetsPlugin from beets.ui import Subcommand, decargs from beets import util from beets.util.artresizer import ArtResizer, has_IM, has_PIL BASE_DIR = os.path.join(BaseDirectory.xdg_cache_home, "thumbnails") NORMAL_DIR = util.bytestring_path(os.path.join(BASE_DIR, "normal")) LARGE_DIR = util.bytestring_path(os.path.join(BASE_DIR, "large")) class ThumbnailsPlugin(BeetsPlugin): def __init__(self): super(ThumbnailsPlugin, self).__init__() self.config.add({ 'auto': True, 'force': False, 'dolphin': False, }) self.write_metadata = None if self.config['auto'] and self._check_local_ok(): self.register_listener('art_set', self.process_album)