added default video and audio quality selector, video format

This commit is contained in:
stratuma 2024-06-21 21:22:31 +02:00
parent 5527afa2f3
commit 5712fcc36a
4 changed files with 101 additions and 4 deletions

View File

@ -42,12 +42,13 @@
<script lang="ts" setup>
const selectedLanguage = ref<string>()
const selectedEndpoint = ref<number>()
const selectedVideoQuality = ref<number>()
const selectedAudioQuality = ref<number>()
onMounted(() => {
;(window as any).myAPI.getEndpoint().then((result: any) => {
selectedEndpoint.value = result
})
;(window as any).myAPI.getDefaultCrunchyrollLanguage().then((result: any) => {
selectedLanguage.value = result
})

View File

@ -1,5 +1,5 @@
<template>
<div class="flex flex-col mt-3 gap-3 font-dm" style="-webkit-app-region: no-drag">
<div class="flex flex-col mt-3 gap-3 font-dm overflow-y-scroll h-[calc(100%)]" style="-webkit-app-region: no-drag">
<div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl select-none">
<div class="text-sm mb-2"> Account Management </div>
<div v-for="account in accounts" class="flex flex-row items-center h-12 p-3 w-full bg-[#4b4b4b89] rounded-xl">
@ -44,6 +44,44 @@
</button>
</div>
</div>
<div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl select-none">
<div class="text-sm mb-2">Default Video Quality</div>
<select
v-model="selectedVideoQuality"
@change="selectVideoQuality()"
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center cursor-pointer"
>
<option :value="1080">1080p</option>
<option :value="720">720p</option>
<option :value="480">480p</option>
<option :value="360">360p</option>
<option :value="240">240p</option>
</select>
</div>
<div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl select-none">
<div class="text-sm mb-2">Default Audio Quality</div>
<select
v-model="selectedAudioQuality"
@change="selectAudioQuality()"
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center cursor-pointer"
>
<option :value="1">44.10 kHz</option>
<option :value="2">44.10 kHz (2)</option>
<option :value="3">22.05 kHz</option>
</select>
</div>
<div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl select-none">
<div class="text-sm mb-2">Default Output Format</div>
<select
v-model="selectedVideoFormat"
@change="selectOutputFormat()"
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center cursor-pointer"
>
<option value="mkv">MKV</option>
<option value="mp4">MP4</option>
<option value="untouched" disabled>Untouched</option>
</select>
</div>
</div>
</template>
@ -74,6 +112,10 @@ const locales = ref<Array<{ locale: string; name: string }>>([
{ locale: 'ko-KR', name: 'KO' }
])
const selectedVideoQuality = ref<number>()
const selectedAudioQuality = ref<number>()
const selectedVideoFormat = ref<number>()
const toggleDub = (lang: { locale: string; name: string }) => {
const index = dubLocales.value.findIndex((i) => i.locale === lang.locale)
@ -158,6 +200,24 @@ const deleteAccount = async (id: number) => {
getAccounts()
}
const selectVideoQuality = () => {
if (process.client) {
;(window as any).myAPI.setDefaultVideoQuality(selectedVideoQuality.value)
}
}
const selectAudioQuality = () => {
if (process.client) {
;(window as any).myAPI.setDefaultAudioQuality(selectedAudioQuality.value)
}
}
const selectOutputFormat = () => {
if (process.client) {
;(window as any).myAPI.setDefaultOutputFormat(selectedVideoFormat.value)
}
}
onMounted(() => {
;(window as any).myAPI.getArray('defdubarray').then((result: any) => {
dubLocales.value = JSON.parse(result)
@ -165,6 +225,15 @@ onMounted(() => {
;(window as any).myAPI.getArray('defsubarray').then((result: any) => {
subLocales.value = JSON.parse(result)
})
;(window as any).myAPI.getDefaultVideoQuality().then((result: any) => {
selectedVideoQuality.value = result
})
;(window as any).myAPI.getDefaultAudioQuality().then((result: any) => {
selectedAudioQuality.value = result
})
;(window as any).myAPI.getDefaultOutputFormat().then((result: any) => {
selectedVideoFormat.value = result
})
})
</script>

View File

@ -303,7 +303,7 @@
<select v-model="format" name="format" class="bg-[#5c5b5b] focus:outline-none px-3 py-2 rounded-xl text-sm text-center cursor-pointer">
<option value="mkv" class="text-sm text-slate-200">MKV</option>
<option value="mp4" class="text-sm text-slate-200">MP4</option>
<option value="untouched" class="text-sm text-slate-200">Untouched</option>
<option value="untouched" class="text-sm text-slate-200" disabled>Untouched</option>
</select>
</div>
</div>
@ -550,6 +550,15 @@ onMounted(() => {
subLocales.value = JSON.parse(result)
})
;(window as any).myAPI.getDefaultVideoQuality().then((result: any) => {
quality.value = result
})
;(window as any).myAPI.getDefaultAudioQuality().then((result: any) => {
qualityaudio.value = result
})
;(window as any).myAPI.getDefaultOutputFormat().then((result: any) => {
format.value = result
})
})
const getFolderPath = () => {

View File

@ -1,5 +1,5 @@
<template>
<div class="h-screen bg-[#11111189] flex flex-col p-5 text-white font-dm" style="-webkit-app-region: drag">
<div class="h-screen bg-[#11111189] flex flex-col p-5 text-white font-dm overflow-hidden" style="-webkit-app-region: drag">
<div class="flex flex-row items-center justify-center">
<div class="text-2xl">Settings</div>
</div>
@ -57,4 +57,22 @@ body {
font-weight: 1000;
font-style: normal;
}
::-webkit-scrollbar-track {
background: #383838;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: #cac9c9;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: #555;
}
::-webkit-scrollbar {
width: 8px;
}
</style>