added option to disable season folder
This commit is contained in:
parent
a81379b375
commit
1468cbcb3c
@ -33,6 +33,10 @@
|
|||||||
|
|
||||||
<div class="text-sm mt-2"> Variables: </div>
|
<div class="text-sm mt-2"> Variables: </div>
|
||||||
<div class="text-sm text-center"> {seriesName}, {seasonNumber}, {seasonNumberDD}, {quality} </div>
|
<div class="text-sm text-center"> {seriesName}, {seasonNumber}, {seasonNumberDD}, {quality} </div>
|
||||||
|
<div class="flex flex-row mt-3">
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -45,6 +49,7 @@ const seriesName = ref<string>('Frieren')
|
|||||||
const episodeName = ref<string>("The Journey's End")
|
const episodeName = ref<string>("The Journey's End")
|
||||||
const episodeNamingTemplate = ref<string>()
|
const episodeNamingTemplate = ref<string>()
|
||||||
const seasonNamingTemplate = ref<string>()
|
const seasonNamingTemplate = ref<string>()
|
||||||
|
const isSeasonActive = ref<boolean>()
|
||||||
|
|
||||||
const episodeNaming = computed(() => {
|
const episodeNaming = computed(() => {
|
||||||
if (!episodeNamingTemplate.value) return
|
if (!episodeNamingTemplate.value) return
|
||||||
@ -74,6 +79,9 @@ onMounted(() => {
|
|||||||
;(window as any).myAPI.getEpisodeTemplate().then((result: string) => {
|
;(window as any).myAPI.getEpisodeTemplate().then((result: string) => {
|
||||||
episodeNamingTemplate.value = result
|
episodeNamingTemplate.value = result
|
||||||
})
|
})
|
||||||
|
;(window as any).myAPI.getSeasonEnabled().then((result: boolean) => {
|
||||||
|
isSeasonActive.value = result
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(episodeNamingTemplate, () => {
|
watch(episodeNamingTemplate, () => {
|
||||||
@ -101,6 +109,14 @@ const setSeasonTemplate = (name: string) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const setSeasonFolder = (status: boolean | undefined) => {
|
||||||
|
if (process.client) {
|
||||||
|
;(window as any).myAPI.setSeasonEnabled(status).then((result: boolean) => {
|
||||||
|
isSeasonActive.value = result
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
@ -530,6 +530,11 @@ export async function downloadCrunchyrollPlaylist(
|
|||||||
|
|
||||||
const chapterFolder = await createFolder()
|
const chapterFolder = await createFolder()
|
||||||
|
|
||||||
|
var downloadDir: string = downloadPath;
|
||||||
|
|
||||||
|
var isSeasonFolderActive = (await settings.get('seasonFolderActive')) as string
|
||||||
|
|
||||||
|
if (isSeasonFolderActive) {
|
||||||
var seasonFolderNaming = (await settings.get('SeasonTemp')) as string
|
var seasonFolderNaming = (await settings.get('SeasonTemp')) as string
|
||||||
|
|
||||||
if (!seasonFolderNaming) {
|
if (!seasonFolderNaming) {
|
||||||
@ -542,9 +547,10 @@ export async function downloadCrunchyrollPlaylist(
|
|||||||
.replace('{seasonNumberDD}', season.toString().padStart(2, '0'))
|
.replace('{seasonNumberDD}', season.toString().padStart(2, '0'))
|
||||||
.replace('{quality}', quality.toString() + 'p')
|
.replace('{quality}', quality.toString() + 'p')
|
||||||
|
|
||||||
const seasonFolder = await createFolderName(seasonFolderNaming, downloadPath)
|
downloadDir = await createFolderName(seasonFolderNaming, downloadPath)
|
||||||
|
}
|
||||||
|
|
||||||
await updatePlaylistByID(downloadID, undefined, undefined, seasonFolder)
|
await updatePlaylistByID(downloadID, undefined, undefined, downloadDir)
|
||||||
|
|
||||||
const drmL3blob = (await settings.get('l3blob')) as string
|
const drmL3blob = (await settings.get('l3blob')) as string
|
||||||
const drmL3key = (await settings.get('l3key')) as string
|
const drmL3key = (await settings.get('l3key')) as string
|
||||||
@ -1088,7 +1094,7 @@ export async function downloadCrunchyrollPlaylist(
|
|||||||
.replace('{episodeNumberDD}', episode ? episode.toString().padStart(2, '0') : episode_string)
|
.replace('{episodeNumberDD}', episode ? episode.toString().padStart(2, '0') : episode_string)
|
||||||
.replace('{quality}', quality.toString() + 'p')
|
.replace('{quality}', quality.toString() + 'p')
|
||||||
|
|
||||||
await mergeVideoFile(file as string, chapter, audios, subss, seasonFolder, episodeNaming, format, downloadID)
|
await mergeVideoFile(file as string, chapter, audios, subss, downloadDir, episodeNaming, format, downloadID)
|
||||||
|
|
||||||
await updatePlaylistByID(downloadID, 'completed')
|
await updatePlaylistByID(downloadID, 'completed')
|
||||||
|
|
||||||
|
@ -274,6 +274,23 @@ ipcMain.handle('dialog:proxyActiveSet', async (events, status: boolean) => {
|
|||||||
return status
|
return status
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ipcMain.handle('dialog:getSeasonEnabledTemplate', async (events) => {
|
||||||
|
const savedStat = await settings.get('seasonFolderActive')
|
||||||
|
|
||||||
|
if (!savedStat) {
|
||||||
|
await settings.set('seasonFolderActive', true)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return savedStat
|
||||||
|
})
|
||||||
|
|
||||||
|
ipcMain.handle('dialog:setSeasonEnabledTemplate', async (events, active: boolean) => {
|
||||||
|
await settings.set('seasonFolderActive', active)
|
||||||
|
|
||||||
|
return active
|
||||||
|
})
|
||||||
|
|
||||||
app.on('window-all-closed', () => {
|
app.on('window-all-closed', () => {
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
app.quit()
|
app.quit()
|
||||||
|
@ -24,5 +24,5 @@ contextBridge.exposeInMainWorld('myAPI', {
|
|||||||
setSeasonTemplate: (name: string) => ipcRenderer.invoke('dialog:setSeasonTemplate', name),
|
setSeasonTemplate: (name: string) => ipcRenderer.invoke('dialog:setSeasonTemplate', name),
|
||||||
getSeasonTemplate: () => ipcRenderer.invoke('dialog:getSeasonTemplate'),
|
getSeasonTemplate: () => ipcRenderer.invoke('dialog:getSeasonTemplate'),
|
||||||
setSeasonEnabled: (status: boolean) => ipcRenderer.invoke('dialog:setSeasonEnabledTemplate', status),
|
setSeasonEnabled: (status: boolean) => ipcRenderer.invoke('dialog:setSeasonEnabledTemplate', status),
|
||||||
getSeasonEnabled: (status: boolean) => ipcRenderer.invoke('dialog:setSeasonEnabledTemplate', status),
|
getSeasonEnabled: (status: boolean) => ipcRenderer.invoke('dialog:getSeasonEnabledTemplate', status),
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user