Add music transfer hash-check todo

master
Jordan Atwood 2 years ago
parent 3e3a2e391b
commit f9fbeab7a8
Signed by: nightfirecat
GPG Key ID: 615A619C2D73A6DF
  1. 2
      src/.bin/music-transfer.py

@ -95,6 +95,8 @@ for file in source_files:
print('[DEBUG] Filtering files already present in destination') 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 # 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` # 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)[:]: 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) 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: if found_destination_path:

Loading…
Cancel
Save