fixed a bug on the config & now backend does use config values

This commit is contained in:
2026-01-01 18:12:27 +01:00
parent 01ae038a8b
commit 74f6c9bf62
5 changed files with 54 additions and 15 deletions

View File

@@ -3,6 +3,7 @@ import * as animeService from './anime.service';
import { setActivity } from '../rpc/rp.service';
import { upsertListEntry } from '../list/list.service';
import {getExtension} from '../../shared/extensions';
import { getConfig as loadConfig } from '../../shared/config';
import {Anime, AnimeRequest, SearchRequest, WatchStreamRequest} from '../types';
import {spawn} from "node:child_process";
import net from 'net';
@@ -138,6 +139,10 @@ export async function openInMPV(req: any, reply: any) {
);
const pipe = `\\\\.\\pipe\\mpv-${Date.now()}`;
const { values } = loadConfig();
const MPV_PATH =
values.paths?.mpv || 'mpv';
let chaptersArg: string[] = [];
if (chapters.length) {
@@ -178,8 +183,12 @@ export async function openInMPV(req: any, reply: any) {
chaptersArg = [`--chapters-file=${chaptersFile}`];
}
if (!MPV_PATH) {
return { error: 'MPV_NOT_CONFIGURED' };
}
spawn(
'D:\\mpv\\mpv.exe',
MPV_PATH,
[
'--force-window=yes',
'--idle=yes',

View File

@@ -7,8 +7,10 @@ import fs from 'fs';
import path from 'path';
import AdmZip from 'adm-zip';
import { spawn } from 'child_process';
const { values } = loadConfig();
const FFMPEG_PATH = 'D:\\ffmpeg\\bin\\ffmpeg.exe';
const FFMPEG_PATH =
values.paths?.ffmpeg || 'ffmpeg';
type AnimeDownloadParams = {
anilistId: number;