Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
an-lee committed Nov 28, 2024
1 parent 80a1a5c commit 04a02b5
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 27 deletions.
2 changes: 1 addition & 1 deletion enjoy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
"electron-forge-plugin-dependencies": "^1.0.0",
"electron-log": "^5.2.3",
"electron-playwright-helpers": "^1.7.1",
"electron-settings": "^4.0.4",
"electron-squirrel-startup": "^1.0.1",
"electron-unhandled": "^5.0.0",
"eslint": "^9.15.0",
Expand Down Expand Up @@ -195,6 +194,7 @@
"dependencies": {
"@andrkrn/ffprobe-static": "^5.2.0",
"echogarden": "^1.8.7",
"electron-settings": "^4.0.4",
"ffmpeg-static": "^5.2.0",
"file-type": "^19.6.0",
"fluent-ffmpeg": "^2.1.3",
Expand Down
6 changes: 1 addition & 5 deletions enjoy/src/main/camdict.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import { ipcMain } from "electron";
import path from "path";
import log from "@main/logger";
import url from "url";
import { Sequelize, DataType } from "sequelize-typescript";

const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path
.dirname(__filename)
.replace("app.asar", "app.asar.unpacked");
const __dirname = import.meta.dirname.replace("app.asar", "app.asar.unpacked");

const logger = log.scope("camdict");

Expand Down
4 changes: 1 addition & 3 deletions enjoy/src/main/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ import {
} from "./handlers";
import os from "os";
import path from "path";
import url from "url";
import { i18n } from "@main/i18n";
import { UserSettingKeyEnum } from "@/types/enums";
import log from "@main/logger";
import fs from "fs-extra";

const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const __dirname = import.meta.dirname;
const logger = log.scope("DB");

const db = {
Expand Down
5 changes: 1 addition & 4 deletions enjoy/src/main/echogarden.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ Echogarden.setGlobalOption(
"https://hf-mirror.com/echogarden/echogarden-packages/resolve/main/"
);

const __filename = url.fileURLToPath(import.meta.url);
/*
* sample files will be in /app.asar.unpacked instead of /app.asar
*/
const __dirname = path
.dirname(__filename)
.replace("app.asar", "app.asar.unpacked");
const __dirname = import.meta.dirname.replace("app.asar", "app.asar.unpacked");

const logger = log.scope("echogarden");
class EchogardenWrapper {
Expand Down
5 changes: 1 addition & 4 deletions enjoy/src/main/ffmpeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ import { enjoyUrlToPath, pathToEnjoyUrl } from "@main/utils";
*/
Ffmpeg.setFfmpegPath(ffmpegPath.replace("app.asar", "app.asar.unpacked"));
Ffmpeg.setFfprobePath(ffprobePath.replace("app.asar", "app.asar.unpacked"));
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path
.dirname(__filename)
.replace("app.asar", "app.asar.unpacked");
const __dirname = import.meta.dirname.replace("app.asar", "app.asar.unpacked");

const logger = log.scope("ffmpeg");
export default class FfmpegWrapper {
Expand Down
5 changes: 1 addition & 4 deletions enjoy/src/main/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@ import { REPO_URL, WS_URL } from "@/constants";
import { AudibleProvider, TedProvider, YoutubeProvider } from "@main/providers";
import Ffmpeg from "@main/ffmpeg";
import { Waveform } from "./waveform";
import url from "url";
import echogarden from "./echogarden";
import camdict from "./camdict";
import dict from "./dict";
import mdict from "./mdict";
import decompresser from "./decompresser";
import { UserSetting } from "@main/db/models";
import { platform } from "os";
import { t } from "i18next";

const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const __dirname = import.meta.dirname;

const logger = log.scope("window");

Expand Down
7 changes: 1 addition & 6 deletions enjoy/src/main/youtubedr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ import os from "os";
import log from "@main/logger";
import snakeCase from "lodash/snakeCase";
import settings from "@main/settings";
import url from "url";
import mainWin from "@main/window";

const __filename = url.fileURLToPath(import.meta.url);

// youtubedr bin file will be in /app.asar.unpacked instead of /app.asar
const __dirname = path
.dirname(__filename)
.replace("app.asar", "app.asar.unpacked");
const __dirname = import.meta.dirname.replace("app.asar", "app.asar.unpacked");

const logger = log.scope("YOUTUBEDR");

Expand Down

0 comments on commit 04a02b5

Please sign in to comment.