mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-16 20:54:00 +00:00
Move code from _update_imagelist_state() to metadataitem_update_metadata_images()
This commit is contained in:
@@ -238,10 +238,24 @@ class MetadataItem(Item):
|
||||
|
||||
return changed
|
||||
|
||||
def _update_imagelist_state(self, state):
|
||||
def metadataitem_update_metadata_images(self):
|
||||
"""Update the metadata images of the current object based on its children.
|
||||
|
||||
Based on the type of the current object, this will update `self.metadata.images` to
|
||||
represent the metadata images of all children (`Track` or `File` objects).
|
||||
|
||||
This method will iterate over all children and completely rebuild
|
||||
`self.metadata.images`. Whenever possible the more specific functions
|
||||
`add_metadata_images` or `remove_metadata_images` should be used.
|
||||
|
||||
Returns:
|
||||
bool: True, if images where changed, False otherwise
|
||||
"""
|
||||
from picard.track import Track
|
||||
from picard.util.imagelist import ImageList
|
||||
|
||||
state = self._get_imagelist_state()
|
||||
|
||||
changed = False
|
||||
for src_obj in state.sources:
|
||||
state.process_images(src_obj, Track)
|
||||
@@ -260,21 +274,6 @@ class MetadataItem(Item):
|
||||
|
||||
return changed
|
||||
|
||||
def metadataitem_update_metadata_images(self):
|
||||
"""Update the metadata images of the current object based on its children.
|
||||
|
||||
Based on the type of the current object, this will update `self.metadata.images` to
|
||||
represent the metadata images of all children (`Track` or `File` objects).
|
||||
|
||||
This method will iterate over all children and completely rebuild
|
||||
`self.metadata.images`. Whenever possible the more specific functions
|
||||
`add_metadata_images` or `remove_metadata_images` should be used.
|
||||
|
||||
Returns:
|
||||
bool: True, if images where changed, False otherwise
|
||||
"""
|
||||
return self._update_imagelist_state(self._get_imagelist_state())
|
||||
|
||||
|
||||
class FileListItem(MetadataItem):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user