Skip to content

Commit

Permalink
Order by the field(s) used to find duplicates
Browse files Browse the repository at this point in the history
When searching for duplicates, also sort the results by the
fields used to find the duplicates.
  • Loading branch information
samwilson committed Aug 10, 2018
1 parent 35e7b79 commit 6890c7b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions admin/batch_manager_global.php
Expand Up @@ -658,10 +658,25 @@
$is_category = true;
}

// If using the 'duplicates' filter,
// order by the fields that are used to find duplicates.
if (isset($_SESSION['bulk_manager_filter']['prefilter'])
and 'duplicates' == $_SESSION['bulk_manager_filter']['prefilter'])
and 'duplicates' === $_SESSION['bulk_manager_filter']['prefilter'])
{
$conf['order_by'] = ' ORDER BY file, id';
$order_by = array( 'file', 'id' );
if (isset($_SESSION['bulk_manager_filter']['duplicates_checksum']))
{
array_unshift( $order_by, 'md5sum');
}
if (isset($_SESSION['bulk_manager_filter']['duplicates_date']))
{
array_unshift( $order_by, 'date_creation');
}
if (isset($_SESSION['bulk_manager_filter']['duplicates_dimensions']))
{
array_unshift( $order_by, 'width', 'height');
}
$conf['order_by'] = ' ORDER BY '.join(', ', $order_by);
}

$query = '
Expand Down

0 comments on commit 6890c7b

Please sign in to comment.