diff --git a/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx b/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx index 6668fef1f..8acd58eca 100644 --- a/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx +++ b/web/apps/photos/src/components/Sidebar/AdvancedSettings.tsx @@ -14,7 +14,7 @@ import { EnteMenuItem } from "components/Menu/EnteMenuItem"; import { MenuItemGroup } from "components/Menu/MenuItemGroup"; import isElectron from "is-electron"; import { AppContext } from "pages/_app"; -import { ClipExtractionStatus, ClipService } from "services/clipService"; +import { ClipExtractionStatus, clipService } from "services/clip-service"; import { formatNumber } from "utils/number/format"; export default function AdvancedSettings({ open, onClose, onRootClose }) { @@ -51,8 +51,8 @@ export default function AdvancedSettings({ open, onClose, onRootClose }) { useEffect(() => { const main = async () => { - setIndexingStatus(await ClipService.getIndexingStatus()); - ClipService.setOnUpdateHandler(setIndexingStatus); + setIndexingStatus(await clipService.getIndexingStatus()); + clipService.setOnUpdateHandler(setIndexingStatus); }; main(); }, []); diff --git a/web/apps/photos/src/pages/gallery/index.tsx b/web/apps/photos/src/pages/gallery/index.tsx index 69b833802..b772771c4 100644 --- a/web/apps/photos/src/pages/gallery/index.tsx +++ b/web/apps/photos/src/pages/gallery/index.tsx @@ -102,7 +102,7 @@ import { } from "constants/collection"; import { SYNC_INTERVAL_IN_MICROSECONDS } from "constants/gallery"; import { AppContext } from "pages/_app"; -import { ClipService } from "services/clipService"; +import { clipService } from "services/clip-service"; import { constructUserIDToEmailMap } from "services/collectionService"; import downloadManager from "services/download"; import { syncEmbeddings } from "services/embeddingService"; @@ -362,7 +362,7 @@ export default function Gallery() { syncWithRemote(false, true); }, SYNC_INTERVAL_IN_MICROSECONDS); if (electron) { - void ClipService.setupOnFileUploadListener(); + void clipService.setupOnFileUploadListener(); electron.registerForegroundEventListener(() => { syncWithRemote(false, true); }); @@ -373,7 +373,7 @@ export default function Gallery() { clearInterval(syncInterval.current); if (electron) { electron.registerForegroundEventListener(() => {}); - ClipService.removeOnFileUploadListener(); + clipService.removeOnFileUploadListener(); } }; }, []); @@ -704,8 +704,8 @@ export default function Gallery() { await syncEntities(); await syncMapEnabled(); await syncEmbeddings(); - if (ClipService.isPlatformSupported()) { - void ClipService.scheduleImageEmbeddingExtraction(); + if (clipService.isPlatformSupported()) { + void clipService.scheduleImageEmbeddingExtraction(); } } catch (e) { switch (e.message) { diff --git a/web/apps/photos/src/services/clipService.ts b/web/apps/photos/src/services/clip-service.ts similarity index 99% rename from web/apps/photos/src/services/clipService.ts rename to web/apps/photos/src/services/clip-service.ts index a51af80fd..a2f2300d4 100644 --- a/web/apps/photos/src/services/clipService.ts +++ b/web/apps/photos/src/services/clip-service.ts @@ -403,7 +403,7 @@ class ClipServiceImpl { }; } -export const ClipService = new ClipServiceImpl(); +export const clipService = new ClipServiceImpl(); const getNonClipEmbeddingExtractedFiles = async ( files: EnteFile[], diff --git a/web/apps/photos/src/services/searchService.ts b/web/apps/photos/src/services/searchService.ts index 692b4ac84..8e0e0680c 100644 --- a/web/apps/photos/src/services/searchService.ts +++ b/web/apps/photos/src/services/searchService.ts @@ -22,7 +22,7 @@ import { getAllPeople } from "utils/machineLearning"; import { getMLSyncConfig } from "utils/machineLearning/config"; import { getFormattedDate } from "utils/search"; import mlIDbStorage from "utils/storage/mlIDbStorage"; -import { ClipService, computeClipMatchScore } from "./clipService"; +import { clipService, computeClipMatchScore } from "./clip-service"; import { getLocalEmbeddings } from "./embeddingService"; import { getLatestEntities } from "./entityService"; import locationSearchService, { City } from "./locationSearchService"; @@ -305,7 +305,7 @@ async function getThingSuggestion(searchPhrase: string): Promise { async function getClipSuggestion(searchPhrase: string): Promise { try { - if (!ClipService.isPlatformSupported()) { + if (!clipService.isPlatformSupported()) { return null; } @@ -397,7 +397,7 @@ async function searchThing(searchPhrase: string) { async function searchClip(searchPhrase: string): Promise { const imageEmbeddings = await getLocalEmbeddings(Model.ONNX_CLIP); - const textEmbedding = await ClipService.getTextEmbedding(searchPhrase); + const textEmbedding = await clipService.getTextEmbedding(searchPhrase); const clipSearchResult = new Map( ( await Promise.all(