mirror of
https://github.com/CzBiX/qb-web.git
synced 2026-04-15 10:49:50 +08:00
Fix set torrent file priority issue
This commit is contained in:
@@ -79,21 +79,15 @@ export default class TorrentContent extends BaseTorrentInfo {
|
||||
}
|
||||
|
||||
get selected(): number[] {
|
||||
const list: number[] = [];
|
||||
|
||||
this.files.forEach((item, index) => {
|
||||
if(item.priority !== EFilePriority.notDownload) {
|
||||
list.push(index);
|
||||
}
|
||||
})
|
||||
|
||||
return list;
|
||||
return this.files.filter((item) => {
|
||||
return item.priority !== EFilePriority.notDownload;
|
||||
}).map(item => item.id);
|
||||
}
|
||||
|
||||
async getFiles() {
|
||||
const files = (await api.getTorrentFiles(this.hash) as File[])
|
||||
.sort((a, b) => a.name.localeCompare(b.name))
|
||||
const files = await api.getTorrentFiles(this.hash) as File[]
|
||||
files.forEach((v, i) => v.id = i)
|
||||
files.sort((a, b) => a.name.localeCompare(b.name))
|
||||
|
||||
this.files = files
|
||||
this.folderIndex = 0
|
||||
|
||||
Reference in New Issue
Block a user