mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-24 23:59:45 +02:00
feat: Remove OCR Support (#2838)
* remove ocr package * remove tesseract * remove OCR from app * remove OCR from tests * fix docs
This commit is contained in:
parent
c48680374d
commit
ca9f66ee24
34 changed files with 29 additions and 1570 deletions
|
@ -1,16 +0,0 @@
|
|||
import { BaseAPI } from "../base/base-clients";
|
||||
|
||||
const prefix = "/api";
|
||||
|
||||
export class OcrAPI extends BaseAPI {
|
||||
// Currently unused in favor for the endpoint using asset names
|
||||
async fileToTsv(file: File) {
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
return await this.requests.post(`${prefix}/ocr/file-to-tsv`, formData);
|
||||
}
|
||||
|
||||
async assetToTsv(recipeSlug: string, assetName: string) {
|
||||
return await this.requests.post(`${prefix}/ocr/asset-to-tsv`, { recipeSlug, assetName });
|
||||
}
|
||||
}
|
|
@ -38,7 +38,6 @@ const routes = {
|
|||
recipesCategory: `${prefix}/recipes/category`,
|
||||
recipesParseIngredient: `${prefix}/parser/ingredient`,
|
||||
recipesParseIngredients: `${prefix}/parser/ingredients`,
|
||||
recipesCreateFromOcr: `${prefix}/recipes/create-ocr`,
|
||||
recipesTimelineEvent: `${prefix}/recipes/timeline/events`,
|
||||
|
||||
recipesRecipeSlug: (recipe_slug: string) => `${prefix}/recipes/${recipe_slug}`,
|
||||
|
@ -159,15 +158,6 @@ export class RecipeAPI extends BaseCRUDAPI<CreateRecipe, Recipe, Recipe> {
|
|||
return `${routes.recipesRecipeSlugExportZip(recipeSlug)}?token=${token}`;
|
||||
}
|
||||
|
||||
async createFromOcr(file: File, makeFileRecipeImage: boolean) {
|
||||
const formData = new FormData();
|
||||
formData.append("file", file);
|
||||
formData.append("extension", file.name.split(".").pop() ?? "");
|
||||
formData.append("makefilerecipeimage", String(makeFileRecipeImage));
|
||||
|
||||
return await this.requests.post(routes.recipesCreateFromOcr, formData);
|
||||
}
|
||||
|
||||
async updateLastMade(recipeSlug: string, timestamp: string) {
|
||||
return await this.requests.patch<Recipe, RecipeLastMade>(routes.recipesSlugLastMade(recipeSlug), { timestamp })
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue