sane-tag-music: better log formatting when moving a file
This commit is contained in:
@@ -848,13 +848,19 @@ class Tagger:
|
|||||||
if new_path == file_.path_:
|
if new_path == file_.path_:
|
||||||
return self.skip_unchanged(file_.path_, tags)
|
return self.skip_unchanged(file_.path_, tags)
|
||||||
|
|
||||||
|
self.show_pathdif(file_.path_, new_path)
|
||||||
|
|
||||||
if self.confirm():
|
if self.confirm():
|
||||||
if self.guard_dry_run(f"moving file: {file_.path_} -> {new_path}"):
|
if self.guard_dry_run(f"moving file"):
|
||||||
logger.info(f"moving file: {file_.path_} -> {new_path}")
|
|
||||||
assert not os.path.exists(new_path), f"{file_.path_} -> {new_path} would clobber destination!"
|
assert not os.path.exists(new_path), f"{file_.path_} -> {new_path} would clobber destination!"
|
||||||
# os.renames creates the necessary parents, and then prunes leaf directories
|
# os.renames creates the necessary parents, and then prunes leaf directories
|
||||||
os.renames(file_.path_, new_path)
|
os.renames(file_.path_, new_path)
|
||||||
|
|
||||||
|
def show_pathdif(self, old_path: str, new_path: str):
|
||||||
|
logger.info( "updating path:")
|
||||||
|
logger.info(f" {old_path}")
|
||||||
|
logger.info(f" -> {new_path}")
|
||||||
|
|
||||||
def show_tagdif(self, path_: str, old_tags: Tags, new_tags: Tags):
|
def show_tagdif(self, path_: str, old_tags: Tags, new_tags: Tags):
|
||||||
logger.info(f"updating tags for {path_}")
|
logger.info(f"updating tags for {path_}")
|
||||||
logger.info(f" {old_tags}")
|
logger.info(f" {old_tags}")
|
||||||
|
Reference in New Issue
Block a user