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 - Missing parent page
- Novellas - Novellas
- https://accords-library.com/contents/folder/dod3-dlc-short-stories - https://accords-library.com/contents/folder/dod3-dlc-short-stories
- Missing scans - Missing scans

View File

@ -2,6 +2,8 @@
## Ongoing ## Ongoing
- [Bugs] No post processing on the 404 page
- [Bugs] Keziah reported some lag spikes when scrolling on the home page (Firefox on Windows) - [Bugs] Keziah reported some lag spikes when scrolling on the home page (Firefox on Windows)
- [Feat] [Analytics] Add analytics - [Feat] [Analytics] Add analytics
- [Bugs] [Tooltips] Tooltip in under next element (example in timeline) - [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); const locales = languages.filter(({ selectable }) => selectable).map(({ id }) => id);
// Get all pages urls from CMS // Get all pages urls from CMS
const allIds = (await this.uncachedPayload.getAllIds()).data;
const allPagesUrls = [ 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", "/settings",
"/timeline", "/timeline",
...(await this.uncachedPayload.getFolderSlugs()).data.map((slug) => `/folders/${slug}`), ...allIds.videos.ids.map((id) => `/videos/${id}`),
...(await this.uncachedPayload.getPageSlugs()).data.map((slug) => `/pages/${slug}`),
...(await this.uncachedPayload.getCollectibleSlugs()).data.map(
(slug) => `/collectibles/${slug}`
),
].flatMap((url) => locales.map((id) => `/${id}${url}`)); ].flatMap((url) => locales.map((id) => `/${id}${url}`));
// Load cache from disk if available // Load cache from disk if available

View File

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

View File

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