diff --git a/src/components/BrtPlayer.vue b/src/components/BrtPlayer.vue index 17282f31..16cbdda4 100644 --- a/src/components/BrtPlayer.vue +++ b/src/components/BrtPlayer.vue @@ -1017,6 +1017,7 @@ import type { import { useAuthStore } from "stores/auth" import { useHistoryStore } from "stores/history" import { useSettingsStore } from "stores/settings" +import { useStateStorageStore } from "stores/state-storage" import { computed, onBeforeUnmount, @@ -1038,6 +1039,7 @@ const { t } = useI18n() const authStore = useAuthStore() const settingsStore = useSettingsStore() const historyStore = useHistoryStore() +const stateStorageStore = useStateStorageStore() const router = useRouter() const $q = useQuasar() @@ -1234,6 +1236,11 @@ watch( try { console.log(":restore progress") + if (stateStorageStore.disableAutoRestoration) { + addNotice(t("bo-qua-khoi-phuc-tien-trinh-xem")) + // eslint-disable-next-line functional/no-throw-statement + throw new Error("NOT_RESET") + } const cur = ( await historyStore.getProgressChap(currentSeason, currentChap) )?.cur @@ -1761,8 +1768,8 @@ function remount(resetCurrentTime?: boolean) { } hls.recoverMediaError() if (playing) - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - video.value!.play() + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + video.value!.play() break } default: { diff --git a/src/components/FragmentChaps.vue b/src/components/FragmentChaps.vue index ab95888e..c715fe18 100644 --- a/src/components/FragmentChaps.vue +++ b/src/components/FragmentChaps.vue @@ -2,17 +2,54 @@
{{ gridModeTabsSeasons ? t("chon-season") : t("chon-tap") }} - - - + :class=" + stateStorageStore.disableAutoRestoration ? 'text-deep-orange-13' : '' + " + > + + + {{ + stateStorageStore.disableAutoRestoration + ? t("kich-hoat-lai-khoi-phuc-tien-trinh-xem") + : t( + "vo-hieu-hoa-tam-thoi-khoi-phuc-tien-trinh-xem-truoc-tam-thoi" + ) + }} + + + + +
@@ -107,6 +144,7 @@ import type { ProgressWatchStore, Season, } from "src/pages/phim/_season.interface" +import { useStateStorageStore } from "src/stores/state-storage" import { ref, watch, watchEffect } from "vue" import { useI18n } from "vue-i18n" @@ -131,6 +169,8 @@ const props = defineProps<{ }>() const { t } = useI18n() +const stateStorageStore = useStateStorageStore() + const seasonActive = ref() // sync data by active route watch( diff --git a/src/i18n/messages/en-US.json b/src/i18n/messages/en-US.json index f0a1e08d..c4d46f5b 100644 --- a/src/i18n/messages/en-US.json +++ b/src/i18n/messages/en-US.json @@ -23,6 +23,7 @@ "bat-tieng-m": "Unmute (m)", "bay-gio-_value": "Now {0}", "binh-luan": "Comment", + "bo-qua-khoi-phuc-tien-trinh-xem": "Skip restore watch progress", "cai-dat": "Setting", "cai-dat-chung": "General settings", "cai-dat-extension-animevsub-helper": "Install extension AnimeVsub Helper", @@ -113,6 +114,7 @@ "khieu-nai-vi-pham": "Complaint of violation", "khong-co-danh-sach-phat-nao": "No playlists yet", "khong-co-thong-bao-moi-nao": "No new announcements", + "kich-hoat-lai-khoi-phuc-tien-trinh-xem": "Re-enable watch progress recovery", "kiem-tra-cap-nhat": "Check for updates", "la-mot-vpn-mien-phi": "is a free VPN", "lich-chieu": "Showtimes", @@ -225,6 +227,7 @@ "ve-chung-toi": "About us", "ve-ung-dung": "About the app", "video-tam-thoi-khong-kha-dung": "Video is temporarily unavailable", + "vo-hieu-hoa-tam-thoi-khoi-phuc-tien-trinh-xem-truoc-tam-thoi": "Temporarily disable restoring preview progress (temporarily)", "voi": "with", "vui-long-thu-cap-nhat-extension-neu-su-co-khong-duoc-khac-phuc-vui-long-gui-email-den": "Please try updating the extension, if the problem is not fixed please email to", "xac-nhan": "Confirm", diff --git a/src/i18n/messages/ja-JP.json b/src/i18n/messages/ja-JP.json index 9338038c..f3d301d1 100644 --- a/src/i18n/messages/ja-JP.json +++ b/src/i18n/messages/ja-JP.json @@ -23,6 +23,7 @@ "bat-tieng-m": "ミュート解除 (分)", "bay-gio-_value": "現在{0}", "binh-luan": "コメント", + "bo-qua-khoi-phuc-tien-trinh-xem": "復元ウォッチの進行状況をスキップ", "cai-dat": "設定", "cai-dat-chung": "一般設定", "cai-dat-extension-animevsub-helper": "拡張機能 AnimeVsub Helper をインストールする", @@ -113,6 +114,7 @@ "khieu-nai-vi-pham": "違反の苦情", "khong-co-danh-sach-phat-nao": "プレイリストはまだありません", "khong-co-thong-bao-moi-nao": "新しい発表はありません", + "kich-hoat-lai-khoi-phuc-tien-trinh-xem": "時計の進行状況の回復を再度有効にする", "kiem-tra-cap-nhat": "アップデートを確認", "la-mot-vpn-mien-phi": "無料のVPNです", "lich-chieu": "上映時間", @@ -225,6 +227,7 @@ "ve-chung-toi": "私たちに関しては", "ve-ung-dung": "アプリについて", "video-tam-thoi-khong-kha-dung": "動画は一時的に利用できません", + "vo-hieu-hoa-tam-thoi-khoi-phuc-tien-trinh-xem-truoc-tam-thoi": "プレビューの進行状況の復元を一時的に無効にする (一時的に)", "voi": "と", "vui-long-thu-cap-nhat-extension-neu-su-co-khong-duoc-khac-phuc-vui-long-gui-email-den": "拡張機能を更新してみてください。問題が解決しない場合は、にメールしてください。", "xac-nhan": "確認", diff --git a/src/i18n/messages/vi-VN.json b/src/i18n/messages/vi-VN.json index f86cffe4..15d99c19 100644 --- a/src/i18n/messages/vi-VN.json +++ b/src/i18n/messages/vi-VN.json @@ -23,6 +23,7 @@ "bat-tieng-m": "Bật tiếng (m)", "bay-gio-_value": "Bây giờ {0}", "binh-luan": "Bình luận", + "bo-qua-khoi-phuc-tien-trinh-xem": "Bỏ qua khôi phục tiến trình xem", "cai-dat": "Cài đặt", "cai-dat-chung": "Cài đặt chung", "cai-dat-extension-animevsub-helper": "Cài đặt extension AnimeVsub Helper", @@ -113,6 +114,7 @@ "khieu-nai-vi-pham": "Khiếu nại vi phạm", "khong-co-danh-sach-phat-nao": "Không có danh sách phát nào", "khong-co-thong-bao-moi-nao": "Không có thông báo mới nào", + "kich-hoat-lai-khoi-phuc-tien-trinh-xem": "Kích hoạt lại khôi phục tiến trình xem", "kiem-tra-cap-nhat": "Kiểm tra cập nhật", "la-mot-vpn-mien-phi": "là một VPN miễn phí", "lich-chieu": "Lịch chiếu", @@ -225,6 +227,7 @@ "ve-chung-toi": "Về chúng tôi", "ve-ung-dung": "Về ứng dụng", "video-tam-thoi-khong-kha-dung": "Video tạm thời không khả dụng", + "vo-hieu-hoa-tam-thoi-khoi-phuc-tien-trinh-xem-truoc-tam-thoi": "Vô hiệu hóa tạm thời khôi phục tiến trình xem trước (tạm thời)", "voi": "với", "vui-long-thu-cap-nhat-extension-neu-su-co-khong-duoc-khac-phuc-vui-long-gui-email-den": "Vui lòng thử cập nhật extension, nếu sự cố không được khắc phục vui lòng gửi email đến", "xac-nhan": "Xác nhận", diff --git a/src/i18n/messages/zh-CN.json b/src/i18n/messages/zh-CN.json index fd3b44bd..13d76bf1 100644 --- a/src/i18n/messages/zh-CN.json +++ b/src/i18n/messages/zh-CN.json @@ -23,6 +23,7 @@ "bat-tieng-m": "取消静音 (m)", "bay-gio-_value": "现在{0}", "binh-luan": "评论", + "bo-qua-khoi-phuc-tien-trinh-xem": "跳过恢复观看进度", "cai-dat": "环境", "cai-dat-chung": "通用设置", "cai-dat-extension-animevsub-helper": "安装扩展 AnimeVsub Helper", @@ -113,6 +114,7 @@ "khieu-nai-vi-pham": "违规投诉", "khong-co-danh-sach-phat-nao": "还没有播放列表", "khong-co-thong-bao-moi-nao": "没有新的公告", + "kich-hoat-lai-khoi-phuc-tien-trinh-xem": "重新启用观看进度恢复", "kiem-tra-cap-nhat": "检查更新", "la-mot-vpn-mien-phi": "是一个免费的VPN", "lich-chieu": "放映时间", @@ -225,6 +227,7 @@ "ve-chung-toi": "关于我们", "ve-ung-dung": "关于应用程序", "video-tam-thoi-khong-kha-dung": "视频暂时不可用", + "vo-hieu-hoa-tam-thoi-khoi-phuc-tien-trinh-xem-truoc-tam-thoi": "暂时禁用恢复预览进度(暂时)", "voi": "和", "vui-long-thu-cap-nhat-extension-neu-su-co-khong-duoc-khac-phuc-vui-long-gui-email-den": "请尝试更新扩展程序,如果问题未解决,请发送电子邮件至", "xac-nhan": "确认", diff --git a/src/stores/state-storage.ts b/src/stores/state-storage.ts new file mode 100644 index 00000000..595664b6 --- /dev/null +++ b/src/stores/state-storage.ts @@ -0,0 +1,9 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; + +export const useStateStorageStore = +defineStore("state-storage", () => { + const disableAutoRestoration = ref(false) + + return { disableAutoRestoration } +})