If files are cleared from a database that's already been previously searched, the farthest_search_index of each file in the database becomes out-of-date, which can lead to a wide variety of errors, including old files not being searched for duplicates against new files.
The primary work in this code is to make sure that the farthest_search_index is updated whenever files are cleared from the DB. Additional updates have been made to what's printed out by the program, related to this process, to improve general clarity of output.
NOTE: I highly recommend viewing the file changes with the "hide whitespace changes" enabled - it makes for a cleaner viewing experience, particularly in clear_trashed_files_from_db() where most of the changes are just tab indentations.
If files are cleared from a database that's already been previously searched, the
farthest_search_index
of each file in the database becomes out-of-date, which can lead to a wide variety of errors, including old files not being searched for duplicates against new files.The primary work in this code is to make sure that the
farthest_search_index
is updated whenever files are cleared from the DB. Additional updates have been made to what's printed out by the program, related to this process, to improve general clarity of output.NOTE: I highly recommend viewing the file changes with the "hide whitespace changes" enabled - it makes for a cleaner viewing experience, particularly in
clear_trashed_files_from_db()
where most of the changes are just tab indentations.