Skip to content

Commit

Permalink
fix: attempt audio transcription server fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aexshafii committed Sep 18, 2024
1 parent 8beaee1 commit 7a748f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
5 changes: 4 additions & 1 deletion audio-transcription-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import dotenv from "dotenv";
import express, { Request, Response, NextFunction } from "express";
import multer from "multer";
import fs from "fs";
import path from 'path';
import cors from "cors";
import { createClient } from "@deepgram/sdk";
import { Readable } from "stream";
Expand All @@ -20,7 +21,9 @@ const storage = multer.diskStorage({
file: Express.Multer.File,
cb: (error: Error | null, destination: string) => void
) {
cb(null, "uploads/");
const uploadDir = path.join(__dirname, '..', 'uploads');
fs.mkdirSync(uploadDir, { recursive: true });
cb(null, uploadDir);
},
filename: function (
req: Express.Request,
Expand Down
22 changes: 11 additions & 11 deletions plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ export default class FileOrganizer extends Plugin {
formData.append("fileExtension", fileExtension);
// const newServerUrl = "http://localhost:3001/transcribe";
const newServerUrl =
"https://file-organizer-2000-production.up.railway.app/transcribe";
"https://file-organizer-2000-x.onrender.com/transcribe";
const response = await fetch(newServerUrl, {
method: "POST",
body: formData,
Expand Down Expand Up @@ -977,18 +977,18 @@ export default class FileOrganizer extends Plugin {
return [];
}

// Generate popular tags and select from them
return await generateTagsRouter(
content,
fileName,
tags,
this.settings.usePro,
this.getServerUrl(),
this.settings.API_KEY
);
// Generate popular tags and select from them
return await generateTagsRouter(
content,
fileName,
tags,
this.settings.usePro,
this.getServerUrl(),
this.settings.API_KEY
);
}

async getAllVaultTags(): Promise<string[]> {
async getAllVaultTags(): Promise<string[]> {
// Fetch all tags from the vault
// @ts-ignore
const tags: TagCounts = this.app.metadataCache.getTags();
Expand Down

0 comments on commit 7a748f6

Please sign in to comment.