Skip to content

Commit

Permalink
Rebase against WowUp v2.12.0 / WowUp.CF v2.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalDJ committed May 8, 2024
1 parent 2608818 commit e160e22
Show file tree
Hide file tree
Showing 8 changed files with 154 additions and 254 deletions.
313 changes: 112 additions & 201 deletions unlimited-patches/01-CurseForgeMerge.patch

Large diffs are not rendered by default.

32 changes: 10 additions & 22 deletions unlimited-patches/10-IncludeTBCAddons.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
--- wowup-electron/src/app/addon-providers/curse-addon-provider.ts
+++ wowup-electron/src/app/addon-providers/curse-addon-provider.ts
@@ -53,23 +53,23 @@
const CHANGELOG_CACHE_TTL_SEC = 30 * 60;
const FEATURED_ADDONS_CACHE_TTL_SEC = AppConfig.featuredAddonsCacheTimeSec;

@@ -57,22 +57,22 @@
const GAME_TYPE_LISTS = [
{
flavor: "wow_classic",
Expand All @@ -15,22 +12,22 @@
flavor: "wow-wrath-classic",
- typeId: 73713,
+ typeId: [73713, 73246],
matches: [WowClientType.Classic, WowClientType.ClassicPtr, WowClientType.ClassicBeta],
matches: [],
},
{
flavor: "wow_retail",
- typeId: 517,
+ typeId: [517],
matches: [WowClientType.Retail, WowClientType.RetailPtr, WowClientType.Beta, WowClientType.RetailXPtr],
},
{
flavor: "wow-cataclysm-classic",
- typeId: 77522,
+ typeId: [77522, 73713, 73246],
matches: [WowClientType.Classic, WowClientType.ClassicPtr, WowClientType.ClassicBeta],
},
];

export class CurseAddonProvider extends AddonProvider {
private readonly _circuitBreaker: CircuitBreakerWrapper;
@@ -480,13 +480,13 @@
private getGameVersionTypeId(clientType: WowClientType): number {
const gameType = GAME_TYPE_LISTS.find((gtl) => gtl.matches.includes(clientType));
if (!gameType) {
@@ -488,7 +488,7 @@
throw new Error(`Game type not found: ${clientType}`);
}

Expand All @@ -39,13 +36,7 @@
}

private hasSortableGameVersion(file: cfv2.CF2File, typeId: number): boolean {
if (!file?.sortableGameVersions) {
console.debug("sortableGameVersions missing", file);
}
@@ -792,13 +792,13 @@
}
}

@@ -802,7 +802,7 @@
private getValidClientTypes(file: cfv2.CF2File): WowClientType[] {
const gameVersions: WowClientType[] = _.flatten(
GAME_TYPE_LISTS.filter((type) =>
Expand All @@ -54,6 +45,3 @@
).map((game) => game.matches),
);

return _.uniq(gameVersions);
}

2 changes: 1 addition & 1 deletion unlimited-patches/11-DisableCurseAds.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- wowup-electron/src/app/addon-providers/curse-addon-provider.ts
+++ wowup-electron/src/app/addon-providers/curse-addon-provider.ts
@@ -79,13 +79,13 @@
@@ -85,13 +85,13 @@
public readonly forceIgnore = false;
public readonly allowChannelChange = true;
public readonly allowReinstall = true;
Expand Down
36 changes: 18 additions & 18 deletions unlimited-patches/12-CustomizableCurseAPIKey.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
import { v4 as uuidv4 } from "uuid";
import {
Addon,
@@ -29,6 +30,7 @@
@@ -32,6 +33,7 @@
ADDON_PROVIDER_CURSEFORGE,
NO_LATEST_SEARCH_RESULT_FILES_ERROR,
NO_SEARCH_RESULTS_ERROR,
+ PREF_CF2_API_KEY,
} from "../../common/constants";
import { getWowClientGroup } from "../../common/warcraft";
import { AppConfig } from "../../environments/environment";
@@ -38,6 +40,7 @@
import * as AddonUtils from "../utils/addon.utils";
import { CachingService } from "../services/caching/caching-service";
@@ -39,6 +41,7 @@
import { TocService } from "../services/toc/toc.service";
import { strictFilter } from "../utils/array.utils";
import { TocNotFoundError } from "../errors";
+import { SensitiveStorageService } from "../services/storage/sensitive-storage.service";

