enable clip for windows (#1436)
This commit is contained in:
commit
d8d71557da
|
@ -722,7 +722,7 @@ export default function Gallery() {
|
|||
await syncTrash(collections, setTrashedFiles);
|
||||
await syncEntities();
|
||||
await syncMapEnabled();
|
||||
if (await ClipService.isClipSupported()) {
|
||||
if (isElectron()) {
|
||||
await syncEmbeddings();
|
||||
void ClipService.scheduleImageEmbeddingExtraction();
|
||||
}
|
||||
|
|
|
@ -49,8 +49,7 @@ class ClipServiceImpl {
|
|||
|
||||
setupOnFileUploadListener = async () => {
|
||||
try {
|
||||
const isClipSupported = await this.isClipSupported();
|
||||
if (!isClipSupported) {
|
||||
if (!isElectron()) {
|
||||
return;
|
||||
}
|
||||
if (this.onFileUploadedHandler) {
|
||||
|
@ -98,14 +97,6 @@ class ClipServiceImpl {
|
|||
}
|
||||
};
|
||||
|
||||
isClipSupported = async () => {
|
||||
if (!isElectron()) {
|
||||
return false;
|
||||
}
|
||||
const platform = await ElectronAPIs.getPlatform();
|
||||
return platform !== 'windows';
|
||||
};
|
||||
|
||||
setOnUpdateHandler = (handler: (status: ClipExtractionStatus) => void) => {
|
||||
this.onUpdateHandler = handler;
|
||||
handler(this.clipExtractionStatus);
|
||||
|
|
|
@ -32,6 +32,7 @@ import {
|
|||
computeClipMatchScore,
|
||||
getLocalClipImageEmbeddings,
|
||||
} from './clipService';
|
||||
import isElectron from 'is-electron';
|
||||
|
||||
const DIGITS = new Set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']);
|
||||
|
||||
|
@ -290,7 +291,7 @@ async function getThingSuggestion(searchPhrase: string): Promise<Suggestion[]> {
|
|||
}
|
||||
|
||||
async function getClipSuggestion(searchPhrase: string): Promise<Suggestion> {
|
||||
if (!(await ClipService.isClipSupported())) {
|
||||
if (!isElectron()) {
|
||||
return null;
|
||||
}
|
||||
const clipResults = await searchClip(searchPhrase);
|
||||
|
|
Loading…
Reference in a new issue