Skip to content

Commit 3fcee55

Browse files
committed
Reverting to read an auto backup but just the last normal zip file as backup.
1 parent ce251b4 commit 3fcee55

File tree

1 file changed

+1
-75
lines changed

1 file changed

+1
-75
lines changed

src/services/uiExportImportHelper.ts

Lines changed: 1 addition & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -169,90 +169,16 @@ export class UIExportImportHelper {
169169
}> {
170170
const parsedJSON: any = await this.readBackupZIPFile();
171171

172-
const biggestAutomaticBackupFileContent =
173-
await this.__getBiggestAutomaticBackupFileContent();
172+
//const biggestAutomaticBackupFileContent = await this.__getBiggestAutomaticBackupFileContent();
174173
let isAutomaticBackup: boolean = false;
175174
let fileData: any;
176175
this.uiLog.log(
177176
'__getBiggerFileBackupOrAutomatic - Get backup and automatic backup and check besides',
178177
);
179178
/** If an app is completely new, there is no BREWS entry, because we just start with settings and version **/
180179
if (parsedJSON && 'BREWS' in parsedJSON) {
181-
this.uiLog.log(
182-
'__getBiggerFileBackupOrAutomatic - We found an normal backup',
183-
);
184-
if (
185-
biggestAutomaticBackupFileContent &&
186-
'BREWS' in biggestAutomaticBackupFileContent
187-
) {
188-
this.uiLog.log(
189-
'__getBiggerFileBackupOrAutomatic - We found an automatic backup',
190-
);
191-
if (
192-
biggestAutomaticBackupFileContent.BEANS.length >
193-
parsedJSON.BEANS.length
194-
) {
195-
this.uiLog.log('__getBiggerFileBackupOrAutomatic - Beans');
196-
isAutomaticBackup = true;
197-
}
198-
if (
199-
biggestAutomaticBackupFileContent.BREWS.length >
200-
parsedJSON.BREWS.length
201-
) {
202-
this.uiLog.log(
203-
'We found a bigger automatic backup file, so we import it',
204-
);
205-
isAutomaticBackup = true;
206-
}
207-
if (
208-
biggestAutomaticBackupFileContent.PREPARATION.length >
209-
parsedJSON.PREPARATION.length
210-
) {
211-
this.uiLog.log(
212-
'We found a bigger automatic backup file, so we import it',
213-
);
214-
isAutomaticBackup = true;
215-
}
216-
if (
217-
biggestAutomaticBackupFileContent.MILL.length > parsedJSON.MILL.length
218-
) {
219-
this.uiLog.log(
220-
'We found a bigger automatic backup file, so we import it',
221-
);
222-
isAutomaticBackup = true;
223-
}
224-
} else {
225-
this.uiLog.log(
226-
'__getBiggerFileBackupOrAutomatic - We didnt found an automatic backup',
227-
);
228-
}
229-
if (isAutomaticBackup) {
230-
this.uiLog.log(
231-
'__getBiggerFileBackupOrAutomatic - Automatic file is bigger then normal zip',
232-
);
233-
fileData = biggestAutomaticBackupFileContent;
234-
return { fileData, isAutomaticBackup };
235-
}
236-
this.uiLog.log(
237-
'__getBiggerFileBackupOrAutomatic - Normal file is bigger then automatic file',
238-
);
239180
fileData = parsedJSON;
240181
return { fileData, isAutomaticBackup };
241-
} else {
242-
this.uiLog.log(
243-
'__getBiggerFileBackupOrAutomatic - We didnt find any normal backup, check automatic backup',
244-
);
245-
if (
246-
biggestAutomaticBackupFileContent &&
247-
'BREWS' in biggestAutomaticBackupFileContent
248-
) {
249-
isAutomaticBackup = true;
250-
this.uiLog.log(
251-
'__getBiggerFileBackupOrAutomatic - We didnt find any normal backup, automatic backup found',
252-
);
253-
fileData = biggestAutomaticBackupFileContent;
254-
return { fileData, isAutomaticBackup };
255-
}
256182
}
257183
}
258184
private async checkBackupAndSeeIfDataAreCorrupted() {

0 commit comments

Comments
 (0)