interface ProtocolData {
addonId: number;
@@ -73,7 +76,7 @@
@@ -79,7 +82,7 @@

export class CurseAddonProvider extends AddonProvider {
private readonly _circuitBreaker: CircuitBreakerWrapper;
Expand All @@ -32,15 +32,15 @@

public readonly name = ADDON_PROVIDER_CURSEFORGE;
public readonly forceIgnore = false;
@@ -89,6 +92,7 @@
@@ -95,6 +98,7 @@
private _cachingService: CachingService,
private _networkService: NetworkService,
private _tocService: TocService,
+ private _sensitiveStorageService: SensitiveStorageService,
) {
super();

@@ -98,8 +102,9 @@
@@ -104,8 +108,9 @@
AppConfig.curseforge.httpTimeoutMs,
);

Expand All @@ -52,7 +52,7 @@
});
}

@@ -344,13 +349,18 @@
@@ -350,13 +355,18 @@
return;
}

Expand All @@ -72,7 +72,7 @@
const fingerprintData = result.data?.data;
try {
const matchPairs: ScanMatchPair[] = [];
@@ -378,7 +388,7 @@
@@ -383,7 +393,7 @@
}

const addonIds = matchPairs.map((mp) => mp.match.id);
Expand All @@ -81,7 +81,7 @@
const addonResultData = getAddonsResult.data?.data;

const potentialChildren: ScanMatchPair[] = [];
@@ -423,12 +433,13 @@
@@ -428,12 +438,13 @@
externalReleaseId: string,
): Promise<string> {
try {
Expand All @@ -96,7 +96,7 @@
},
CHANGELOG_CACHE_TTL_SEC,
);
@@ -443,11 +454,13 @@
@@ -448,11 +459,13 @@

public override async getDescription(installation: WowInstallation, externalId: string): Promise<string> {
try {
Expand All @@ -111,7 +111,7 @@
},
CHANGELOG_CACHE_TTL_SEC,
);
@@ -624,8 +637,9 @@
@@ -629,8 +642,9 @@
}

private async getAddonFileById(addonId: string | number, fileId: string | number): Promise<cfv2.CF2File | undefined> {
Expand All @@ -122,7 +122,7 @@
);

return response.data?.data;
@@ -633,7 +647,8 @@
@@ -638,7 +652,8 @@

private async getByIdBase(addonId: string): Promise<cfv2.CF2Addon | undefined> {
try {
Expand All @@ -132,7 +132,7 @@
return response.data?.data;
} catch (e) {
// We want to eat things like 400/500 responses
@@ -811,12 +826,19 @@
@@ -818,12 +833,19 @@
modIds: addonIds,
};

Expand All @@ -153,7 +153,7 @@
const gameVersionTypeId = this.getGameVersionTypeId(wowInstallation.clientType);

const request: cfv2.CF2GetFeaturedModsRequest = {
@@ -828,7 +850,7 @@
@@ -835,7 +857,7 @@
const cacheKey = `getFeaturedAddonList-${JSON.stringify(request)}`;
const result = await this._cachingService.transaction(
cacheKey,
Expand All @@ -162,7 +162,7 @@
FEATURED_ADDONS_CACHE_TTL_SEC,
);

@@ -861,7 +883,8 @@
@@ -868,7 +890,8 @@
gameVersionTypeId: this.getCFGameVersionType(clientType),
};

Expand All @@ -172,7 +172,7 @@

return response.data?.data || [];
}
@@ -904,10 +927,29 @@
@@ -911,10 +934,29 @@

const cacheKey = JSON.stringify(request);

