From e6acaab45e6dddc47ebfcc47547037fdcbb49564 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Mon, 12 Oct 2015 22:09:06 +0200 Subject: [PATCH] Convert the song only if necessary --- patacrep/songs/convert/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patacrep/songs/convert/__main__.py b/patacrep/songs/convert/__main__.py index a6766452..0620ecf6 100644 --- a/patacrep/songs/convert/__main__.py +++ b/patacrep/songs/convert/__main__.py @@ -57,12 +57,12 @@ if __name__ == "__main__": for file in song_files: song = song_parsers[source]("", file, DEFAULT_CONFIG) try: - converted = song.render(dest) destname = "{}.{}".format(".".join(file.split(".")[:-1]), dest) if os.path.exists(destname) and not remember: overwrite, remember = confirm(destname) if not overwrite: continue + converted = song.render(dest) with open(destname, "w") as destfile: destfile.write(converted)