Kaynağa Gözat

Merge branch 'main' into fix-keyboard-navigate-issue

Abhinav Kumar 1 yıl önce
ebeveyn
işleme
896cdd98af

+ 0 - 4
apps/photos/src/components/Search/SearchBar/searchInput/index.tsx

@@ -34,7 +34,6 @@ import { t } from 'i18next';
 import memoize from 'memoize-one';
 import { LocationTagData } from 'types/entity';
 import { FILE_TYPE } from 'constants/file';
-import { addLogLine } from '@ente/shared/logging';
 
 interface Iprops {
     isOpen: boolean;
@@ -70,10 +69,7 @@ export default function SearchInput(props: Iprops) {
     }, []);
 
     async function refreshDefaultOptions() {
-        const t = Date.now();
-        addLogLine('refreshDefaultOptions called');
         const defaultOptions = await getDefaultOptions(props.files);
-        addLogLine(`refreshDefaultOptions end time: ${Date.now() - t}ms`);
         setDefaultOptions(defaultOptions);
     }
 

+ 6 - 2
apps/photos/src/services/deduplicationService.ts

@@ -26,7 +26,11 @@ export async function getDuplicates(
     collectionNameMap: Map<number, string>
 ) {
     try {
-        const dupes = await fetchDuplicateFileIDs();
+        const ascDupes = await fetchDuplicateFileIDs();
+
+        const descSortedDupes = ascDupes.sort((firstDupe, secondDupe) => {
+            return secondDupe.size - firstDupe.size;
+        });
 
         const fileMap = new Map<number, EnteFile>();
         for (const file of files) {
@@ -35,7 +39,7 @@ export async function getDuplicates(
 
         let result: Duplicate[] = [];
 
-        for (const dupe of dupes) {
+        for (const dupe of descSortedDupes) {
             let duplicateFiles: EnteFile[] = [];
             for (const fileID of dupe.fileIDs) {
                 if (fileMap.has(fileID)) {

+ 0 - 2
apps/photos/src/services/searchService.ts

@@ -174,9 +174,7 @@ function getYearSuggestion(searchPhrase: string): Suggestion[] {
 
 export async function getAllPeopleSuggestion(): Promise<Array<Suggestion>> {
     try {
-        addLogLine('getAllPeopleSuggestion called');
         const people = await getAllPeople(200);
-        addLogLine(`found people: ${people?.length ?? 0}`);
         return people.map((person) => ({
             label: person.name,
             type: SuggestionType.PERSON,