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

Method try_sync

beets/library/models.py:974–993  ·  view source on GitHub ↗

Synchronize the item with the database and, possibly, update its tags on disk and its path (by moving the file). `write` indicates whether to write new tags into the file. Similarly, `move` controls whether the path should be updated. In the latter case, files are *o

(self, write, move, with_album=True)

Source from the content-addressed store, hash-verified

972 return False
973
974 def try_sync(self, write, move, with_album=True):
975 """Synchronize the item with the database and, possibly, update its
976 tags on disk and its path (by moving the file).
977
978 `write` indicates whether to write new tags into the file. Similarly,
979 `move` controls whether the path should be updated. In the
980 latter case, files are *only* moved when they are inside their
981 library's directory (if any).
982
983 Similar to calling :meth:`write`, :meth:`move`, and :meth:`store`
984 (conditionally).
985 """
986 if write:
987 self.try_write()
988 if move:
989 # Check whether this file is inside the library directory.
990 if self._db and self._db.directory in util.ancestry(self.path):
991 log.debug("moving {.filepath} to synchronize path", self)
992 self.move(with_album=with_album)
993 self.store()
994
995 # Files themselves.
996

Callers 11

try_syncMethod · 0.45
write_itemsFunction · 0.45
modify_itemsFunction · 0.45
update_tagsMethod · 0.45
build_playlistMethod · 0.45
save_changesMethod · 0.45
import_stageMethod · 0.45
_process_trackMethod · 0.45
_process_albumMethod · 0.45
responderFunction · 0.45

Calls 4

try_writeMethod · 0.95
moveMethod · 0.95
debugMethod · 0.45
storeMethod · 0.45

Tested by 1