From 27a1645a373c4791d7aa6c98a80a6e8bd8e186d9 Mon Sep 17 00:00:00 2001 From: IITII Date: Tue, 5 Sep 2023 18:34:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dev.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dev.md b/dev.md index 014a2f8dc..54f151f42 100644 --- a/dev.md +++ b/dev.md @@ -1,6 +1,6 @@ ## PTPP 开发指引 -* https://github.com/pt-plugins/PT-Plugin-Plus/wiki/develop +* https://github.com/pt-plugins/PT-Plugin-Plus/wiki/developer ## PTPP 后端日志查看 @@ -11,7 +11,9 @@ ![img](./docs/images/1.png) -5. 从项目结构上说 `src/background` 的日志将会输出到 背景页。`src/options` 里面的日志,将会输出到 `index.html`。打开F12即可看见。 +5. 从项目结构上来说, 打开F12即可看见日志。 + 1. `src/background` 的日志将会输出到 `背景页`。 + 2. `src/options` 里面的日志,将会输出到 `index.html`。 ``` . From 8cbc6daa87b62f1a1c2470e33cc8ad5ab3ffbd51 Mon Sep 17 00:00:00 2001 From: IITII Date: Tue, 5 Sep 2023 18:35:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E9=81=BF=E5=85=8D=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=A1=B5=E5=9B=A0=E4=B8=BA=E9=87=8D=E6=96=B0=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E5=85=B3=E9=94=AE=E5=AD=97=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/options/components/SearchBox.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/options/components/SearchBox.vue b/src/options/components/SearchBox.vue index 64dd7dbba..ac714d04a 100644 --- a/src/options/components/SearchBox.vue +++ b/src/options/components/SearchBox.vue @@ -398,9 +398,15 @@ export default Vue.extend({ searchTorrent(key?: string) { key = key || this.searchKey; + console.log(`searchTorrent: key: ${key}, searchKey: ${this.searchKey}`) if (!key) { return; } + const targetRoute = {name: "search-torrent", params: {key,},} + if (key === this.searchKey && this.$router.currentRoute.name === targetRoute.name) { + console.log(`skip same searchTorrent: key: ${key}, searchKey: ${this.searchKey}`) + return; + } this.showMenu = false; clearTimeout(this.timer); @@ -409,12 +415,7 @@ export default Vue.extend({ lastSearchKey: this.searchKey, }); - this.$router.push({ - name: "search-torrent", - params: { - key: key, - }, - }); + this.$router.push(targetRoute); }, changeSearchSolution(solution?: SearchSolution) { let defaultSearchSolutionId = ""; From 2f4cf1121adb0fc33cd361b5f891950d115e508d Mon Sep 17 00:00:00 2001 From: IITII Date: Tue, 5 Sep 2023 18:36:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=96=B9=E6=A1=88=E9=BB=98=E8=AE=A4=E6=90=9C=E7=B4=A2=E9=80=BB?= =?UTF-8?q?=E8=BE=91,=20=E5=8F=AF=E5=9C=A8=20=E9=80=9A=E7=94=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE-=E6=90=9C=E7=B4=A2=20=E4=B8=AD=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/i18n/en.json | 1 + resource/i18n/zh-CN.json | 1 + src/interface/common.ts | 2 ++ src/options/views/search/SearchTorrent.ts | 9 ++++++++- src/options/views/settings/Base/Index.vue | 9 ++++++++- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/resource/i18n/en.json b/resource/i18n/en.json index b59769e34..2a0cc7c42 100644 --- a/resource/i18n/en.json +++ b/resource/i18n/en.json @@ -498,6 +498,7 @@ "saveSearchKey": "Save historical search keyword records", "showMoiveInfoCardOnSearch": "Show movie and rating information when searching by IMDb number", "getMovieInformationBeforeSearching": "When entering a search keyword, load relevant information from Douban for pre-selection", + "autoSearchWhenSwitchSolution": "When changing search solution, re-search immediately", "maxMovieInformationCount": "Maximum display number of entries (1-20):", "searchModeForItem": "When clicking on a pre-selected item:", "showToolbarOnContentPage": "Enable site page plugin icons and toolbars (such as one-click downloads, etc.)", diff --git a/resource/i18n/zh-CN.json b/resource/i18n/zh-CN.json index 838efbb50..04e4c1016 100644 --- a/resource/i18n/zh-CN.json +++ b/resource/i18n/zh-CN.json @@ -493,6 +493,7 @@ "saveSearchKey": "保存搜索关键字", "showMoiveInfoCardOnSearch": "当以 IMDb 编号搜索时显示电影及评分信息", "getMovieInformationBeforeSearching": "当输入搜索关键字时,从豆瓣加载相关信息以供预选", + "autoSearchWhenSwitchSolution": "当搜索方案切换时,立即触发搜索", "maxMovieInformationCount": "最多显示条目(1-20):", "searchModeForItem": "当点击预选条目时:", "showToolbarOnContentPage": "启用站点页面助手图标和工具栏(如一键下载等)", diff --git a/src/interface/common.ts b/src/interface/common.ts index 47bd6f1c5..6b28075f3 100644 --- a/src/interface/common.ts +++ b/src/interface/common.ts @@ -135,6 +135,8 @@ export interface Options { showMoiveInfoCardOnSearch?: boolean; // 在搜索之前一些选项配置 beforeSearchingOptions?: BeforeSearching; + // 搜索方案切换的时候是否自动搜索 + autoSearchWhenSwitchSolution?: boolean; // 在页面中显示工具栏 showToolbarOnContentPage?: boolean; // 当前语言 diff --git a/src/options/views/search/SearchTorrent.ts b/src/options/views/search/SearchTorrent.ts index 7cecd900f..dbaca41f6 100644 --- a/src/options/views/search/SearchTorrent.ts +++ b/src/options/views/search/SearchTorrent.ts @@ -206,11 +206,13 @@ export default Vue.extend({ watch: { key(newValue, oldValue) { if (newValue && newValue != oldValue) { + console.log('watch search key', newValue, oldValue) this.doSearch(); } }, host(newValue, oldValue) { if (newValue && newValue != oldValue) { + console.log('watch search host', newValue, oldValue) this.doSearch(); } }, @@ -221,9 +223,14 @@ export default Vue.extend({ this.haveError = this.errorMsg != ""; }, "$store.state.options.defaultSearchSolutionId"(newValue, oldValue) { + console.log('watch search defaultSearchSolutionId', newValue, oldValue) // 设置为<默认>时,newValue 为空,故与 key, host 处理方式不同 if (newValue != oldValue) { - this.doSearch(); + if (this.$store.state.options.autoSearchWhenSwitchSolution) { + this.doSearch(); + } else { + console.log(`切换搜索方案 - 跳过搜索, 可在 常规设置 - 搜索 中开启自动搜索`) + } } }, loading() { diff --git a/src/options/views/settings/Base/Index.vue b/src/options/views/settings/Base/Index.vue index 41a60167c..93a8fca50 100644 --- a/src/options/views/settings/Base/Index.vue +++ b/src/options/views/settings/Base/Index.vue @@ -282,6 +282,13 @@ :label="$t('settings.base.showMoiveInfoCardOnSearch')" > + + +