diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-10-08 09:30:35 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-10-08 09:30:35 +0200 |
commit | b3e77c6773b3033cc6e35098026b850a93c6841b (patch) | |
tree | a4d729f443dbbfb586ef188c76b1b4a00fdaba8b | |
parent | 42741c43857dc3b32f66d9f9b60e259a4780d8b4 (diff) |
add exit message to bulk-audio script
-rwxr-xr-x | bulk-audio/bulk-audio.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bulk-audio/bulk-audio.py b/bulk-audio/bulk-audio.py index 0ef8b71..f3c8ef6 100755 --- a/bulk-audio/bulk-audio.py +++ b/bulk-audio/bulk-audio.py @@ -40,6 +40,8 @@ def main(): model = col.models.by_name(NOTE_TYPE) note_ids = col.models.nids(model) + edited_notes = 0 + for note_index, note_id in enumerate(note_ids): note = col.get_note(note_id) note_index_format = ("{:0" + str(floor(log10(len(note_ids))) + 1) + "d}/{:d}").format(note_index + 1, len(note_ids)) @@ -87,9 +89,14 @@ def main(): note[AUDIO_FIELD_NAME] = audio_str note.flush() print(f"written audio as {audio_str}") + edited_notes += 1 # save collection (and exit) col.save() + if edited_notes == 0: + print("-- Done: no edits --") + else: + print(f"-- Done: succesfully edited {edited_notes} note{'' if edited_notes == 1 else 's'} --") # run ./get to get audio data from stdout # returns (exit_code, stdout_data) |