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

fix: 调整搜索方案默认搜索逻辑, 可在 通用配置-搜索 中调整 #1561

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 4 additions & 2 deletions dev.md
Original file line number Diff line number Diff line change
@@ -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 后端日志查看

Expand All @@ -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`。

```
.
Expand Down
13 changes: 7 additions & 6 deletions src/options/components/SearchBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Comment on lines +406 to +409
Copy link
Member Author

@IITII IITII Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里判了 route name, 你可以在这里通过自己加 event 触发搜索. 目前过滤掉就好了 @Meng-Lan
反正直接刷新网页, 刷新后会搜索


this.showMenu = false;
clearTimeout(this.timer);
Expand All @@ -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 = "";
Expand Down