Expand Down Expand Up @@ -296,7 +296,7 @@
} catch (e) {
--- wowup-electron/src/assets/i18n/en.json
+++ wowup-electron/src/assets/i18n/en.json
@@ -497,6 +497,7 @@
@@ -498,6 +498,7 @@
"CURSE_FORGE_V2": {
"API_KEY_DESCRIPTION": "If you have requested a CurseForge API key you can input it here to connect to their API.",
"API_KEY_TITLE": "CurseForge API Key",
Expand Down
10 changes: 5 additions & 5 deletions unlimited-patches/13-DisableWagoAds.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- wowup-electron/src/app/addon-providers/wago-addon-provider.ts
+++ wowup-electron/src/app/addon-providers/wago-addon-provider.ts
@@ -167,12 +167,14 @@
@@ -165,12 +165,14 @@
const WAGO_SEARCH_CACHE_TIME_SEC = 60;
const WAGO_DETAILS_CACHE_TIME_SEC = 60;
const WAGO_FEATURED_ADDONS_CACHE_TIME_SEC = 60;
Expand All @@ -15,7 +15,7 @@

// This is our internal http queue, prevents duplicated requests for some routes
private _requestQueue: Map<string, Promise<any>> = new Map();
@@ -181,7 +183,7 @@
@@ -179,7 +181,7 @@
public readonly forceIgnore = false;
public enabled = true;
public authRequired = true;
Expand All @@ -24,7 +24,7 @@
public allowEdit = true;
public allowReinstall = true;
public allowChannelChange = true;
@@ -210,11 +212,13 @@
@@ -208,11 +210,13 @@
.pipe(filter((change) => change.key == PREF_WAGO_ACCESS_KEY))
.subscribe((change) => {
console.log("[wago] wago secret set", change);
Expand All @@ -38,7 +38,7 @@
}
});

@@ -223,12 +227,15 @@
@@ -221,12 +225,15 @@
.pipe(
first(),
tap((accessKey) => {
Expand All @@ -55,7 +55,7 @@
}),
catchError((e) => {
console.error("[wago] failed to load secret key", e);
@@ -763,6 +770,28 @@
@@ -762,6 +769,28 @@
}
}

Expand Down
2 changes: 1 addition & 1 deletion unlimited-patches/14-CurseMigrationDialog.patch
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
disableClose: true,
--- wowup-electron/src/assets/i18n/en.json
+++ wowup-electron/src/assets/i18n/en.json
@@ -500,6 +500,7 @@
@@ -501,6 +501,7 @@
"INSERT_API_KEY": "Insert Default CurseForge API Key",
"PROVIDER_NOTE": "API Key Required"
},
Expand Down
12 changes: 6 additions & 6 deletions unlimited-patches/19-RevertOverwolfIntegration.patch
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@
}
--- wowup-electron/package-lock.json
+++ wowup-electron/package-lock.json
@@ -55,14 +55,12 @@
@@ -54,14 +54,12 @@
"@fortawesome/free-regular-svg-icons": "6.4.2",
"@fortawesome/free-solid-svg-icons": "6.4.2",
"@messageformat/core": "3.2.0",
"@microsoft/applicationinsights-web": "3.0.5",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
- "@overwolf/ow-electron": "22.3.27",
- "@overwolf/ow-electron-builder": "24.7.0",
- "@overwolf/ow-electron": "28.2.5",
- "@overwolf/ow-electron-builder": "24.13.4",
"@types/adm-zip": "0.5.1",
"@types/flat": "5.0.2",
"@types/globrex": "0.1.2",
Expand Down Expand Up @@ -137,15 +137,15 @@
"i18n": "sync-i18n --files ./src/assets/i18n/*.json --primary en --space 2 --finalnewline --lineendings CRLF --languages cs de es fr it nb pt ru zh zh-TW ko pl",
"check-i18n": "npm run i18n -- --check",
"pretty": "npx prettier --write . && ng lint --fix",
@@ -103,14 +103,12 @@
@@ -102,14 +102,12 @@
"@fortawesome/free-regular-svg-icons": "6.4.2",
"@fortawesome/free-solid-svg-icons": "6.4.2",
"@messageformat/core": "3.2.0",
"@microsoft/applicationinsights-web": "3.0.5",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
- "@overwolf/ow-electron": "22.3.27",
- "@overwolf/ow-electron-builder": "24.7.0",
- "@overwolf/ow-electron": "28.2.5",
- "@overwolf/ow-electron-builder": "24.13.4",
"@types/adm-zip": "0.5.1",
"@types/flat": "5.0.2",
"@types/globrex": "0.1.2",
Expand Down
1 change: 1 addition & 0 deletions unlimited-patches/orphans.lst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ wowup-electron/src/app/addon-providers/curse-addon-provider.ts
wowup-electron/src/app/components/options/options-curseforge-section/options-curseforge-section.component.html
wowup-electron/src/app/components/options/options-curseforge-section/options-curseforge-section.component.scss
wowup-electron/src/app/components/options/options-curseforge-section/options-curseforge-section.component.ts
wowup-electron/src/app/utils/markdown.utlils.ts
wowup-electron/src/common/curse/curse-models.ts

0 comments on commit e160e22

Please sign in to comment.