Skip to content

Commit

Permalink
Merge pull request #38 from irohalab/fix-download-directly-bug
Browse files Browse the repository at this point in the history
Fix download directly bug
  • Loading branch information
EverettSummer authored Sep 28, 2024
2 parents 841bf25 + b97ce4e commit bfa0cde
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,22 @@ export class DownloadEditorComponent implements OnDestroy {
this._toastRef.show('已经复制到剪贴板');
}
download(): void {
const result = [];
for (let i = 0; i < this.eps_mapping.length; i++) {
let mapping = this.eps_mapping[i];
if (mapping.selected) {
result.push({
download_url: this.downloadUrl,
eps_no: mapping.eps_no,
file_path: this.files[i].path,
file_name: this.files[i].name
});
}
}
this._subscription.add(
this._adminService.downloadDirectly(
this.bangumi_id,
this.eps_mapping.filter(mapping => mapping.selected).map((mapping, idx) => {
return {
download_url: this.downloadUrl,
eps_no: mapping.eps_no,
file_path: this.files[idx].path,
file_name: this.files[idx].name
};
}))
result)
.subscribe({
next: () => {
this._dialogRef.close(true);
Expand Down

0 comments on commit bfa0cde

Please sign in to comment.