Skip to content

Commit

Permalink
fix(mt): 搜索页下载种子到本地 #1808
Browse files Browse the repository at this point in the history
  • Loading branch information
IITII committed Jun 13, 2024
1 parent 480e9a0 commit be25504
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
18 changes: 1 addition & 17 deletions src/options/views/search/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

<!-- 下载种子文件 -->
<v-btn
v-if="downloadMethod=='POST'"
flat
icon
small
Expand All @@ -40,21 +39,6 @@
<v-icon @click.stop="saveTorrentFile" small :title="$t('searchTorrent.saveTip')">save</v-icon>
</v-btn>

<v-btn
v-else
flat
icon
small
:class="$vuetify.breakpoint.mdAndUp? 'mx-0': 'mx-0 btn-mini'"
:href="url"
target="_blank"
rel="noopener noreferrer nofollow"
:title="$t('searchTorrent.saveTip')"
color="grey darken-1"
>
<v-icon small>save</v-icon>
</v-btn>

<!-- 收藏 -->
<v-btn
v-if="!isCollectioned"
Expand Down Expand Up @@ -125,4 +109,4 @@ export default Vue.extend({
.torrent-actions {
display: inline-flex;
}
</style>
</style>
22 changes: 12 additions & 10 deletions src/options/views/search/SearchTorrent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1234,17 +1234,19 @@ export default Vue.extend({
/**
* 下载已选中的种子文件
*/
downloadSelected() {
async downloadSelected() {
let files: downloadFile[] = [];
this.selected.forEach((item: SearchResultItem) => {
item.url &&
files.push({
url: item.url,
fileName: `[${item.site.name}][${item.title}].torrent`,
method: item.site.downloadMethod,
timeout: this.options.connectClientTimeout
});
});
for (let i = 0; i < this.selected.length; i++) {
const item = this.selected[i];
console.log(`[${i}]解析 ${item.title} 的 url: ${item.url}`)
const url = this.processURLWithPrefix("m-teamdetail", item.site, item.url)
url && files.push({
url: url,
fileName: `[${item.site.name}][${item.title}].torrent`,
method: item.site.downloadMethod,
timeout: this.options.connectClientTimeout
});
}
console.log(files);
if (files.length) {
if (files.length > 1) {
Expand Down

0 comments on commit be25504

Please sign in to comment.