#724 Add a backfill of the install folder list

This commit is contained in:
jliddev
2021-02-09 22:29:53 -06:00
parent 09da0197e4
commit c7eb87f9c6
2 changed files with 13 additions and 2 deletions

View File

@@ -109,7 +109,8 @@ export class HomeComponent implements AfterViewInit, OnDestroy {
}
private async migrateAddons(clientTypes: WowClientType[]) {
if (!clientTypes || !(await this._wowupService.shouldMigrateAddons())) {
const shouldMigrate = await this._wowupService.shouldMigrateAddons();
if (!clientTypes || !shouldMigrate) {
return clientTypes;
}
@@ -162,7 +163,7 @@ export class HomeComponent implements AfterViewInit, OnDestroy {
});
if (error.innerError instanceof GitHubLimitError) {
const err = error.innerError as GitHubLimitError;
const err = error.innerError;
const max = err.rateLimitMax;
const reset = new Date(err.rateLimitReset * 1000).toLocaleString();
errorMessage = this._translateService.instant("COMMON.ERRORS.GITHUB_LIMIT_ERROR", {

View File

@@ -1269,10 +1269,20 @@ export class AddonService {
const addons = this._addonStorage.getAllForClientType(clientType);
for (const addon of addons) {
await this.backfillAddon(addon);
await this.backfillAddonInstalledFolderList(addon);
}
}
}
private async backfillAddonInstalledFolderList(addon: Addon): Promise<void> {
if (addon.installedFolderList) {
return;
}
addon.installedFolderList = addon.installedFolders?.split(",") ?? [];
this.saveAddon(addon);
}
public async backfillAddon(addon: Addon): Promise<void> {
if (addon.externalIds && this.containsOwnExternalId(addon)) {
return;