Version 543 quick fix

Pumping the brakes on this call, which is dumping out regularly IRL
This commit is contained in:
Hydrus Network Developer 2023-09-13 14:05:57 -05:00
parent 5aaeecefd3
commit b840d0778c
No known key found for this signature in database
GPG Key ID: 76249F053212133C
2 changed files with 25 additions and 19 deletions

View File

@ -2597,10 +2597,10 @@ class DB( HydrusDB.HydrusDB ):
):
boned_stats = {}
HydrusData.ShowText( '1' )
( num_total, size_total ) = self._Execute( f'SELECT COUNT( hash_id ), SUM( size ) FROM {files_table_name} CROSS JOIN files_info USING ( hash_id );' ).fetchone()
( num_inbox, size_inbox ) = self._Execute( f'SELECT COUNT( hash_id ), SUM( size ) FROM {files_table_name} CROSS JOIN file_inbox USING ( hash_id ) CROSS JOIN files_info USING ( hash_id );' ).fetchone()
HydrusData.ShowText( '2' )
if size_total is None:
size_total = 0
@ -2631,7 +2631,7 @@ class DB( HydrusDB.HydrusDB ):
boned_stats[ 'num_deleted' ] = num_deleted
boned_stats[ 'size_deleted' ] = size_deleted
HydrusData.ShowText( '3' )
if job_key.IsCancelled():
return boned_stats
@ -2659,7 +2659,7 @@ class DB( HydrusDB.HydrusDB ):
earliest_import_time = result[0]
HydrusData.ShowText( '4' )
if job_key.IsCancelled():
return boned_stats
@ -2690,7 +2690,7 @@ class DB( HydrusDB.HydrusDB ):
HydrusData.ShowText( '5' )
if earliest_import_time > 0:
boned_stats[ 'earliest_import_time' ] = earliest_import_time
@ -2727,35 +2727,40 @@ class DB( HydrusDB.HydrusDB ):
return boned_stats
HydrusData.ShowText( '6' )
#
total_alternate_files = sum( ( count for ( alternates_group_id, count ) in self._Execute( f'SELECT alternates_group_id, COUNT( * ) FROM {files_table_name} CROSS JOIN duplicate_file_members USING ( hash_id ) CROSS JOIN alternate_file_group_members USING ( media_id ) GROUP BY alternates_group_id;' ) if count > 1 ) )
if job_key.IsCancelled():
return boned_stats
HydrusData.ShowText( '7' )
total_duplicate_files = sum( ( count for ( media_id, count ) in self._Execute( f'SELECT media_id, COUNT( * ) FROM {files_table_name} CROSS JOIN duplicate_file_members USING ( hash_id ) GROUP BY media_id;' ) if count > 1 ) )
boned_stats[ 'total_alternate_files' ] = total_alternate_files
if job_key.IsCancelled():
return boned_stats
HydrusData.ShowText( '8' )
total_duplicate_files = sum( ( count for ( media_id, count ) in self._Execute( f'SELECT media_id, COUNT( * ) FROM {files_table_name} CROSS JOIN duplicate_file_members USING ( hash_id ) GROUP BY media_id;' ) if count > 1 ) )
boned_stats[ 'total_duplicate_files' ] = total_duplicate_files
if job_key.IsCancelled():
return boned_stats
return boned_stats
# TODO: fix this, it takes ages sometimes IRL
table_join = self.modules_files_duplicates.GetPotentialDuplicatePairsTableJoinOnSearchResults( db_location_context, files_table_name, CC.SIMILAR_FILES_PIXEL_DUPES_ALLOWED, max_hamming_distance = 8 )
( total_potential_pairs, ) = self._Execute( f'SELECT COUNT( * ) FROM ( SELECT DISTINCT smaller_media_id, larger_media_id FROM {table_join} );' ).fetchone()
boned_stats[ 'total_potential_pairs' ] = total_potential_pairs
if job_key.IsCancelled():
return boned_stats
HydrusData.ShowText( '9' )
boned_stats[ 'total_alternate_files' ] = total_alternate_files
boned_stats[ 'total_duplicate_files' ] = total_duplicate_files
boned_stats[ 'total_potential_pairs' ] = total_potential_pairs
return boned_stats

View File

@ -2969,9 +2969,10 @@ class ReviewHowBonedAmI( ClientGUIScrolledPanels.ReviewPanel ):
total_alternate_files = boned_stats[ 'total_alternate_files' ]
total_duplicate_files = boned_stats[ 'total_duplicate_files' ]
total_potential_pairs = boned_stats[ 'total_potential_pairs' ]
#total_potential_pairs = boned_stats[ 'total_potential_pairs' ]
potentials_label = f'Total duplicate potential pairs: {HydrusData.ToHumanInt( total_potential_pairs )}'
#potentials_label = f'Total duplicate potential pairs: {HydrusData.ToHumanInt( total_potential_pairs )}'
potentials_label = f'Total duplicate potential pairs: disabled for now'
duplicates_label = f'Total files set duplicate: {HydrusData.ToHumanInt( total_duplicate_files )}'
alternates_label = f'Total duplicate file groups set alternate: {HydrusData.ToHumanInt( total_alternate_files )}'