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
)
| 664 | |
| 665 | |
| 666 | def 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() |
no test coverage detected