fixed design and ffmpeg input for dev

This commit is contained in:
Daniel Haller 2024-04-30 18:14:44 +02:00
parent ddb9c4e73c
commit 697c6cb803
6 changed files with 20 additions and 5 deletions

View File

@ -24,6 +24,7 @@
"@pinia/nuxt": "^0.4.11", "@pinia/nuxt": "^0.4.11",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
"concurrently": "^8.2.2", "concurrently": "^8.2.2",
"dotenv": "^16.4.5",
"electron": "^30.0.1", "electron": "^30.0.1",
"electron-builder": "^24.13.3", "electron-builder": "^24.13.3",
"eslint": "^8.57.0", "eslint": "^8.57.0",

View File

@ -55,8 +55,10 @@
<div class="text-xs uppercase">{{ p.format }}</div> <div class="text-xs uppercase">{{ p.format }}</div>
<div class="text-xs">Dubs: {{ p.dub.map((t) => t.name).join(', ') }}</div> <div class="text-xs">Dubs: {{ p.dub.map((t) => t.name).join(', ') }}</div>
<div class="text-xs">Subs: {{ p.sub.length !== 0 ? p.sub.map((t) => t.name).join(', ') : '-' }}</div> <div class="text-xs">Subs: {{ p.sub.length !== 0 ? p.sub.map((t) => t.name).join(', ') : '-' }}</div>
<div v-if="p.partsleft && p.status === 'downloading'" class="text-xs ml-auto">{{ p.partsdownloaded }}/{{ p.partsleft }}</div> <div class="flex flex-col ml-auto gap-0.5">
<div v-if="p.downloadspeed && p.status === 'downloading'" class="text-xs">{{ p.downloadspeed }} MB/s</div> <div v-if="p.partsleft && p.status === 'downloading'" class="text-xs ml-auto">{{ p.partsdownloaded }}/{{ p.partsleft }}</div>
<div v-if="p.downloadspeed && p.status === 'downloading'" class="text-xs">{{ p.downloadspeed }} MB/s</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -68,7 +70,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { ADNEpisode } from '~/components/ADN/Types' import type { ADNEpisode } from '~/components/ADN/Types'
import type { CrunchyEpisode } from '~/components/Episode/Types' import type { CrunchyEpisode } from '~/components/Episode/Types'
import Updater from '~/components/Updater.vue'; import Updater from '~/components/Updater.vue'
const playlist = ref< const playlist = ref<
Array<{ Array<{

3
pnpm-lock.yaml generated
View File

@ -84,6 +84,9 @@ importers:
concurrently: concurrently:
specifier: ^8.2.2 specifier: ^8.2.2
version: 8.2.2 version: 8.2.2
dotenv:
specifier: ^16.4.5
version: 16.4.5
electron: electron:
specifier: ^30.0.1 specifier: ^30.0.1
version: 30.0.1 version: 30.0.1

View File

@ -638,6 +638,7 @@ async function mergeParts(parts: { filename: string; url: string }[], downloadID
await concatenateTSFiles(list, concatenatedFile) await concatenateTSFiles(list, concatenatedFile)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!ffmpegP.ffmpeg || !ffmpegP.ffprobe) return
Ffmpeg() Ffmpeg()
.setFfmpegPath(ffmpegP.ffmpeg) .setFfmpegPath(ffmpegP.ffmpeg)
.setFfprobePath(ffmpegP.ffprobe) .setFfprobePath(ffmpegP.ffprobe)
@ -684,6 +685,7 @@ async function mergeVideoFile(video: string, audios: Array<string>, subs: Array<
] ]
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!ffmpegP.ffmpeg || !ffmpegP.ffprobe) return
var output = Ffmpeg().setFfmpegPath(ffmpegP.ffmpeg).setFfprobePath(ffmpegP.ffprobe) var output = Ffmpeg().setFfmpegPath(ffmpegP.ffmpeg).setFfprobePath(ffmpegP.ffprobe)
var ffindex = 1 var ffindex = 1
output.addInput(video) output.addInput(video)

View File

@ -70,6 +70,7 @@ async function mergePartsAudio(parts: { filename: string; url: string }[], tmp:
await concatenateTSFiles(list, concatenatedFile) await concatenateTSFiles(list, concatenatedFile)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
if (!ffmpegP.ffmpeg || !ffmpegP.ffprobe) return
Ffmpeg() Ffmpeg()
.setFfmpegPath(ffmpegP.ffmpeg) .setFfmpegPath(ffmpegP.ffmpeg)
.setFfprobePath(ffmpegP.ffprobe) .setFfprobePath(ffmpegP.ffprobe)

View File

@ -5,11 +5,17 @@ const isDev = process.env.NODE_ENV === 'development'
const appPath = app.getAppPath() const appPath = app.getAppPath()
const resourcesPath = path.dirname(appPath) const resourcesPath = path.dirname(appPath)
const ffmpegPath = path.join(resourcesPath, 'ffmpeg') const ffmpegPath = path.join(resourcesPath, 'ffmpeg')
if (isDev) {
require('dotenv').config()
}
export function getFFMPEGPath() { export function getFFMPEGPath() {
if (isDev) { if (isDev) {
const ffmpeg = '../../../ffmpeg/ffmpeg.exe' const ffmpeg = process.env.FFMPEG_PATH
const ffprobe = '../../../ffmpeg/ffprobe.exe' const ffprobe = process.env.FFPROBE_PATH
console.log(ffmpeg)
console.log(ffprobe)
return { ffmpeg: ffmpeg, ffprobe: ffprobe } return { ffmpeg: ffmpeg, ffprobe: ffprobe }
} else { } else {