Skip to content

Commit e2bb588

Browse files
committed
update save logic
1 parent d2dbc36 commit e2bb588

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/options_page/modules/DownloadTasks/MultiplePagesDownloadTask.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,20 @@ class MultipleDownloadTask extends AbstractDownloadTask {
132132
}
133133

134134
shouldZipFile() {
135+
if (GlobalSettings().downloadSaveMode !== 0) {
136+
return false;
137+
}
138+
135139
return this.zipMultipleImages === 1 ||
136140
(this.zipMultipleImages === 2 && this.options.pages.length > 1) ||
137141
(this.zipMultipleImages === 3 && this.downloader.files.length > 1 );
138142
}
139143

140144
dontCreateWorkFolder() {
145+
if (GlobalSettings().downloadSaveMode !== 1) {
146+
return false;
147+
}
148+
141149
const dontCreateWorkFolderSetting = GlobalSettings().dontCreateWorkFolder;
142150

143151
return dontCreateWorkFolderSetting === 2 ||
@@ -195,7 +203,10 @@ class MultipleDownloadTask extends AbstractDownloadTask {
195203
onFinish() {
196204
if (this.shouldZipFile()) {
197205
const nameFormatter = NameFormattor.getFormatter({ context: Object.assign({}, this.context) });
198-
let filename = pathjoin(GlobalSettings().downloadRelativeLocation, nameFormatter.format(this.options.renameRule, this.context.id));
206+
let filename = pathjoin(
207+
GlobalSettings().downloadRelativeLocation,
208+
nameFormatter.format(this.options.renameRule, this.context.id)
209+
);
199210
filename = fixFilename(filename);
200211

201212
this.zip.generateAsync({ type: 'blob' }).then(async blob => {

0 commit comments

Comments
 (0)