Added more pages to precaching

This commit is contained in:
DrMint 2024-07-06 02:42:07 +02:00
parent 5f70ca4b92
commit d3ebc15b77
5 changed files with 176 additions and 165 deletions

View File

@ -87,7 +87,7 @@
- Missing parent page
- Novellas
- https://accords-library.com/contents/folder/dod3-dlc-short-stories
- https://accords-library.com/contents/folder/dod3-dlc-short-stories
- Missing scans

View File

@ -2,6 +2,8 @@
## Ongoing
- [Bugs] No post processing on the 404 page
- [Bugs] Keziah reported some lag spikes when scrolling on the home page (Firefox on Windows)
- [Feat] [Analytics] Add analytics
- [Bugs] [Tooltips] Tooltip in under next element (example in timeline)

View File

@ -39,15 +39,20 @@ export class PageCache {
const locales = languages.filter(({ selectable }) => selectable).map(({ id }) => id);
// Get all pages urls from CMS
const allIds = (await this.uncachedPayload.getAllIds()).data;
const allPagesUrls = [
"/",
...allIds.audios.ids.map((id) => `/audios/${id}`),
...allIds.collectibles.slugs.map((slug) => `/collectibles/${slug}`),
...allIds.files.ids.map((id) => `/files/${id}`),
...allIds.folders.slugs.map((slug) => `/folders/${slug}`),
...allIds.images.ids.map((id) => `/images/${id}`),
...allIds.pages.slugs.map((slug) => `/pages/${slug}`),
...allIds.recorders.ids.map((id) => `/recorders/${id}`),
"/settings",
"/timeline",
...(await this.uncachedPayload.getFolderSlugs()).data.map((slug) => `/folders/${slug}`),
...(await this.uncachedPayload.getPageSlugs()).data.map((slug) => `/pages/${slug}`),
...(await this.uncachedPayload.getCollectibleSlugs()).data.map(
(slug) => `/collectibles/${slug}`
),
...allIds.videos.ids.map((id) => `/videos/${id}`),
].flatMap((url) => locales.map((id) => `/${id}${url}`));
// Load cache from disk if available

View File

@ -1,177 +1,177 @@
{
"disclaimer": "Usage subject to terms: https://openexchangerates.org/terms",
"license": "https://openexchangerates.org/license",
"timestamp": 1719694805,
"timestamp": 1720224013,
"base": "USD",
"rates": {
"AED": 3.673,
"AFN": 71.063715,
"ALL": 93.708843,
"AMD": 388.16,
"ANG": 1.802366,
"AOA": 853.629,
"ARS": 910.493696,
"AUD": 1.496558,
"AFN": 70.984466,
"ALL": 92.477287,
"AMD": 387.714574,
"ANG": 1.79964,
"AOA": 867.5,
"ARS": 914.5812,
"AUD": 1.481189,
"AWG": 1.8025,
"AZN": 1.7,
"BAM": 1.828243,
"BAM": 1.804127,
"BBD": 2,
"BDT": 117.567308,
"BGN": 1.824663,
"BHD": 0.37651,
"BIF": 2877.015756,
"BDT": 117.329615,
"BGN": 1.804215,
"BHD": 0.376503,
"BIF": 2873.508054,
"BMD": 1,
"BND": 1.355347,
"BOB": 6.913636,
"BRL": 5.5936,
"BND": 1.347874,
"BOB": 6.900178,
"BRL": 5.4602,
"BSD": 1,
"BTC": 0.000016406223,
"BTN": 83.51892,
"BWP": 13.588017,
"BYN": 3.274442,
"BZD": 2.016789,
"CAD": 1.36945,
"CDF": 2843.605253,
"CHF": 0.898864,
"CLF": 0.034322,
"CLP": 947.05,
"CNH": 7.29859,
"CNY": 7.2673,
"COP": 4178.502002,
"CRC": 523.103268,
"BTC": 0.000017658176,
"BTN": 83.39968,
"BWP": 13.549191,
"BYN": 3.267898,
"BZD": 2.012739,
"CAD": 1.36425,
"CDF": 2837.871368,
"CHF": 0.8956,
"CLF": 0.033945,
"CLP": 936.65,
"CNH": 7.29077,
"CNY": 7.2688,
"COP": 4082.235918,
"CRC": 524.519899,
"CUC": 1,
"CUP": 25.75,
"CVE": 103.074514,
"CZK": 23.367501,
"DJF": 177.827972,
"DKK": 6.9619,
"DOP": 59.096817,
"DZD": 134.720884,
"EGP": 47.977051,
"CVE": 101.717686,
"CZK": 23.1898,
"DJF": 177.787824,
"DKK": 6.881,
"DOP": 59.06609,
"DZD": 134.121213,
"EGP": 47.937342,
"ERN": 15,
"ETB": 57.758394,
"EUR": 0.932821,
"FJD": 2.2382,
"FKP": 0.790576,
"GBP": 0.790576,
"GEL": 2.8,
"GGP": 0.790576,
"GHS": 15.25842,
"GIP": 0.790576,
"GMD": 67.775,
"GNF": 8612.182198,
"GTQ": 7.771251,
"GYD": 209.334678,
"HKD": 7.80915,
"HNL": 24.765136,
"HRK": 7.03298,
"HTG": 132.555762,
"HUF": 368.78,
"IDR": 16350.45,
"ILS": 3.76595,
"IMP": 0.790576,
"INR": 83.36765,
"IQD": 1310.765417,
"IRR": 42100,
"ISK": 138.78,
"JEP": 0.790576,
"JMD": 156.080264,
"JOD": 0.7087,
"JPY": 160.90493072,
"KES": 129.25,
"KGS": 86.4454,
"KHR": 4110.671159,
"KMF": 459.849919,
"ETB": 57.669475,
"EUR": 0.921886,
"FJD": 2.2272,
"FKP": 0.780457,
"GBP": 0.780457,
"GEL": 2.79,
"GGP": 0.780457,
"GHS": 15.377803,
"GIP": 0.780457,
"GMD": 67.75,
"GNF": 8598.450757,
"GTQ": 7.758903,
"GYD": 208.914867,
"HKD": 7.81485,
"HNL": 24.84,
"HRK": 6.9518,
"HTG": 132.162991,
"HUF": 362.19,
"IDR": 16251.8,
"ILS": 3.6939,
"IMP": 0.780457,
"INR": 83.47225,
"IQD": 1308.065499,
"IRR": 42087.5,
"ISK": 137.98,
"JEP": 0.780457,
"JMD": 156.016762,
"JOD": 0.7088,
"JPY": 160.74508702,
"KES": 128,
"KGS": 85.9,
"KHR": 4112.39226,
"KMF": 455.450306,
"KPW": 900,
"KRW": 1381.28,
"KWD": 0.30676,
"KYD": 0.833423,
"KZT": 466.81538,
"LAK": 22075,
"LBP": 89600,
"LKR": 306.087327,
"LRD": 194.450023,
"LSL": 18.18,
"LYD": 4.875316,
"MAD": 9.940081,
"MDL": 17.830168,
"MGA": 4477.581302,
"MKD": 57.395402,
"MMK": 2481.91,
"KRW": 1377.56,
"KWD": 0.305828,
"KYD": 0.832165,
"KZT": 477.869856,
"LAK": 22056.538131,
"LBP": 89176.753682,
"LKR": 304.318128,
"LRD": 194.11466,
"LSL": 18.196821,
"LYD": 4.863267,
"MAD": 9.855447,
"MDL": 17.774416,
"MGA": 4473.044127,
"MKD": 56.838839,
"MMK": 2203.34,
"MNT": 3450,
"MOP": 8.044281,
"MRU": 39.462689,
"MUR": 47.2,
"MOP": 8.033191,
"MRU": 39.6625,
"MUR": 46.850004,
"MVR": 15.405,
"MWK": 1734.567667,
"MXN": 18.3385,
"MYR": 4.7175,
"MZN": 63.899991,
"NAD": 18.36094,
"NGN": 1406,
"NIO": 36.81119,
"NOK": 10.681139,
"NPR": 133.327095,
"NZD": 1.642037,
"OMR": 0.384965,
"MWK": 1731.464813,
"MXN": 18.108,
"MYR": 4.7105,
"MZN": 63.909993,
"NAD": 18.196821,
"NGN": 1517.5,
"NIO": 36.8,
"NOK": 10.535805,
"NPR": 133.438491,
"NZD": 1.629461,
"OMR": 0.384964,
"PAB": 1,
"PEN": 3.83492,
"PGK": 3.851055,
"PHP": 58.409994,
"PKR": 278.529263,
"PLN": 4.024893,
"PYG": 7540.873261,
"QAR": 3.647595,
"RON": 4.644,
"RSD": 109.291,
"RUB": 85.656885,
"RWF": 1306.491928,
"SAR": 3.751821,
"SBD": 8.43942,
"SCR": 13.852325,
"PEN": 3.788144,
"PGK": 3.844877,
"PHP": 58.522998,
"PKR": 277.970557,
"PLN": 3.952,
"PYG": 7524.632806,
"QAR": 3.6406,
"RON": 4.5924,
"RSD": 107.971,
"RUB": 87.904253,
"RWF": 1316.449015,
"SAR": 3.751203,
"SBD": 8.435801,
"SCR": 13.942916,
"SDG": 601,
"SEK": 10.601,
"SGD": 1.3564,
"SHP": 0.790576,
"SEK": 10.340435,
"SGD": 1.3494,
"SHP": 0.780457,
"SLL": 20969.5,
"SOS": 571.49784,
"SRD": 30.8385,
"SOS": 570.638319,
"SRD": 30.467,
"SSP": 130.26,
"STD": 22281.8,
"STN": 22.878594,
"SVC": 8.755235,
"STN": 22.600642,
"SVC": 8.737685,
"SYP": 2512.53,
"SZL": 18.183346,
"THB": 36.696982,
"TJS": 10.656085,
"TMT": 3.51,
"TND": 3.1465,
"TOP": 2.363716,
"TRY": 32.7383,
"TTD": 6.798721,
"TWD": 32.5195,
"TZS": 2635,
"UAH": 40.51974,
"UGX": 3712.013854,
"SZL": 18.190121,
"THB": 36.428736,
"TJS": 10.639644,
"TMT": 3.5,
"TND": 3.117995,
"TOP": 2.362582,
"TRY": 32.665502,
"TTD": 6.760883,
"TWD": 32.4085,
"TZS": 2651.173793,
"UAH": 40.48328,
"UGX": 3693.630806,
"USD": 1,
"UYU": 39.438456,
"UZS": 12586.719022,
"VES": 36.402496,
"VND": 25455.011984,
"UYU": 39.974162,
"UZS": 12565.611101,
"VES": 36.465943,
"VND": 25416.190524,
"VUV": 118.722,
"WST": 2.8,
"XAF": 611.890574,
"XAG": 0.03431827,
"XAU": 0.00042979,
"XAF": 604.717401,
"XAG": 0.03203024,
"XAU": 0.00041802,
"XCD": 2.70255,
"XDR": 0.759476,
"XOF": 611.890574,
"XPD": 0.00103766,
"XPF": 111.315175,
"XPT": 0.00100724,
"YER": 250.399984,
"ZAR": 18.201,
"ZMW": 25.739177,
"XDR": 0.758452,
"XOF": 604.717401,
"XPD": 0.00097476,
"XPF": 110.010231,
"XPT": 0.00097299,
"YER": 250.375001,
"ZAR": 18.175316,
"ZMW": 24.489757,
"ZWL": 322
}
}

View File

@ -2081,19 +2081,28 @@ export type EndpointAllSDKUrls = {
urls: string[];
};
export type EndpointAllIds = {
collectibles: { slugs: string[] };
pages: { slugs: string[] };
folders: { slugs: string[] };
videos: { ids: string[] };
audios: { ids: string[] };
images: { ids: string[] };
files: { ids: string[] };
recorders: { ids: string[] };
chronologyEvents: { ids: string[] };
};
// SDK
export const getSDKEndpoint = {
getConfigEndpoint: () => `/globals/${Collections.WebsiteConfig}/config`,
getFolderEndpoint: (slug: string) => `/${Collections.Folders}/slug/${slug}`,
getFolderSlugsEndpoint: () => `/${Collections.Folders}/slugs`,
getLanguagesEndpoint: () => `/${Collections.Languages}/all`,
getCurrenciesEndpoint: () => `/${Collections.Currencies}/all`,
getWordingsEndpoint: () => `/${Collections.Wordings}/all`,
getPageEndpoint: (slug: string) => `/${Collections.Pages}/slug/${slug}`,
getPageSlugsEndpoint: () => `/${Collections.Pages}/slugs`,
getCollectibleEndpoint: (slug: string) => `/${Collections.Collectibles}/slug/${slug}`,
getCollectibleSlugsEndpoint: () => `/${Collections.Collectibles}/slugs`,
getCollectibleScansEndpoint: (slug: string) => `/${Collections.Collectibles}/slug/${slug}/scans`,
getCollectibleScanPageEndpoint: (slug: string, index: string) =>
`/${Collections.Collectibles}/slug/${slug}/scans/${index}`,
@ -2109,6 +2118,7 @@ export const getSDKEndpoint = {
getFileByIDEndpoint: (id: string) => `/${Collections.Files}/id/${id}`,
getRecorderByIDEndpoint: (id: string) => `/${Collections.Recorders}/id/${id}`,
getAllSDKUrlsEndpoint: () => `/all-sdk-urls`,
getAllIds: () => `/all-ids`,
getLoginEndpoint: () => `/${Collections.Recorders}/login`,
};
@ -2198,9 +2208,6 @@ export class PayloadSDK {
async getFolder(slug: string): Promise<PayloadSDKResponse<EndpointFolder>> {
return await this.request(getSDKEndpoint.getFolderEndpoint(slug));
}
async getFolderSlugs(): Promise<PayloadSDKResponse<string[]>> {
return await this.request(getSDKEndpoint.getFolderSlugsEndpoint());
}
async getLanguages(): Promise<PayloadSDKResponse<Language[]>> {
return await this.request(getSDKEndpoint.getLanguagesEndpoint());
}
@ -2213,15 +2220,9 @@ export class PayloadSDK {
async getPage(slug: string): Promise<PayloadSDKResponse<EndpointPage>> {
return await this.request(getSDKEndpoint.getPageEndpoint(slug));
}
async getPageSlugs(): Promise<PayloadSDKResponse<string[]>> {
return await this.request(getSDKEndpoint.getPageSlugsEndpoint());
}
async getCollectible(slug: string): Promise<PayloadSDKResponse<EndpointCollectible>> {
return await this.request(getSDKEndpoint.getCollectibleEndpoint(slug));
}
async getCollectibleSlugs(): Promise<PayloadSDKResponse<string[]>> {
return await this.request(getSDKEndpoint.getCollectibleSlugsEndpoint());
}
async getCollectibleScans(slug: string): Promise<PayloadSDKResponse<EndpointCollectibleScans>> {
return await this.request(getSDKEndpoint.getCollectibleScansEndpoint(slug));
}
@ -2266,4 +2267,7 @@ export class PayloadSDK {
async getAllSdkUrls(): Promise<PayloadSDKResponse<EndpointAllSDKUrls>> {
return await this.request(getSDKEndpoint.getAllSDKUrlsEndpoint());
}
async getAllIds(): Promise<PayloadSDKResponse<EndpointAllIds>> {
return await this.request(getSDKEndpoint.getAllIds());
}
}