From f9fbeab7a827efbfb84eb58bc8af85afe18d7079 Mon Sep 17 00:00:00 2001 From: Jordan Atwood Date: Mon, 23 Jan 2023 14:22:09 -0800 Subject: [PATCH] Add music transfer hash-check todo --- src/.bin/music-transfer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/.bin/music-transfer.py b/src/.bin/music-transfer.py index 770e570..3aad90f 100755 --- a/src/.bin/music-transfer.py +++ b/src/.bin/music-transfer.py @@ -95,6 +95,8 @@ for file in source_files: print('[DEBUG] Filtering files already present in destination') # NOTE: this assumes all filenames are unique, which should already be the case in my music library # verify via `find . -type f -not -name '*.jpg' -not -name '*.png' -not -name '*.txt' -exec basename {} \; | sort | uniq -d` +# TODO: add a hash check so that we can overwrite songs on the target if source +# has a version which is different (new metadata, or better version) for source_path in list(source_files)[:]: found_destination_path: Union[Path, None] = next((destination_file for destination_file in destination_files if destination_file.stem == munge_path(source_path.stem)), None) if found_destination_path: