@@ -1353,7 +1353,7 @@ def delete_file_wrapper(self,size,crc,index_tuple_set,to_trash,file_callback,crc
1353
1353
1354
1354
def link_wrapper (self ,\
1355
1355
kind ,relative ,size ,crc ,\
1356
- index_tuple_ref ,index_tuple_list ,to_trash ,file_callback = None ,crc_callback = None ):
1356
+ index_tuple_ref ,index_tuple_list ,to_trash ,file_callback ,crc_callback , similarity_mode = False ):
1357
1357
1358
1358
l_info = self .log .info
1359
1359
delete_command = self .delete_file_to_trash if to_trash else self .delete_file
@@ -1363,25 +1363,31 @@ def link_wrapper(self,\
1363
1363
(path_nr_keep ,path_keep ,file_keep ,ctime_keep ,dev_keep ,inode_keep )= index_tuple_ref
1364
1364
1365
1365
self_get_full_path_scanned = self .get_full_path_scanned
1366
- self_files_of_size_of_crc_size_crc = self .files_of_size_of_crc [size ][crc ]
1366
+ #self_files_of_size_of_crc_size_crc = self.files_of_size_of_crc[size][crc]
1367
+
1368
+ if similarity_mode :
1369
+ pool = self .files_of_images_groups [crc ]
1370
+ else :
1371
+ pool = self .files_of_size_of_crc [size ][crc ]
1372
+
1367
1373
1368
1374
self_rename_file = self .rename_file
1369
1375
1370
1376
full_file_path_keep = self_get_full_path_scanned (path_nr_keep ,path_keep ,file_keep )
1371
1377
1372
1378
link_command = (lambda p : self .do_soft_link (full_file_path_keep ,p ,relative ,l_info )) if kind == SOFTLINK else (lambda p : self .do_win_lnk_link (full_file_path_keep ,str (p ) + ".lnk" ,l_info )) if kind == WIN_LNK else (lambda p : self .do_hard_link (full_file_path_keep ,p ,l_info ))
1373
1379
1374
- if index_tuple_ref not in self_files_of_size_of_crc_size_crc :
1375
- return 'link_wrapper - Internal Data Inconsistency:%s / %s' % (full_file_path_keep ,index_tuple_ref )
1380
+ if index_tuple_ref not in pool :
1381
+ return 'link_wrapper - Internal Data Inconsistency (1) :%s / %s' % (full_file_path_keep ,index_tuple_ref )
1376
1382
1377
1383
res = []
1378
1384
tuples_to_remove = set ()
1379
1385
for index_tuple in index_tuple_list :
1380
1386
(pathnr ,path ,file_name ,ctime ,dev ,inode )= index_tuple
1381
1387
full_file_path = self_get_full_path_scanned (pathnr ,path ,file_name )
1382
1388
1383
- if index_tuple not in self_files_of_size_of_crc_size_crc :
1384
- res .append ('link_wrapper - Internal Data Inconsistency:%s / %s' % (full_file_path ,index_tuple ))
1389
+ if index_tuple not in pool :
1390
+ res .append ('link_wrapper - Internal Data Inconsistency (2) :%s / %s' % (full_file_path ,index_tuple ))
1385
1391
break
1386
1392
1387
1393
temp_file = '%s.dude_pre_delete_temp' % full_file_path
0 commit comments