added episode name naming option

This commit is contained in:
stratuma 2024-06-20 21:34:47 +02:00
parent 828ec65568
commit 932e089c06
2 changed files with 6 additions and 1 deletions

View File

@ -15,7 +15,7 @@
</div>
<div class="text-sm mt-2"> Variables: </div>
<div class="text-sm text-center"> {seriesName}, {seasonNumber}, {seasonNumberDD}, {episodeNumber}, {episodeNumberDD}, {quality} </div>
<div class="text-sm text-center"> {seriesName}, {episodeName}, {seasonNumber}, {seasonNumberDD}, {episodeNumber}, {episodeNumberDD}, {quality} </div>
</div>
<div class="flex flex-col items-center p-3 bg-[#11111189] rounded-xl select-none">
<div class="text-sm mb-2">Season Folder Naming</div>
@ -42,6 +42,7 @@ const episodeNumber = ref<number>(1)
const seasonNumber = ref<number>(1)
const quality = ref<number>(1080)
const seriesName = ref<string>('Frieren')
const episodeName = ref<string>("The Journey's End")
const episodeNamingTemplate = ref<string>()
const seasonNamingTemplate = ref<string>()
@ -49,6 +50,7 @@ const episodeNaming = computed(() => {
if (!episodeNamingTemplate.value) return
return episodeNamingTemplate.value
.replace('{seriesName}', seriesName.value)
.replace('{episodeName}', episodeName.value)
.replace('{seasonNumber}', seasonNumber.value.toString())
.replace('{seasonNumberDD}', seasonNumber.value.toString().padStart(2, '0'))
.replace('{episodeNumber}', episodeNumber.value.toString())

View File

@ -292,6 +292,7 @@ async function checkPlaylists() {
(e.dataValues.media as CrunchyEpisode).id,
e.dataValues.id,
(e.dataValues.media as CrunchyEpisode).series_title,
(e.dataValues.media as CrunchyEpisode).title,
(e.dataValues.media as CrunchyEpisode).season_number,
(e.dataValues.media as CrunchyEpisode).episode_number,
(e.dataValues.media as CrunchyEpisode).episode,
@ -464,6 +465,7 @@ export async function downloadCrunchyrollPlaylist(
episodeID: string,
downloadID: number,
name: string,
name_episode: string,
season: number,
episode: number,
episode_string: string,
@ -1077,6 +1079,7 @@ export async function downloadCrunchyrollPlaylist(
episodeNaming = episodeNaming
.replace('{seriesName}', name.replace(/[/\\?%*:|"<>]/g, ''))
.replace('{episodeName}', name_episode ? name_episode.replace(/[/\\?%*:|"<>]/g, '') : 'no title')
.replace('{seasonNumber}', season.toString())
.replace('{seasonNumberDD}', season.toString().padStart(2, '0'))
.replace('{episodeNumber}', episode ? episode.toString() : episode_string)