mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-22 09:18:18 +00:00
Fix names consistency for image_info
This commit is contained in:
@@ -72,8 +72,8 @@ DEFAULT_RELEASE_TYPE_SCORES = [(g, DEFAULT_RELEASE_SCORE) for g in list(RELEASE_
|
||||
|
||||
|
||||
DEFAULT_CAA_IMAGE_SIZE = 500
|
||||
DEFAULT_CAA_IMAGE_TYPE_INCLUDE = ['front']
|
||||
DEFAULT_CAA_IMAGE_TYPE_EXCLUDE = ['matrix/runout', 'raw/unedited', 'watermark']
|
||||
DEFAULT_CAA_IMAGE_TYPE_INCLUDE = ('front',)
|
||||
DEFAULT_CAA_IMAGE_TYPE_EXCLUDE = ('matrix/runout', 'raw/unedited', 'watermark')
|
||||
|
||||
DEFAULT_LOCAL_COVER_ART_REGEX = r'^(?:cover|folder|albumart)(.*)\.(?:jpe?g|png|gif|tiff?|webp)$'
|
||||
|
||||
@@ -85,8 +85,8 @@ DEFAULT_QUERY_LIMIT = 50
|
||||
|
||||
DEFAULT_DRIVES = get_default_cdrom_drives()
|
||||
|
||||
DEFAULT_CA_NEVER_REPLACE_TYPE_INCLUDE = ['front']
|
||||
DEFAULT_CA_NEVER_REPLACE_TYPE_EXCLUDE = ['matrix/runout', 'raw/unedited', 'watermark']
|
||||
DEFAULT_CA_NEVER_REPLACE_TYPE_INCLUDE = ('front',)
|
||||
DEFAULT_CA_NEVER_REPLACE_TYPE_EXCLUDE = ('matrix/runout', 'raw/unedited', 'watermark')
|
||||
DEFAULT_CA_PROVIDERS = [
|
||||
('Cover Art Archive', True),
|
||||
('UrlRelationships', True),
|
||||
|
||||
@@ -39,9 +39,9 @@ from picard.extension_points.cover_art_processors import (
|
||||
from picard.util.imageinfo import IdentificationError
|
||||
|
||||
|
||||
def run_image_filters(data, info, album, coverartimage):
|
||||
def run_image_filters(data, image_info, album, coverartimage):
|
||||
for f in ext_point_cover_art_filters:
|
||||
if not f(data, info, album, coverartimage):
|
||||
if not f(data, image_info, album, coverartimage):
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -53,13 +53,13 @@ def run_image_metadata_filters(metadata):
|
||||
return True
|
||||
|
||||
|
||||
def run_image_processors(coverartimage, data, info):
|
||||
def run_image_processors(coverartimage, data, image_info):
|
||||
config = get_config()
|
||||
tags_data = data
|
||||
file_data = data
|
||||
try:
|
||||
start_time = time.time()
|
||||
image = ProcessingImage(data, info)
|
||||
image = ProcessingImage(data, image_info)
|
||||
both_queue, tags_queue, file_queue = get_cover_art_processors()
|
||||
for processor in both_queue:
|
||||
processor.run(image, ProcessingTarget.BOTH)
|
||||
|
||||
@@ -45,8 +45,8 @@ def _check_threshold_size(width, height):
|
||||
return True
|
||||
|
||||
|
||||
def size_filter(data, info, album, coverartimage):
|
||||
return _check_threshold_size(info.width, info.height)
|
||||
def size_filter(data, image_info, album, coverartimage):
|
||||
return _check_threshold_size(image_info.width, image_info.height)
|
||||
|
||||
|
||||
def size_metadata_filter(metadata):
|
||||
@@ -55,20 +55,20 @@ def size_metadata_filter(metadata):
|
||||
return _check_threshold_size(metadata['width'], metadata['height'])
|
||||
|
||||
|
||||
def bigger_previous_image_filter(data, info, album, coverartimage):
|
||||
def bigger_previous_image_filter(data, image_info, album, coverartimage):
|
||||
config = get_config()
|
||||
if config.setting['dont_replace_with_smaller_cover'] and config.setting['save_images_to_tags']:
|
||||
downloaded_types = coverartimage.normalized_types()
|
||||
previous_images = album.orig_metadata.images.get_types_dict()
|
||||
if downloaded_types in previous_images:
|
||||
previous_image = previous_images[downloaded_types]
|
||||
if info.width < previous_image.width or info.height < previous_image.height:
|
||||
if image_info.width < previous_image.width or image_info.height < previous_image.height:
|
||||
log.debug("Discarding cover art. A bigger image with the same types is already embedded.")
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
def image_types_filter(data, info, album, coverartimage):
|
||||
def image_types_filter(data, image_info, album, coverartimage):
|
||||
config = get_config()
|
||||
if config.setting['dont_replace_cover_of_types'] and config.setting['save_images_to_tags']:
|
||||
downloaded_types = set(coverartimage.normalized_types())
|
||||
|
||||
Reference in New Issue
Block a user