added search error if series not found
This commit is contained in:
parent
63941e7ef5
commit
d60d630638
@ -38,7 +38,7 @@ export async function searchCrunchy(q: string) {
|
|||||||
|
|
||||||
if (error.value) {
|
if (error.value) {
|
||||||
console.error(error.value)
|
console.error(error.value)
|
||||||
throw new Error(JSON.stringify(error.value))
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proxies && isProxyActive) {
|
if (proxies && isProxyActive) {
|
||||||
@ -67,7 +67,7 @@ export async function searchCrunchy(q: string) {
|
|||||||
|
|
||||||
if (ferror.value) {
|
if (ferror.value) {
|
||||||
console.error(ferror.value)
|
console.error(ferror.value)
|
||||||
throw new Error(JSON.stringify(ferror.value))
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fdata.value) {
|
if (fdata.value) {
|
||||||
@ -146,7 +146,7 @@ export async function getCRSeries(q: string) {
|
|||||||
|
|
||||||
if (error.value) {
|
if (error.value) {
|
||||||
console.error(error.value)
|
console.error(error.value)
|
||||||
throw new Error(JSON.stringify(error.value))
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.value && proxies && isProxyActive) {
|
if (!data.value && proxies && isProxyActive) {
|
||||||
@ -167,7 +167,7 @@ export async function getCRSeries(q: string) {
|
|||||||
|
|
||||||
if (ferror.value) {
|
if (ferror.value) {
|
||||||
console.error(ferror.value)
|
console.error(ferror.value)
|
||||||
throw new Error(JSON.stringify(ferror.value))
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fdata.value) {
|
if (fdata.value) {
|
||||||
@ -228,7 +228,7 @@ export async function getCREpisodeSeriesID(q: string) {
|
|||||||
|
|
||||||
if (error.value) {
|
if (error.value) {
|
||||||
console.error(error.value)
|
console.error(error.value)
|
||||||
throw new Error(JSON.stringify(error.value))
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data.value && proxies && isProxyActive) {
|
if (!data.value && proxies && isProxyActive) {
|
||||||
@ -249,7 +249,7 @@ export async function getCREpisodeSeriesID(q: string) {
|
|||||||
|
|
||||||
if (ferror.value) {
|
if (ferror.value) {
|
||||||
console.error(ferror.value)
|
console.error(ferror.value)
|
||||||
throw new Error(JSON.stringify(ferror.value))
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
data.value = fdata.value
|
data.value = fdata.value
|
||||||
|
@ -677,7 +677,11 @@ const switchToSeason = async () => {
|
|||||||
if (url.value && url.value.includes('crunchyroll') && url.value.includes('/series/') && !CRselectedShow.value) {
|
if (url.value && url.value.includes('crunchyroll') && url.value.includes('/series/') && !CRselectedShow.value) {
|
||||||
const seriesID = url.value.split('/')
|
const seriesID = url.value.split('/')
|
||||||
CRselectedShow.value = await getCRSeries(seriesID[5])
|
CRselectedShow.value = await getCRSeries(seriesID[5])
|
||||||
if (!CRselectedShow.value) return
|
if (!CRselectedShow.value) {
|
||||||
|
alert('Series not found')
|
||||||
|
isFetchingSeasons.value--
|
||||||
|
return
|
||||||
|
}
|
||||||
seasons.value = await listSeasonCrunchy(CRselectedShow.value.ID, CRselectedShow.value.Geo)
|
seasons.value = await listSeasonCrunchy(CRselectedShow.value.ID, CRselectedShow.value.Geo)
|
||||||
if (!seasons.value) {
|
if (!seasons.value) {
|
||||||
isFetchingSeasons.value--
|
isFetchingSeasons.value--
|
||||||
@ -718,8 +722,17 @@ const switchToSeason = async () => {
|
|||||||
if (url.value && url.value.includes('crunchyroll') && url.value.includes('/watch/') && !CRselectedShow.value) {
|
if (url.value && url.value.includes('crunchyroll') && url.value.includes('/watch/') && !CRselectedShow.value) {
|
||||||
const episodeID = url.value.split('/')
|
const episodeID = url.value.split('/')
|
||||||
const seriesID = await getCREpisodeSeriesID(episodeID[5])
|
const seriesID = await getCREpisodeSeriesID(episodeID[5])
|
||||||
if (!seriesID) return
|
if (!seriesID) {
|
||||||
|
alert('Episode not found')
|
||||||
|
isFetchingSeasons.value--
|
||||||
|
return
|
||||||
|
}
|
||||||
CRselectedShow.value = await getCRSeries(seriesID)
|
CRselectedShow.value = await getCRSeries(seriesID)
|
||||||
|
if (!CRselectedShow.value) {
|
||||||
|
alert('Series not found')
|
||||||
|
isFetchingSeasons.value--
|
||||||
|
return
|
||||||
|
}
|
||||||
if (!CRselectedShow.value) return
|
if (!CRselectedShow.value) return
|
||||||
seasons.value = await listSeasonCrunchy(CRselectedShow.value.ID, CRselectedShow.value.Geo)
|
seasons.value = await listSeasonCrunchy(CRselectedShow.value.ID, CRselectedShow.value.Geo)
|
||||||
if (!seasons.value) {
|
if (!seasons.value) {
|
||||||
|
Reference in New Issue
Block a user