MCPcopy
hub / github.com/beetbox/beets / set_fields

Method set_fields

beets/importer/tasks.py:765–778  ·  view source on GitHub ↗

Sets the fields given at CLI or configuration to the specified values, for the singleton item.

(self, lib: library.Library)

Source from the content-addressed store, hash-verified

763 self.item.load()
764
765 def set_fields(self, lib: library.Library) -> None:
766 """Sets the fields given at CLI or configuration to the specified
767 values, for the singleton item.
768 """
769 for field, view in config["import"]["set_fields"].items():
770 value = str(view.get())
771 log.debug(
772 "Set field {}={} for {}",
773 field,
774 value,
775 util.displayable_path(self.paths),
776 )
777 self.item.set_parse(field, format(self.item, value))
778 self.item.store()
779
780
781# FIXME The inheritance relationships are inverted. This is why there

Callers

nothing calls this directly

Calls 5

set_parseMethod · 0.80
itemsMethod · 0.45
getMethod · 0.45
debugMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected