Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

128 phimseason not show screen error if use cache #129

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/errors/cloudflare.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
no-caps
outline
rounded
@click="retry"
@click="reload"
style="color: #00be06"
>{{ t("thu-lai") }}</q-btn
>
Expand All @@ -53,6 +53,7 @@ const { t } = useI18n()
function openAnimeVietsub() {
window.open(C_URL)
}
const reload = () => location.reload()
</script>

<style></style>
1 change: 1 addition & 0 deletions src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@
<q-img-custom
v-if="authStore.user_data?.avatar"
:src="forceHttp2(authStore.user_data.avatar)"
no-spinner
referrerpolicy="no-referrer"
/>
<Icon
Expand Down
22 changes: 16 additions & 6 deletions src/pages/phim/_season.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</div>

<div
v-if="loading && !data"
v-if="!error && loading && !data"
class="absolute w-full h-full overflow-hidden px-4 pt-6 text-[28px] row"
>
<div class="col-9 pr-4">
Expand Down Expand Up @@ -118,7 +118,7 @@
</div>
</div>

<div v-else-if="data" class="mx-4 row">
<div v-else-if="!error && data" class="mx-4 row">
<div class="col-9 pr-4">
<div class="flex-1 mt-4">
<h1
Expand Down Expand Up @@ -1223,40 +1223,50 @@ watch(

// eslint-disable-next-line functional/no-let
let typeCurrentConfig: keyof typeof servers | null = null
// eslint-disable-next-line functional/no-let
let loadedServerFB = false
// setup watcher it
const watcher = watch(
() => settingsStore.player.server,
async (server) => {
loadedServerFB = false
try {
if (server === "DU") {
if (typeCurrentConfig !== "DU")
// eslint-disable-next-line promise/catch-or-return
PlayerLink(currentMetaChap).then((conf) => {
// eslint-disable-next-line promise/always-return
if (settingsStore.player.server === "DU") {
configPlayer.value = conf
typeCurrentConfig = "DU"
}
})
.catch(err => {
error.value =err
})
}
if (server === "FB") {
// PlayerFB は常に PlayerLink よりも遅いため、DU を使用して高速プリロード戦術を使用する必要があります。
if (typeCurrentConfig !== "DU")
// eslint-disable-next-line promise/catch-or-return
PlayerLink(currentMetaChap).then((conf) => {
// eslint-disable-next-line promise/always-return
if (settingsStore.player.server === "DU") {
if (!loadedServerFB && settingsStore.player.server === "DU") {
configPlayer.value = conf
typeCurrentConfig = "DU"
}
})
// eslint-disable-next-line promise/catch-or-return
.catch(err => {
error.value =err
})
PlayerFB(currentMetaChap.id).then((conf) => {
// eslint-disable-next-line promise/always-return
if (settingsStore.player.server === "FB") {
configPlayer.value = conf
typeCurrentConfig = "FB"
}
loadedServerFB = true
})
.catch(err => {
error.value =err
})
}
} catch (err) {
Expand Down