2024-05-23 02:22:58 +02:00
|
|
|
<template>
|
|
|
|
<div class="flex flex-col gap-3 mt-3 font-dm" style="-webkit-app-region: no-drag">
|
2024-06-21 13:54:48 +02:00
|
|
|
<div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl">
|
|
|
|
<div class="text-sm mb-2 select-none">Episode File Naming</div>
|
2024-05-23 02:22:58 +02:00
|
|
|
<input
|
|
|
|
v-model="episodeNamingTemplate"
|
|
|
|
type="text"
|
|
|
|
name="text"
|
|
|
|
placeholder="Episode Naming"
|
|
|
|
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center"
|
|
|
|
/>
|
2024-05-23 23:04:58 +02:00
|
|
|
<div class="text-sm mt-2"> Example: </div>
|
2024-05-23 02:22:58 +02:00
|
|
|
<div class="text-sm">
|
|
|
|
{{ `${episodeNaming}` }}
|
|
|
|
</div>
|
|
|
|
|
2024-06-21 13:54:48 +02:00
|
|
|
<div class="text-sm mt-2 select-none"> Variables: </div>
|
2024-07-05 00:51:02 +02:00
|
|
|
<div class="text-sm text-center"> {seriesName}, {episodeName}, {seasonNumber}, {seasonNumberDD}, {episodeNumber}, {episodeNumberDD}, {episodeID}, {quality} </div>
|
2024-05-23 02:22:58 +02:00
|
|
|
</div>
|
2024-06-21 13:54:48 +02:00
|
|
|
<div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl">
|
|
|
|
<div class="text-sm mb-2 select-none">Season Folder Naming</div>
|
2024-05-23 02:22:58 +02:00
|
|
|
<input
|
|
|
|
v-model="seasonNamingTemplate"
|
|
|
|
type="text"
|
|
|
|
name="text"
|
|
|
|
placeholder="Episode Naming"
|
|
|
|
class="bg-[#5c5b5b] w-full focus:outline-none px-3 py-2 rounded-xl text-sm text-center"
|
|
|
|
/>
|
2024-05-23 23:04:58 +02:00
|
|
|
<div class="text-sm mt-2"> Example: </div>
|
2024-05-23 02:22:58 +02:00
|
|
|
<div class="text-sm">
|
|
|
|
{{ `${seasonNaming}` }}
|
|
|
|
</div>
|
|
|
|
|
2024-06-21 13:54:48 +02:00
|
|
|
<div class="text-sm mt-2 select-none"> Variables: </div>
|
2024-05-23 23:04:58 +02:00
|
|
|
<div class="text-sm text-center"> {seriesName}, {seasonNumber}, {seasonNumberDD}, {quality} </div>
|
2024-06-21 13:54:48 +02:00
|
|
|
<div class="flex flex-row mt-3 select-none">
|
2024-06-20 23:31:21 +02:00
|
|
|
<input v-model="isSeasonActive" @change="setSeasonFolder(isSeasonActive)" type="checkbox" name="Season Folder" class="cursor-pointer" />
|
|
|
|
<div class="text-sm ml-1.5"> Create Season Folder </div>
|
|
|
|
</div>
|
2024-05-23 02:22:58 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2024-05-23 23:04:58 +02:00
|
|
|
const episodeNumber = ref<number>(1)
|
|
|
|
const seasonNumber = ref<number>(1)
|
|
|
|
const quality = ref<number>(1080)
|
|
|
|
const seriesName = ref<string>('Frieren')
|
2024-06-20 21:34:47 +02:00
|
|
|
const episodeName = ref<string>("The Journey's End")
|
2024-07-10 14:20:30 +02:00
|
|
|
const episodeID = ref<string>('G0DUNDOK2')
|
2024-05-23 23:04:58 +02:00
|
|
|
const episodeNamingTemplate = ref<string>()
|
|
|
|
const seasonNamingTemplate = ref<string>()
|
2024-06-20 23:31:21 +02:00
|
|
|
const isSeasonActive = ref<boolean>()
|
2024-05-23 02:22:58 +02:00
|
|
|
|
|
|
|
const episodeNaming = computed(() => {
|
|
|
|
if (!episodeNamingTemplate.value) return
|
|
|
|
return episodeNamingTemplate.value
|
|
|
|
.replace('{seriesName}', seriesName.value)
|
2024-06-20 21:34:47 +02:00
|
|
|
.replace('{episodeName}', episodeName.value)
|
2024-05-23 02:22:58 +02:00
|
|
|
.replace('{seasonNumber}', seasonNumber.value.toString())
|
|
|
|
.replace('{seasonNumberDD}', seasonNumber.value.toString().padStart(2, '0'))
|
|
|
|
.replace('{episodeNumber}', episodeNumber.value.toString())
|
|
|
|
.replace('{episodeNumberDD}', episodeNumber.value.toString().padStart(2, '0'))
|
2024-07-05 00:51:02 +02:00
|
|
|
.replace('{episodeID}', episodeID.value)
|
2024-05-23 23:04:58 +02:00
|
|
|
.replace('{quality}', quality.value.toString() + 'p')
|
|
|
|
})
|
2024-05-23 02:22:58 +02:00
|
|
|
|
|
|
|
const seasonNaming = computed(() => {
|
|
|
|
if (!seasonNamingTemplate.value) return
|
|
|
|
return seasonNamingTemplate.value
|
|
|
|
.replace('{seriesName}', seriesName.value)
|
|
|
|
.replace('{seasonNumber}', seasonNumber.value.toString())
|
|
|
|
.replace('{seasonNumberDD}', seasonNumber.value.toString().padStart(2, '0'))
|
2024-05-23 23:04:58 +02:00
|
|
|
.replace('{quality}', quality.value.toString() + 'p')
|
|
|
|
})
|
2024-05-23 02:22:58 +02:00
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
;(window as any).myAPI.getSeasonTemplate().then((result: string) => {
|
|
|
|
seasonNamingTemplate.value = result
|
|
|
|
})
|
|
|
|
;(window as any).myAPI.getEpisodeTemplate().then((result: string) => {
|
|
|
|
episodeNamingTemplate.value = result
|
|
|
|
})
|
2024-06-20 23:31:21 +02:00
|
|
|
;(window as any).myAPI.getSeasonEnabled().then((result: boolean) => {
|
|
|
|
isSeasonActive.value = result
|
|
|
|
})
|
2024-05-23 02:22:58 +02:00
|
|
|
})
|
2024-05-23 15:53:27 +02:00
|
|
|
|
|
|
|
watch(episodeNamingTemplate, () => {
|
|
|
|
if (!episodeNamingTemplate.value) return
|
|
|
|
setEpisodeTemplate(episodeNamingTemplate.value)
|
|
|
|
})
|
|
|
|
|
|
|
|
watch(seasonNamingTemplate, () => {
|
|
|
|
if (!seasonNamingTemplate.value) return
|
|
|
|
setSeasonTemplate(seasonNamingTemplate.value)
|
|
|
|
})
|
|
|
|
|
|
|
|
const setEpisodeTemplate = (name: string) => {
|
|
|
|
if (process.client) {
|
|
|
|
;(window as any).myAPI.setEpisodeTemplate(name).then((result: string) => {
|
|
|
|
episodeNamingTemplate.value = result
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const setSeasonTemplate = (name: string) => {
|
|
|
|
if (process.client) {
|
|
|
|
;(window as any).myAPI.setSeasonTemplate(name).then((result: string) => {
|
|
|
|
seasonNamingTemplate.value = result
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2024-06-20 23:31:21 +02:00
|
|
|
|
|
|
|
const setSeasonFolder = (status: boolean | undefined) => {
|
|
|
|
if (process.client) {
|
|
|
|
;(window as any).myAPI.setSeasonEnabled(status).then((result: boolean) => {
|
|
|
|
isSeasonActive.value = result
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
2024-05-23 02:22:58 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style></style>
|