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

Function apply_item_changes

beets/plugins.py:666–690  ·  view source on GitHub ↗

Store, move, and write the item according to the arguments. :param lib: beets library. :param item: Item whose changes to apply. :param move: Move the item if it's in the library. :param pretend: Return without moving, writing, or storing the item's metadata. :param writ

(
    lib: Library, item: Item, move: bool, pretend: bool, write: bool
)

Source from the content-addressed store, hash-verified

664
665
666def apply_item_changes(
667 lib: Library, item: Item, move: bool, pretend: bool, write: bool
668) -> None:
669 """Store, move, and write the item according to the arguments.
670
671 :param lib: beets library.
672 :param item: Item whose changes to apply.
673 :param move: Move the item if it's in the library.
674 :param pretend: Return without moving, writing, or storing the item's
675 metadata.
676 :param write: Write the item's metadata to its media file.
677 """
678 if pretend:
679 return
680
681 from beets import util
682
683 # Move the item if it's in the library.
684 if move and lib.directory in util.ancestry(item.path):
685 item.move(with_album=False)
686
687 if write:
688 item.try_write()
689
690 item.store()

Callers 4

singletonsMethod · 0.90
albumsMethod · 0.90
singletonsMethod · 0.90
albumsMethod · 0.90

Calls 3

try_writeMethod · 0.80
moveMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected