gengxin
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* 发布环境可覆盖这些值。
|
||||
*
|
||||
* cdnBaseUrl 默认留空:未配置合法 HTTPS 下载域名时,AssetManager 会直接
|
||||
* 使用包内种子图或返回文字回退,不会发起网络请求。
|
||||
*/
|
||||
module.exports = {
|
||||
cdnBaseUrl: '',
|
||||
imageCacheBudgetBytes: 28 * 1024 * 1024,
|
||||
audioCacheBudgetBytes: 32 * 1024 * 1024,
|
||||
audioCacheMaxEntries: 32,
|
||||
prefetchAhead: 2,
|
||||
downloadConcurrency: 2,
|
||||
}
|
||||
@@ -0,0 +1,911 @@
|
||||
/**
|
||||
* 发布固定资产清单 v1
|
||||
*
|
||||
* 约束:
|
||||
* 1. 页面只保存稳定的 assetId,不直接拼 CDN 地址。
|
||||
* 2. remotePath 必须包含对应文件内容哈希的前 12 位,发布后不可覆盖。
|
||||
* 3. 医学结论、判断答案和行动建议必须随代码包发布,不得放进远端资产。
|
||||
* 4. localSeed 是当前小程序包内的安全回退;以后迁移 CDN 时可按资产逐项移除。
|
||||
*/
|
||||
|
||||
const RELEASE_ASSET_MANIFEST_VERSION = 1
|
||||
|
||||
const releaseAssets = {
|
||||
'comic.s01.c01.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-game/assets/comic/s01-c01/S01-C01-P01-title-v1.jpg',
|
||||
remotePath: 'comic/s01-c01/S01-C01-P01-title-v1.12163b7f4667.jpg',
|
||||
sha256: '12163b7f466766af13a75024189aa28441627f67a6623b1c4b99b29110ecb35a',
|
||||
},
|
||||
'comic.s01.c01.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/comic/s01-c01/S01-C01-P02-missing-table-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c01/S01-C01-P02-missing-table-ensemble-v1.f34fe1faf167.jpg',
|
||||
sha256: 'f34fe1faf167da590dd36595c80803f1ba8740576e600ee3c1d004bbbd4a26f0',
|
||||
},
|
||||
'comic.s01.c01.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-game/assets/comic/s01-c01/S01-C01-P03-H01-scan-only-v1.jpg',
|
||||
remotePath: 'comic/s01-c01/S01-C01-P03-H01-scan-only-v1.6e0d20c4055f.jpg',
|
||||
sha256: '6e0d20c4055ff20b8b2d47a12edb5902c89d7440334a1783acd11133d854ad80',
|
||||
},
|
||||
'comic.s01.c01.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-game/assets/comic/s01-c01/S01-C01-P04-H02-extra-dish-v1.jpg',
|
||||
remotePath: 'comic/s01-c01/S01-C01-P04-H02-extra-dish-v1.bcef17dda041.jpg',
|
||||
sha256: 'bcef17dda041c5e21e43281160ee09ded3fbb89b052e92da27fd50c7b78640ce',
|
||||
},
|
||||
'comic.s01.c01.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-game/assets/comic/s01-c01/S01-C01-P05-H03-four-imprints-v1.jpg',
|
||||
remotePath: 'comic/s01-c01/S01-C01-P05-H03-four-imprints-v1.d2e1becd9c12.jpg',
|
||||
sha256: 'd2e1becd9c12c80f7c90e63755454d618fa3741ca1c2685e04fe11f408130f5f',
|
||||
},
|
||||
'comic.s01.c01.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-game/assets/comic/s01-c01/S01-C01-P06-H04-unsaid-speech-v1.jpg',
|
||||
remotePath: 'comic/s01-c01/S01-C01-P06-H04-unsaid-speech-v1.7bc229ef1f1c.jpg',
|
||||
sha256: '7bc229ef1f1c5dc127f7e2be75dfac62a3a485984584e0caf6cf096792e03750',
|
||||
},
|
||||
'comic.s01.c01.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-game/assets/comic/s01-c01/S01-C01-P07-EM01-call-zhao-in-v1.jpg',
|
||||
remotePath: 'comic/s01-c01/S01-C01-P07-EM01-call-zhao-in-v1.4a19c49a53ea.jpg',
|
||||
sha256: '4a19c49a53eaee3d775d0b0a8965a6478d4976d820584b0abb364790294c6f31',
|
||||
},
|
||||
'comic.s01.c01.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-game/assets/comic/s01-c01/S01-C01-P08-cliffhanger-v1.jpg',
|
||||
remotePath: 'comic/s01-c01/S01-C01-P08-cliffhanger-v1.7db63c3725ee.jpg',
|
||||
sha256: '7db63c3725ee5a1ca8ad71c67746e7cd0234ed21fee07030fc1158ccd0161d69',
|
||||
},
|
||||
'comic.s01.c02.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-02/assets/comic/s01-c02/S01-C02-P01-title-v1.jpg',
|
||||
remotePath: 'comic/s01-c02/S01-C02-P01-title-v1.c32093483c58.jpg',
|
||||
sha256: 'c32093483c588ab38465e16f1c4a6bf230a0c6433925df91cf588e57fca05552',
|
||||
},
|
||||
'comic.s01.c02.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-02/assets/comic/s01-c02/S01-C02-P02-exhibit-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c02/S01-C02-P02-exhibit-ensemble-v1.892de611f097.jpg',
|
||||
sha256: '892de611f097d6562eb7d632eb29e91da28b5fc1c141ab4911da52c0f8f869ea',
|
||||
},
|
||||
'comic.s01.c02.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-02/assets/comic/s01-c02/S01-C02-P03-H05-meal-ticket-label-v1.jpg',
|
||||
remotePath: 'comic/s01-c02/S01-C02-P03-H05-meal-ticket-label-v1.e725c333849e.jpg',
|
||||
sha256: 'e725c333849e13dc342c01448eb34bf02b269946d4a8a40843044c7ab5f4803c',
|
||||
},
|
||||
'comic.s01.c02.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-02/assets/comic/s01-c02/S01-C02-P04-H06-bowl-direction-v1.jpg',
|
||||
remotePath: 'comic/s01-c02/S01-C02-P04-H06-bowl-direction-v1.ac89e35c3692.jpg',
|
||||
sha256: 'ac89e35c369254b81cfa0c9b350c6d485d637eb8642c13952ef6b26c889b9593',
|
||||
},
|
||||
'comic.s01.c02.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-02/assets/comic/s01-c02/S01-C02-P05-H07-photo-edge-clues-v1.jpg',
|
||||
remotePath: 'comic/s01-c02/S01-C02-P05-H07-photo-edge-clues-v1.cda630c13f31.jpg',
|
||||
sha256: 'cda630c13f31745e3ad6308cca179337c6c9c11dd33c6473f3f769d614662a4d',
|
||||
},
|
||||
'comic.s01.c02.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-02/assets/comic/s01-c02/S01-C02-P06-H08-plaque-reverse-v1.jpg',
|
||||
remotePath: 'comic/s01-c02/S01-C02-P06-H08-plaque-reverse-v1.61d413562200.jpg',
|
||||
sha256: '61d413562200e3a40ded87c77c1b6c887331810ae03ef2a5b6b533cc4a7ff541',
|
||||
},
|
||||
'comic.s01.c02.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-02/assets/comic/s01-c02/S01-C02-P07-EM02-slow-recognition-v1.jpg',
|
||||
remotePath: 'comic/s01-c02/S01-C02-P07-EM02-slow-recognition-v1.c7a28411b1d7.jpg',
|
||||
sha256: 'c7a28411b1d72d708d0c22a38b1ac3e2ccf3faac85056d603790d3c4ac3ee539',
|
||||
},
|
||||
'comic.s01.c02.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-02/assets/comic/s01-c02/S01-C02-P08-clock-to-1978-v1.jpg',
|
||||
remotePath: 'comic/s01-c02/S01-C02-P08-clock-to-1978-v1.6c0eed6b964e.jpg',
|
||||
sha256: '6c0eed6b964edb72f13810a32bcfa3509f28f002dedd4bb25c9fc89f4a594703',
|
||||
},
|
||||
'comic.s01.c03.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-03/assets/comic/s01-c03/S01-C03-P01-title-v1.jpg',
|
||||
remotePath: 'comic/s01-c03/S01-C03-P01-title-v1.7aaefa1ff157.jpg',
|
||||
sha256: '7aaefa1ff15756b6808abd6476b3e8d666fc011cc83760acaa89b8aeb60e26a4',
|
||||
},
|
||||
'comic.s01.c03.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-03/assets/comic/s01-c03/S01-C03-P02-canteen-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c03/S01-C03-P02-canteen-ensemble-v1.feb9f3243262.jpg',
|
||||
sha256: 'feb9f324326284127c8579153e7fba5ac32cf0e72687ea35b92986dcb7f94dd5',
|
||||
},
|
||||
'comic.s01.c03.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-03/assets/comic/s01-c03/S01-C03-P03-H09-oily-hand-bun-v1.jpg',
|
||||
remotePath: 'comic/s01-c03/S01-C03-P03-H09-oily-hand-bun-v1.841146ea446b.jpg',
|
||||
sha256: '841146ea446b6d42e703f02c1f88446f1e8fde1f7f64fb8d3f3dc4ba01d1b95e',
|
||||
},
|
||||
'comic.s01.c03.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-03/assets/comic/s01-c03/S01-C03-P04-H10-bench-balance-v1.jpg',
|
||||
remotePath: 'comic/s01-c03/S01-C03-P04-H10-bench-balance-v1.8a838a7d0bac.jpg',
|
||||
sha256: '8a838a7d0bac89fe6d728cc2002f5cf4578659d7b5f4619efdaaa386e5a7d727',
|
||||
},
|
||||
'comic.s01.c03.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-03/assets/comic/s01-c03/S01-C03-P05-H11-staple-era-context-v1.jpg',
|
||||
remotePath: 'comic/s01-c03/S01-C03-P05-H11-staple-era-context-v1.cbd7d426ee42.jpg',
|
||||
sha256: 'cbd7d426ee427c16429066feff5afd0300e65ac73dc25beb134ed4947ddc6b79',
|
||||
},
|
||||
'comic.s01.c03.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-03/assets/comic/s01-c03/S01-C03-P06-H12-two-clips-v1.jpg',
|
||||
remotePath: 'comic/s01-c03/S01-C03-P06-H12-two-clips-v1.00e5034f636a.jpg',
|
||||
sha256: '00e5034f636aed3b8be3bfecf8be84a12b2dd80763876a5df31eaa81540d77f1',
|
||||
},
|
||||
'comic.s01.c03.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-03/assets/comic/s01-c03/S01-C03-P07-EM03-ask-tired-v1.jpg',
|
||||
remotePath: 'comic/s01-c03/S01-C03-P07-EM03-ask-tired-v1.787bf794fd53.jpg',
|
||||
sha256: '787bf794fd536bbab6bbb0e2ba9fe68193b74dbb1810ddf3929f8f332c4df602',
|
||||
},
|
||||
'comic.s01.c03.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-03/assets/comic/s01-c03/S01-C03-P08-third-bowl-cliffhanger-v1.jpg',
|
||||
remotePath: 'comic/s01-c03/S01-C03-P08-third-bowl-cliffhanger-v1.056ef8b3017c.jpg',
|
||||
sha256: '056ef8b3017c857574093fd86478fab7d349261202ca65919129219a2f2dd4e5',
|
||||
},
|
||||
'comic.s01.c04.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-04/assets/comic/s01-c04/S01-C04-P01-title-v1.jpg',
|
||||
remotePath: 'comic/s01-c04/S01-C04-P01-title-v1.e20d8bd83bfb.jpg',
|
||||
sha256: 'e20d8bd83bfb6084bf4aac30078fda6a5024bbf1be46a7b40e001fc510e05a30',
|
||||
},
|
||||
'comic.s01.c04.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-04/assets/comic/s01-c04/S01-C04-P02-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c04/S01-C04-P02-ensemble-v1.d83c35c61a7c.jpg',
|
||||
sha256: 'd83c35c61a7cff187fbc8e0a8bb5355f856413c6ebddfb32ef69d92f0dea9505',
|
||||
},
|
||||
'comic.s01.c04.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-04/assets/comic/s01-c04/S01-C04-P03-H13-ladle-contest-v1.jpg',
|
||||
remotePath: 'comic/s01-c04/S01-C04-P03-H13-ladle-contest-v1.c90b76c43463.jpg',
|
||||
sha256: 'c90b76c43463f456c5323a06734f8c5e48f81938990d1715a1f3807bea1ce3d4',
|
||||
},
|
||||
'comic.s01.c04.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-04/assets/comic/s01-c04/S01-C04-P04-H14-belt-table-v1.jpg',
|
||||
remotePath: 'comic/s01-c04/S01-C04-P04-H14-belt-table-v1.70da80c5dd1d.jpg',
|
||||
sha256: '70da80c5dd1d40279540cd1fcc657aaf6a99ece7a36a81c979f734a78fecf5d7',
|
||||
},
|
||||
'comic.s01.c04.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-04/assets/comic/s01-c04/S01-C04-P05-H15-water-reminder-v1.jpg',
|
||||
remotePath: 'comic/s01-c04/S01-C04-P05-H15-water-reminder-v1.4f4212b949b9.jpg',
|
||||
sha256: '4f4212b949b9e25bdc5041d0dc0c1c4a8e2d1247efc387b424573e58b01eff3a',
|
||||
},
|
||||
'comic.s01.c04.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-04/assets/comic/s01-c04/S01-C04-P06-H16-stool-bowl-v1.jpg',
|
||||
remotePath: 'comic/s01-c04/S01-C04-P06-H16-stool-bowl-v1.25834d3e9082.jpg',
|
||||
sha256: '25834d3e908299dff9f74442eebf615d5eaf1dce22d06b2e5739a3e2a1ba8cc2',
|
||||
},
|
||||
'comic.s01.c04.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-04/assets/comic/s01-c04/S01-C04-P07-EM04-face-saving-pause-v1.jpg',
|
||||
remotePath: 'comic/s01-c04/S01-C04-P07-EM04-face-saving-pause-v1.3f741e4ac31c.jpg',
|
||||
sha256: '3f741e4ac31cb55ad4a2956d07b183ecb665e297f4612f7ba8c6c3f6becc971d',
|
||||
},
|
||||
'comic.s01.c04.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-04/assets/comic/s01-c04/S01-C04-P08-cliffhanger-v1.jpg',
|
||||
remotePath: 'comic/s01-c04/S01-C04-P08-cliffhanger-v1.9558ee49f2e2.jpg',
|
||||
sha256: '9558ee49f2e2b6b53eff173425a2adc31969f8532ff584b94980bd51b757fe61',
|
||||
},
|
||||
'comic.s01.c05.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-05/assets/comic/s01-c05/S01-C05-P01-title-v1.jpg',
|
||||
remotePath: 'comic/s01-c05/S01-C05-P01-title-v1.52a79ac178e6.jpg',
|
||||
sha256: '52a79ac178e6b0a154c9918010f16be797cb62d63624f820a69c6a0cd3fcc2ef',
|
||||
},
|
||||
'comic.s01.c05.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-05/assets/comic/s01-c05/S01-C05-P02-late-shift-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c05/S01-C05-P02-late-shift-ensemble-v1.897aa558fe7d.jpg',
|
||||
sha256: '897aa558fe7d0f4b607686d82c48c435522664c125627a023819f7ca2ad4ccfb',
|
||||
},
|
||||
'comic.s01.c05.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-05/assets/comic/s01-c05/S01-C05-P03-H17-empty-window-v1.jpg',
|
||||
remotePath: 'comic/s01-c05/S01-C05-P03-H17-empty-window-v1.76ac18af26da.jpg',
|
||||
sha256: '76ac18af26da9f5b6a9a2007fd6cf4cc81f584659c293c774222a7359bec0e22',
|
||||
},
|
||||
'comic.s01.c05.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-05/assets/comic/s01-c05/S01-C05-P04-H18-half-bun-v1.jpg',
|
||||
remotePath: 'comic/s01-c05/S01-C05-P04-H18-half-bun-v1.c9506ed1fe98.jpg',
|
||||
sha256: 'c9506ed1fe983ec7d467ade84a6b0807401292d18e8ba85a5507173e8c11d23c',
|
||||
},
|
||||
'comic.s01.c05.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-05/assets/comic/s01-c05/S01-C05-P05-H19-relit-stove-v1.jpg',
|
||||
remotePath: 'comic/s01-c05/S01-C05-P05-H19-relit-stove-v1.a88bbf597302.jpg',
|
||||
sha256: 'a88bbf597302146baf361469aa904cd9c126d411ce76feb7d1d1dd520ee783e8',
|
||||
},
|
||||
'comic.s01.c05.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-05/assets/comic/s01-c05/S01-C05-P06-H20-seat-at-table-v1.jpg',
|
||||
remotePath: 'comic/s01-c05/S01-C05-P06-H20-seat-at-table-v1.63adf03d0d30.jpg',
|
||||
sha256: '63adf03d0d305435bf17865cb4f17e28c8c3fad9274c730010a4f4580f75f8ca',
|
||||
},
|
||||
'comic.s01.c05.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-05/assets/comic/s01-c05/S01-C05-P07-EM05-light-for-latecomers-v1.jpg',
|
||||
remotePath: 'comic/s01-c05/S01-C05-P07-EM05-light-for-latecomers-v1.172fc27a2252.jpg',
|
||||
sha256: '172fc27a22529f5d6a3c12b60ec5b36a34620b50af2ab7b475287c3b70dd1567',
|
||||
},
|
||||
'comic.s01.c05.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-05/assets/comic/s01-c05/S01-C05-P08-first-photo-v1.jpg',
|
||||
remotePath: 'comic/s01-c05/S01-C05-P08-first-photo-v1.b85b2852a7dc.jpg',
|
||||
sha256: 'b85b2852a7dc274f866923f429451e488c1cd6436c62892db3e62a8952c06f3f',
|
||||
},
|
||||
'comic.s01.c06.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-06/assets/comic/s01-c06/S01-C06-P01-title-v1.jpg',
|
||||
remotePath: 'comic/s01-c06/S01-C06-P01-title-v1.f7039560e49d.jpg',
|
||||
sha256: 'f7039560e49d68615812a9d154c095e69ec04aa6a60f06f4f14822ea36d91d40',
|
||||
},
|
||||
'comic.s01.c06.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-06/assets/comic/s01-c06/S01-C06-P02-sign-flip-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c06/S01-C06-P02-sign-flip-ensemble-v1.0b4519763ba5.jpg',
|
||||
sha256: '0b4519763ba53e001fa8bd6903fea84c25c97cf9e6049a05bba684da1e3ec6ae',
|
||||
},
|
||||
'comic.s01.c06.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-06/assets/comic/s01-c06/S01-C06-P03-H21-contract-boundary-v1.jpg',
|
||||
remotePath: 'comic/s01-c06/S01-C06-P03-H21-contract-boundary-v1.caf57f377be3.jpg',
|
||||
sha256: 'caf57f377be31f6c018859d7e0b2149f1ce39b8ad95473a86f4e4c1f52b11f75',
|
||||
},
|
||||
'comic.s01.c06.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-06/assets/comic/s01-c06/S01-C06-P04-H22-ticket-cash-hands-v1.jpg',
|
||||
remotePath: 'comic/s01-c06/S01-C06-P04-H22-ticket-cash-hands-v1.f05b92fd22c2.jpg',
|
||||
sha256: 'f05b92fd22c222f61ea75dab51e2a0b27682362ea6f1e2ccc1e990cf11c2b469',
|
||||
},
|
||||
'comic.s01.c06.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-06/assets/comic/s01-c06/S01-C06-P05-H23-covered-staff-meal-v1.jpg',
|
||||
remotePath: 'comic/s01-c06/S01-C06-P05-H23-covered-staff-meal-v1.408f43b54b2b.jpg',
|
||||
sha256: '408f43b54b2b0f7aa5c8fade4ff917a7461333dbfec8f44f6ee1f7b66671b88d',
|
||||
},
|
||||
'comic.s01.c06.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-06/assets/comic/s01-c06/S01-C06-P06-H24-protect-table-v1.jpg',
|
||||
remotePath: 'comic/s01-c06/S01-C06-P06-H24-protect-table-v1.84156df566a6.jpg',
|
||||
sha256: '84156df566a673834861d991505b43495894fd3a7bbd87478ce4bdcf7d616e53',
|
||||
},
|
||||
'comic.s01.c06.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-06/assets/comic/s01-c06/S01-C06-P07-EM06-keep-seat-v1.jpg',
|
||||
remotePath: 'comic/s01-c06/S01-C06-P07-EM06-keep-seat-v1.c61d898fd982.jpg',
|
||||
sha256: 'c61d898fd982b5c7953ca8dc448a8d96e5c5a3894a5647707b0290a8a3b0cc9b',
|
||||
},
|
||||
'comic.s01.c06.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-06/assets/comic/s01-c06/S01-C06-P08-table-held-cliffhanger-v1.jpg',
|
||||
remotePath: 'comic/s01-c06/S01-C06-P08-table-held-cliffhanger-v1.bcb8ec7e4720.jpg',
|
||||
sha256: 'bcb8ec7e472079206983c8e6b897ad9d611a70a280251b0cdd85462938de59a5',
|
||||
},
|
||||
'comic.s01.c07.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-07/assets/comic/s01-c07/S01-C07-P01-title-v1.jpg',
|
||||
remotePath: 'comic/s01-c07/S01-C07-P01-title-v1.42031fff6b37.jpg',
|
||||
sha256: '42031fff6b3722bac2c389babd6f1eb283cb0b013d1c9a055292e585888dc720',
|
||||
},
|
||||
'comic.s01.c07.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-07/assets/comic/s01-c07/S01-C07-P02-opening-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c07/S01-C07-P02-opening-ensemble-v1.81e28334e743.jpg',
|
||||
sha256: '81e28334e74358e7549d2ee82bd48d7bbcf16bf424274cdf4dc568f9f040aed2',
|
||||
},
|
||||
'comic.s01.c07.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-07/assets/comic/s01-c07/S01-C07-P03-H25-full-bowl-v1.jpg',
|
||||
remotePath: 'comic/s01-c07/S01-C07-P03-H25-full-bowl-v1.fb9d1cd9910d.jpg',
|
||||
sha256: 'fb9d1cd9910dfd50c039404134443e760e6afffc9ab19eeafb528de46d6a69a5',
|
||||
},
|
||||
'comic.s01.c07.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-07/assets/comic/s01-c07/S01-C07-P04-H26-ladle-across-table-v1.jpg',
|
||||
remotePath: 'comic/s01-c07/S01-C07-P04-H26-ladle-across-table-v1.8e12ab04091a.jpg',
|
||||
sha256: '8e12ab04091a938f2155573ae0d30896f668e3c2b77a3185481dc75156950ba3',
|
||||
},
|
||||
'comic.s01.c07.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-07/assets/comic/s01-c07/S01-C07-P05-H27-door-and-watch-v1.jpg',
|
||||
remotePath: 'comic/s01-c07/S01-C07-P05-H27-door-and-watch-v1.5d65745996d6.jpg',
|
||||
sha256: '5d65745996d614acd9d38d960467658cbeea6c638e15a27861a73e2114ae01f4',
|
||||
},
|
||||
'comic.s01.c07.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-07/assets/comic/s01-c07/S01-C07-P06-H28-shift-table-v1.jpg',
|
||||
remotePath: 'comic/s01-c07/S01-C07-P06-H28-shift-table-v1.7365643f439b.jpg',
|
||||
sha256: '7365643f439bbb1d2a87f9995e3e34f7383eae1754738e2ab69a54fe54a45c6a',
|
||||
},
|
||||
'comic.s01.c07.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-07/assets/comic/s01-c07/S01-C07-P07-EM07-listen-until-finished-v1.jpg',
|
||||
remotePath: 'comic/s01-c07/S01-C07-P07-EM07-listen-until-finished-v1.19ea61163655.jpg',
|
||||
sha256: '19ea6116365526daa302aa43f9354cfd127ade2308808df565ac60ae6cb1aff5',
|
||||
},
|
||||
'comic.s01.c07.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-07/assets/comic/s01-c07/S01-C07-P08-order-slip-cliffhanger-v1.jpg',
|
||||
remotePath: 'comic/s01-c07/S01-C07-P08-order-slip-cliffhanger-v1.f7f84ebecba2.jpg',
|
||||
sha256: 'f7f84ebecba290ae9aa9f5b1960896b2151c3a1964011835d64c80cee0fa073e',
|
||||
},
|
||||
'comic.s01.c08.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-08/assets/comic/s01-c08/S01-C08-P01-title-v1.jpg',
|
||||
remotePath: 'comic/s01-c08/S01-C08-P01-title-v1.b292709d6f22.jpg',
|
||||
sha256: 'b292709d6f22e6865125f75c8b9b753a61467b09c90012b97eb206829fc64ddc',
|
||||
},
|
||||
'comic.s01.c08.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-08/assets/comic/s01-c08/S01-C08-P02-opening-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c08/S01-C08-P02-opening-ensemble-v1.4b755190ba3d.jpg',
|
||||
sha256: '4b755190ba3d8d9e879b89bc9579909792b7ae82059ad73bf4a4d62bfb27b562',
|
||||
},
|
||||
'comic.s01.c08.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-08/assets/comic/s01-c08/S01-C08-P03-H29-extra-dishes-v1.jpg',
|
||||
remotePath: 'comic/s01-c08/S01-C08-P03-H29-extra-dishes-v1.2a5bc840cc2d.jpg',
|
||||
sha256: '2a5bc840cc2dee6d4952ee632dc537ad7368034edbe416ff18cfef65b7a2689c',
|
||||
},
|
||||
'comic.s01.c08.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-08/assets/comic/s01-c08/S01-C08-P04-H30-rejected-box-v1.jpg',
|
||||
remotePath: 'comic/s01-c08/S01-C08-P04-H30-rejected-box-v1.737e9996a8f3.jpg',
|
||||
sha256: '737e9996a8f3d67a253d84455bfd2e96341a05e144d4b649e844875eb8eaf935',
|
||||
},
|
||||
'comic.s01.c08.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-08/assets/comic/s01-c08/S01-C08-P05-H31-menu-gaps-v1.jpg',
|
||||
remotePath: 'comic/s01-c08/S01-C08-P05-H31-menu-gaps-v1.41da420b4e7b.jpg',
|
||||
sha256: '41da420b4e7b8c585950a998d32a5cb44e6b1fc855dbd7f403c4d786f49bf618',
|
||||
},
|
||||
'comic.s01.c08.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-08/assets/comic/s01-c08/S01-C08-P06-H32-removed-plaque-v1.jpg',
|
||||
remotePath: 'comic/s01-c08/S01-C08-P06-H32-removed-plaque-v1.fb66a9f2234c.jpg',
|
||||
sha256: 'fb66a9f2234c6159678334201138e8236b4dd3f5cbc239cce0ec1e41dcddf111',
|
||||
},
|
||||
'comic.s01.c08.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-08/assets/comic/s01-c08/S01-C08-P07-EM08-back-kitchen-light-v1.jpg',
|
||||
remotePath: 'comic/s01-c08/S01-C08-P07-EM08-back-kitchen-light-v1.6c748cf7c1a6.jpg',
|
||||
sha256: '6c748cf7c1a6ea69a4be5eff221cda903e6a60f30fef95b4d7623b8d74aa54ea',
|
||||
},
|
||||
'comic.s01.c08.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-08/assets/comic/s01-c08/S01-C08-P08-cashbox-phone-cliffhanger-v1.jpg',
|
||||
remotePath: 'comic/s01-c08/S01-C08-P08-cashbox-phone-cliffhanger-v1.2deaee916f92.jpg',
|
||||
sha256: '2deaee916f92a02b7e326770ad0a6ec59410347cd1ea7133cbf61193fd7f4743',
|
||||
},
|
||||
'comic.s01.c09.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-09/assets/comic/s01-c09/S01-C09-P01-opening-memory-v1.jpg',
|
||||
remotePath: 'comic/s01-c09/S01-C09-P01-opening-memory-v1.59db94b9c5dd.jpg',
|
||||
sha256: '59db94b9c5dd52822089ebdb749959c9f2b780e16d5e6acb21cd4deb082efc2f',
|
||||
},
|
||||
'comic.s01.c09.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-09/assets/comic/s01-c09/S01-C09-P02-opening-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c09/S01-C09-P02-opening-ensemble-v1.0584053b2e87.jpg',
|
||||
sha256: '0584053b2e873ed91d448b2b643666e93f1733ef22dd641dfe9cdb4665d49e8d',
|
||||
},
|
||||
'comic.s01.c09.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-09/assets/comic/s01-c09/S01-C09-P03-H33-driver-no-alcohol-v1.jpg',
|
||||
remotePath: 'comic/s01-c09/S01-C09-P03-H33-driver-no-alcohol-v1.9081d9c71e8f.jpg',
|
||||
sha256: '9081d9c71e8f07c687428192cd51bb59b7a7dad9dc4ab630d924a9cd7cbc26af',
|
||||
},
|
||||
'comic.s01.c09.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-09/assets/comic/s01-c09/S01-C09-P04-H34-tea-toast-v1.jpg',
|
||||
remotePath: 'comic/s01-c09/S01-C09-P04-H34-tea-toast-v1.cf00e6434a90.jpg',
|
||||
sha256: 'cf00e6434a902127999662a040917b6807e36e4d20384426e0fb014f8eae33ff',
|
||||
},
|
||||
'comic.s01.c09.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-09/assets/comic/s01-c09/S01-C09-P05-H35-personal-plan-text-supported-v1-ffq2.jpg',
|
||||
remotePath: 'comic/s01-c09/S01-C09-P05-H35-personal-plan-text-supported-v1-ffq2.5de6f5b46666.jpg',
|
||||
sha256: '5de6f5b466664980c159f1c442be226297ea5d2832a4791ed6eda3acb18a085a',
|
||||
},
|
||||
'comic.s01.c09.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-09/assets/comic/s01-c09/S01-C09-P06-H36-stop-and-stay-v1.jpg',
|
||||
remotePath: 'comic/s01-c09/S01-C09-P06-H36-stop-and-stay-v1.5bb10be0addb.jpg',
|
||||
sha256: '5bb10be0addb68102b9b83569596523113c2b6e2053cc14cbe2b082807e55443',
|
||||
},
|
||||
'comic.s01.c09.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-09/assets/comic/s01-c09/S01-C09-P07-EM09-keep-my-seat-v1.jpg',
|
||||
remotePath: 'comic/s01-c09/S01-C09-P07-EM09-keep-my-seat-v1.9f4b4b8b1aa9.jpg',
|
||||
sha256: '9f4b4b8b1aa98844603c0c5539a89196032663d341a444dc9512b9b81c8a6e4f',
|
||||
},
|
||||
'comic.s01.c09.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-09/assets/comic/s01-c09/S01-C09-P08-push-cup-cliffhanger-v1-ffq2.jpg',
|
||||
remotePath: 'comic/s01-c09/S01-C09-P08-push-cup-cliffhanger-v1-ffq2.b3628d1471f2.jpg',
|
||||
sha256: 'b3628d1471f2c227db9a1cd2b1e00c5c92503aa7ef39fc602c054d8edc67e724',
|
||||
},
|
||||
'comic.s01.c10.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-10/assets/comic/s01-c10/S01-C10-P01-one-palm-space-v1.jpg',
|
||||
remotePath: 'comic/s01-c10/S01-C10-P01-one-palm-space-v1.42d2b657a20f.jpg',
|
||||
sha256: '42d2b657a20f5db8e18e80155301c902132c911f57fda32e32752435675ec1d8',
|
||||
},
|
||||
'comic.s01.c10.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-10/assets/comic/s01-c10/S01-C10-P02-opening-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c10/S01-C10-P02-opening-ensemble-v1.30c7fa3f8e9a.jpg',
|
||||
sha256: '30c7fa3f8e9af47a3289049c4e029e9c9888de93cb1a6af2dc5d19c906a3ae55',
|
||||
},
|
||||
'comic.s01.c10.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-10/assets/comic/s01-c10/S01-C10-P03-H37-standing-meal-v1.jpg',
|
||||
remotePath: 'comic/s01-c10/S01-C10-P03-H37-standing-meal-v1.23e14923a5fd.jpg',
|
||||
sha256: '23e14923a5fd3db39424fd764b1d795b2cb88e73293e1534ff2fa493e3ad05b9',
|
||||
},
|
||||
'comic.s01.c10.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-10/assets/comic/s01-c10/S01-C10-P04-H38-open-palm-v3.jpg',
|
||||
remotePath: 'comic/s01-c10/S01-C10-P04-H38-open-palm-v3.be147c9d7c0c.jpg',
|
||||
sha256: 'be147c9d7c0c5bccc7b5ddac206314c2ff96d8d424c27c0d01d87e9497f99cde',
|
||||
},
|
||||
'comic.s01.c10.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-10/assets/comic/s01-c10/S01-C10-P05-H39-phone-and-cold-meal-v1.jpg',
|
||||
remotePath: 'comic/s01-c10/S01-C10-P05-H39-phone-and-cold-meal-v1.a21bec0d89b6.jpg',
|
||||
sha256: 'a21bec0d89b6d5322a7e8ee11679ab89c89f8e4ffc8afbea0387bed5b359e5dd',
|
||||
},
|
||||
'comic.s01.c10.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-10/assets/comic/s01-c10/S01-C10-P06-H40-table-not-usable-v1.jpg',
|
||||
remotePath: 'comic/s01-c10/S01-C10-P06-H40-table-not-usable-v1.6fa3594b0e5a.jpg',
|
||||
sha256: '6fa3594b0e5ac61c432c9ee3d833c0f13bf757437c1cac6700d30826becca446',
|
||||
},
|
||||
'comic.s01.c10.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-10/assets/comic/s01-c10/S01-C10-P07-EM10-put-meal-down-v1.jpg',
|
||||
remotePath: 'comic/s01-c10/S01-C10-P07-EM10-put-meal-down-v1.139439432818.jpg',
|
||||
sha256: '13943943281892dced9132e2454c8e3b914dfda4d905668e5ed1b4d54dc6cb99',
|
||||
},
|
||||
'comic.s01.c10.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-10/assets/comic/s01-c10/S01-C10-P08-plan-line-last-stool-v1.jpg',
|
||||
remotePath: 'comic/s01-c10/S01-C10-P08-plan-line-last-stool-v1.2499342b7c3c.jpg',
|
||||
sha256: '2499342b7c3c92c101c264e59c700217989aa1157e2a95a55520ab968b4ee1a0',
|
||||
},
|
||||
'comic.s01.c11.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-11/assets/comic/s01-c11/S01-C11-P01-pen-above-paper-v1.jpg',
|
||||
remotePath: 'comic/s01-c11/S01-C11-P01-pen-above-paper-v1.840b82256bca.jpg',
|
||||
sha256: '840b82256bca2a83bc655aa86faf0025dbd5fea3a75bd5eec4c32b974f74bb2a',
|
||||
},
|
||||
'comic.s01.c11.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-11/assets/comic/s01-c11/S01-C11-P02-opening-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c11/S01-C11-P02-opening-ensemble-v1.112f4fe7b4f9.jpg',
|
||||
sha256: '112f4fe7b4f90a65e0769cdf78b00e2ede90b2206ca031c1fd0dc8e71bc19ff1',
|
||||
},
|
||||
'comic.s01.c11.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-11/assets/comic/s01-c11/S01-C11-P03-H41-display-and-seat-v1.jpg',
|
||||
remotePath: 'comic/s01-c11/S01-C11-P03-H41-display-and-seat-v1.23ef59f3f23d.jpg',
|
||||
sha256: '23ef59f3f23dbc3de7dcde1fd1994ff4d2321bab5218aa0197f6fae797cf2e51',
|
||||
},
|
||||
'comic.s01.c11.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-11/assets/comic/s01-c11/S01-C11-P04-H42-inspect-old-table-v1.jpg',
|
||||
remotePath: 'comic/s01-c11/S01-C11-P04-H42-inspect-old-table-v1.3e93fafafe75.jpg',
|
||||
sha256: '3e93fafafe758c040aec7a2cd0f21bc1cf71656db593cc0babe65e99c69d0a50',
|
||||
},
|
||||
'comic.s01.c11.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-11/assets/comic/s01-c11/S01-C11-P05-H43-clear-passage-v1.jpg',
|
||||
remotePath: 'comic/s01-c11/S01-C11-P05-H43-clear-passage-v1.c0c8c01f4e37.jpg',
|
||||
sha256: 'c0c8c01f4e376f29ccfbfe8b84094f79d85839afbab1d09d5301740a10311ad5',
|
||||
},
|
||||
'comic.s01.c11.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-11/assets/comic/s01-c11/S01-C11-P06-H44-pen-before-signature-v1.jpg',
|
||||
remotePath: 'comic/s01-c11/S01-C11-P06-H44-pen-before-signature-v1.4a805d19bb22.jpg',
|
||||
sha256: '4a805d19bb229c6f6df349f06fffe9acfebc3176bcf0f3b63de12e328468ca6c',
|
||||
},
|
||||
'comic.s01.c11.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-11/assets/comic/s01-c11/S01-C11-P07-EM11-wrap-and-record-v1.jpg',
|
||||
remotePath: 'comic/s01-c11/S01-C11-P07-EM11-wrap-and-record-v1.9fb66ad32712.jpg',
|
||||
sha256: '9fb66ad32712d5ad9e8ea85e4631e2ecf5bbc7d900a49066095c45579497a79a',
|
||||
},
|
||||
'comic.s01.c11.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-11/assets/comic/s01-c11/S01-C11-P08-can-we-open-now-v1.jpg',
|
||||
remotePath: 'comic/s01-c11/S01-C11-P08-can-we-open-now-v1.b80149fb0407.jpg',
|
||||
sha256: 'b80149fb0407529bf25dcd4188e79bc9d17a25e794b2d8e735b189792090e1de',
|
||||
},
|
||||
'comic.s01.c12.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-12/assets/comic/s01-c12/S01-C12-P01-key-pauses-half-turn-v1.jpg',
|
||||
remotePath: 'comic/s01-c12/S01-C12-P01-key-pauses-half-turn-v1.e7f7138b21bb.jpg',
|
||||
sha256: 'e7f7138b21bb415ff7f3fee4427973d475c5d24bf749bc0ee6bb05d8b06fee0a',
|
||||
},
|
||||
'comic.s01.c12.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-12/assets/comic/s01-c12/S01-C12-P02-modern-table-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c12/S01-C12-P02-modern-table-ensemble-v1.6d2ba8cf6cfe.jpg',
|
||||
sha256: '6d2ba8cf6cfe0212976b65986eda881c893673933d319a9a0579adebbf373602',
|
||||
},
|
||||
'comic.s01.c12.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-12/assets/comic/s01-c12/S01-C12-P03-H45-provenance-chain-v1.jpg',
|
||||
remotePath: 'comic/s01-c12/S01-C12-P03-H45-provenance-chain-v1.c07a27557685.jpg',
|
||||
sha256: 'c07a27557685087e0d7c772f2288d99e6847db42099ae32c72ded6f4003b18e9',
|
||||
},
|
||||
'comic.s01.c12.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-12/assets/comic/s01-c12/S01-C12-P04-H46-real-choice-counter-v1.jpg',
|
||||
remotePath: 'comic/s01-c12/S01-C12-P04-H46-real-choice-counter-v1.1a5c07f21eae.jpg',
|
||||
sha256: '1a5c07f21eaed0cdf76cec99129176cb9f8c0f608e985e5e2bfbe6e38cf1190e',
|
||||
},
|
||||
'comic.s01.c12.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-12/assets/comic/s01-c12/S01-C12-P05-H47-plus-minus-at-family-table-v1.jpg',
|
||||
remotePath: 'comic/s01-c12/S01-C12-P05-H47-plus-minus-at-family-table-v1.695c7ebf0573.jpg',
|
||||
sha256: '695c7ebf057367e728775292c2c483f66b4b7df757e568dfa247bf7a90cdb5f0',
|
||||
},
|
||||
'comic.s01.c12.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-12/assets/comic/s01-c12/S01-C12-P06-H48-card-is-not-a-promise-v1.jpg',
|
||||
remotePath: 'comic/s01-c12/S01-C12-P06-H48-card-is-not-a-promise-v1.9b332e2a0d6d.jpg',
|
||||
sha256: '9b332e2a0d6dcd499963a3ae7184aa02ce752705ba3526da3bee6a6080abed76',
|
||||
},
|
||||
'comic.s01.c12.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-12/assets/comic/s01-c12/S01-C12-P07-EM12-hand-choice-back-v1.jpg',
|
||||
remotePath: 'comic/s01-c12/S01-C12-P07-EM12-hand-choice-back-v1.338240b0bc54.jpg',
|
||||
sha256: '338240b0bc5417c467024398bc891d099a10c76384861a5ab794bdd0fcae8db5',
|
||||
},
|
||||
'comic.s01.c12.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-12/assets/comic/s01-c12/S01-C12-P08-rolled-speech-cliffhanger-v1.jpg',
|
||||
remotePath: 'comic/s01-c12/S01-C12-P08-rolled-speech-cliffhanger-v1.a6aeee055eed.jpg',
|
||||
sha256: 'a6aeee055eed00449f1945a5e6c1f01c9a1b7e63e96224b115bedf23f051cb6f',
|
||||
},
|
||||
'comic.s01.c13.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-13/assets/comic/s01-c13/S01-C13-P01-three-chopsticks-collide-v1.jpg',
|
||||
remotePath: 'comic/s01-c13/S01-C13-P01-three-chopsticks-collide-v1.2184f354e70f.jpg',
|
||||
sha256: '2184f354e70f1255420a8f1da36fdbe9f7b1f7150818a21bdb434ffabf582e7e',
|
||||
},
|
||||
'comic.s01.c13.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-13/assets/comic/s01-c13/S01-C13-P02-opening-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c13/S01-C13-P02-opening-ensemble-v1.a9abf81e15a6.jpg',
|
||||
sha256: 'a9abf81e15a66c0ae9e757e1f690947728a4c17a7a67059c50c4ed72a9f26198',
|
||||
},
|
||||
'comic.s01.c13.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-13/assets/comic/s01-c13/S01-C13-P03-H49-ask-before-serving-v1.jpg',
|
||||
remotePath: 'comic/s01-c13/S01-C13-P03-H49-ask-before-serving-v1.13813c3961f7.jpg',
|
||||
sha256: '13813c3961f74c0b29810f9caab66f0a9b3b24ef15324f82ec30340f2cae4f9b',
|
||||
},
|
||||
'comic.s01.c13.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-13/assets/comic/s01-c13/S01-C13-P04-H50-name-card-leaves-first-v1.jpg',
|
||||
remotePath: 'comic/s01-c13/S01-C13-P04-H50-name-card-leaves-first-v1.d4002bf11c74.jpg',
|
||||
sha256: 'd4002bf11c746f495a13903447afe6b28c2cb13f4c69b32f512f7a4400baa44d',
|
||||
},
|
||||
'comic.s01.c13.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-13/assets/comic/s01-c13/S01-C13-P05-H51-family-double-standard-v1.jpg',
|
||||
remotePath: 'comic/s01-c13/S01-C13-P05-H51-family-double-standard-v1.2c5923ca40e2.jpg',
|
||||
sha256: '2c5923ca40e232135128842308948099bad5e2e8f4ed481c4030b72965329aff',
|
||||
},
|
||||
'comic.s01.c13.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-13/assets/comic/s01-c13/S01-C13-P06-H52-tape-stays-rolled-v1.jpg',
|
||||
remotePath: 'comic/s01-c13/S01-C13-P06-H52-tape-stays-rolled-v1.8ccbb50e6342.jpg',
|
||||
sha256: '8ccbb50e6342c3063c060291583c9960b9b9bbc8fa747308558e88368516173d',
|
||||
},
|
||||
'comic.s01.c13.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-13/assets/comic/s01-c13/S01-C13-P07-EM13-listen-to-child-v1.jpg',
|
||||
remotePath: 'comic/s01-c13/S01-C13-P07-EM13-listen-to-child-v1.edac7d0ccb9f.jpg',
|
||||
sha256: 'edac7d0ccb9f0c1306265a53e6188e900a918558ef379ac9537ca07e0b68d45b',
|
||||
},
|
||||
'comic.s01.c13.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-13/assets/comic/s01-c13/S01-C13-P08-cook-crosses-threshold-v1.jpg',
|
||||
remotePath: 'comic/s01-c13/S01-C13-P08-cook-crosses-threshold-v1.f40996a2f7d0.jpg',
|
||||
sha256: 'f40996a2f7d01d33c6413fa018e049bbbada0a5cc774bbc68a364f2cefa79dcc',
|
||||
},
|
||||
'comic.s01.c14.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-14/assets/comic/s01-c14/S01-C14-P01-lid-opens-old-scent-v1.jpg',
|
||||
remotePath: 'comic/s01-c14/S01-C14-P01-lid-opens-old-scent-v1.6609c450b024.jpg',
|
||||
sha256: '6609c450b0246d0f00cb1358d2deaba7dbe25ef4287e81fcf46eb761a70248f2',
|
||||
},
|
||||
'comic.s01.c14.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-14/assets/comic/s01-c14/S01-C14-P02-responsibility-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c14/S01-C14-P02-responsibility-ensemble-v1.15678b028566.jpg',
|
||||
sha256: '15678b0285667a5ce84e0f486d8c8ee9ffe60ef59a6850dfcadfc0b400febd48',
|
||||
},
|
||||
'comic.s01.c14.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-14/assets/comic/s01-c14/S01-C14-P03-H53-ordinary-soup-no-myth-v1.jpg',
|
||||
remotePath: 'comic/s01-c14/S01-C14-P03-H53-ordinary-soup-no-myth-v1.9d1a6e4c130a.jpg',
|
||||
sha256: '9d1a6e4c130ad9e3873c1c73dfcadd58c216b2cc87f85c3228a2a8d5d448d365',
|
||||
},
|
||||
'comic.s01.c14.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-14/assets/comic/s01-c14/S01-C14-P04-H54-evidence-chain-v1.jpg',
|
||||
remotePath: 'comic/s01-c14/S01-C14-P04-H54-evidence-chain-v1.899c26b37f6a.jpg',
|
||||
sha256: '899c26b37f6a0ff45d13bdad0ef14c2015467f669da5ffbeb712feaf60db256e',
|
||||
},
|
||||
'comic.s01.c14.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-14/assets/comic/s01-c14/S01-C14-P05-H55-doctor-takes-ordinary-seat-v1.jpg',
|
||||
remotePath: 'comic/s01-c14/S01-C14-P05-H55-doctor-takes-ordinary-seat-v1.b87841f55cc9.jpg',
|
||||
sha256: 'b87841f55cc96f46cd199a65098ff2d4e0085da7cecf1b880d7fa073dff03801',
|
||||
},
|
||||
'comic.s01.c14.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-14/assets/comic/s01-c14/S01-C14-P06-H56-tea-stays-in-the-circle-v1.jpg',
|
||||
remotePath: 'comic/s01-c14/S01-C14-P06-H56-tea-stays-in-the-circle-v1.c17546b0c7e9.jpg',
|
||||
sha256: 'c17546b0c7e960ea8cae5fcc2cfd7e5daef907a3ecbc49d4e7823f6cf99ab3bd',
|
||||
},
|
||||
'comic.s01.c14.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-14/assets/comic/s01-c14/S01-C14-P07-EM14-watch-face-down-v1.jpg',
|
||||
remotePath: 'comic/s01-c14/S01-C14-P07-EM14-watch-face-down-v1.d0bcbbb428bc.jpg',
|
||||
sha256: 'd0bcbbb428bc9aeb5c53b0bbff2b3b6bb8b0eb3391a35ee2229e9f825b302b8d',
|
||||
},
|
||||
'comic.s01.c14.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-14/assets/comic/s01-c14/S01-C14-P08-measure-the-empty-place-v1.jpg',
|
||||
remotePath: 'comic/s01-c14/S01-C14-P08-measure-the-empty-place-v1.09f5a22c8a7f.jpg',
|
||||
sha256: '09f5a22c8a7f63deb287191b1758eed82e838b3a0a3bd6f753122a6ed946cf2c',
|
||||
},
|
||||
'comic.s01.c15.p01': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-15/assets/comic/s01-c15/S01-C15-P01-chair-opens-for-late-workers-v1.jpg',
|
||||
remotePath: 'comic/s01-c15/S01-C15-P01-chair-opens-for-late-workers-v1.194fda1fa427.jpg',
|
||||
sha256: '194fda1fa427f25c020af7395caa55fffbc546843c724561402a20f3f2d5b8ab',
|
||||
},
|
||||
'comic.s01.c15.p02': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-15/assets/comic/s01-c15/S01-C15-P02-everyone-makes-room-ensemble-v1.jpg',
|
||||
remotePath: 'comic/s01-c15/S01-C15-P02-everyone-makes-room-ensemble-v1.b0e82af85954.jpg',
|
||||
sha256: 'b0e82af85954a2bd1da0676810fdbd40f3357a756442768332d67768d217fd8b',
|
||||
},
|
||||
'comic.s01.c15.p03': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-15/assets/comic/s01-c15/S01-C15-P03-H57-three-real-portions-v1.jpg',
|
||||
remotePath: 'comic/s01-c15/S01-C15-P03-H57-three-real-portions-v1.b3838eb91bea.jpg',
|
||||
sha256: 'b3838eb91bea2b1f246540996f796265912a5b6dd38abc215646db65c4560173',
|
||||
},
|
||||
'comic.s01.c15.p04': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-15/assets/comic/s01-c15/S01-C15-P04-H58-water-within-reach-v1.jpg',
|
||||
remotePath: 'comic/s01-c15/S01-C15-P04-H58-water-within-reach-v1.2471d7dd78aa.jpg',
|
||||
sha256: '2471d7dd78aaea522d00454592863e36df6402211f25fdc7687f55d7c42383ea',
|
||||
},
|
||||
'comic.s01.c15.p05': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-15/assets/comic/s01-c15/S01-C15-P05-H59-ask-before-serving-v1.jpg',
|
||||
remotePath: 'comic/s01-c15/S01-C15-P05-H59-ask-before-serving-v1.215691878476.jpg',
|
||||
sha256: '21569187847697f005939f8ff56a5144a3c15e06041749b6fbfa44374787540a',
|
||||
},
|
||||
'comic.s01.c15.p06': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-15/assets/comic/s01-c15/S01-C15-P06-H60-check-before-packing-v1.jpg',
|
||||
remotePath: 'comic/s01-c15/S01-C15-P06-H60-check-before-packing-v1.3f1cd9abb08e.jpg',
|
||||
sha256: '3f1cd9abb08e28239b612b77f17cdd533efd976e39e4b4d4010fbd7598dbdf50',
|
||||
},
|
||||
'comic.s01.c15.p07': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-15/assets/comic/s01-c15/S01-C15-P07-EM15-old-bowl-before-choice-v1.jpg',
|
||||
remotePath: 'comic/s01-c15/S01-C15-P07-EM15-old-bowl-before-choice-v1.98a32b939746.jpg',
|
||||
sha256: '98a32b939746dc1fa8c039ecba168f9290007f93527c9e355ee25e6aa7796e98',
|
||||
},
|
||||
'comic.s01.c15.p08': {
|
||||
kind: 'image',
|
||||
localSeed: '/package-chapter-15/assets/comic/s01-c15/S01-C15-P08-people-seated-season-close-v2.jpg',
|
||||
remotePath: 'comic/s01-c15/S01-C15-P08-people-seated-season-close-v2.520d68ce0a72.jpg',
|
||||
sha256: '520d68ce0a7297e431b335d7171d3d4a8acf598c4759ef1502ef945d43e0f113',
|
||||
},
|
||||
'character.female-cook': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/female-cook.jpg',
|
||||
remotePath: 'characters/female-cook.c56420b2c632.jpg',
|
||||
sha256: 'c56420b2c632315aab3a44317b38358f5823424c97f80a1a8e046b0ad7ffec4f',
|
||||
},
|
||||
'character.lele': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/lele.jpg',
|
||||
remotePath: 'characters/lele.807f5232b1e8.jpg',
|
||||
sha256: '807f5232b1e8a855dac0147bbdb203237d586ee00e2234e50ca1f30a107cc168',
|
||||
},
|
||||
'character.lin-xiulan': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/lin-xiulan.jpg',
|
||||
remotePath: 'characters/lin-xiulan.56e84abec4e5.jpg',
|
||||
sha256: '56e84abec4e5bfa7bf1167197d1cf73e7a5cd170bf39dbe1d6123b64b0648361',
|
||||
},
|
||||
'character.qin-xiaoman': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/qin-xiaoman.jpg',
|
||||
remotePath: 'characters/qin-xiaoman.22fa229d5b09.jpg',
|
||||
sha256: '22fa229d5b091943e2ff14a200205bb69081c6bfb467ffdb26685af65c6a2cb5',
|
||||
},
|
||||
'character.qin-zhicheng': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/qin-zhicheng.jpg',
|
||||
remotePath: 'characters/qin-zhicheng.7f4be48ece92.jpg',
|
||||
sha256: '7f4be48ece925311081874279c63c0f5758ace85629e2b28a5f19efac0ac34d2',
|
||||
},
|
||||
'character.tang-mingyuan': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/tang-mingyuan.jpg',
|
||||
remotePath: 'characters/tang-mingyuan.5ca2fa88f885.jpg',
|
||||
sha256: '5ca2fa88f88596f3618147e6679da0c1f7d116c476fec7c424e4ebc70ff5aceb',
|
||||
},
|
||||
'character.tang-shouan': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/tang-shouan.jpg',
|
||||
remotePath: 'characters/tang-shouan.4ed8d25ca911.jpg',
|
||||
sha256: '4ed8d25ca9111f8a6a8597c355ad45c0e9f010c778b4e108d9b9126498f51b89',
|
||||
},
|
||||
'character.xiaozhen': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/xiaozhen.jpg',
|
||||
remotePath: 'characters/xiaozhen.d5e9614f6006.jpg',
|
||||
sha256: 'd5e9614f60061b11914d8bfc70fa5ab18ae9c3a00bcd5e4de85dcb058e5174cb',
|
||||
},
|
||||
'character.zhao-jianguo': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/characters/zhao-jianguo.jpg',
|
||||
remotePath: 'characters/zhao-jianguo.1c393fb68b02.jpg',
|
||||
sha256: '1c393fb68b020b7f27bde617fb663cd943f8e184b1e78d63506cf6821a88c8e0',
|
||||
},
|
||||
'scene.gui-xiang.1978': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/scenes/gui-xiang-1978.jpg',
|
||||
remotePath: 'scenes/gui-xiang-1978.bb21d9342e37.jpg',
|
||||
sha256: 'bb21d9342e370ba3aed9b47555a3b77e1be48674f786aaf0ca753245c978a5d5',
|
||||
},
|
||||
'scene.gui-xiang.1995': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/scenes/gui-xiang-1995.jpg',
|
||||
remotePath: 'scenes/gui-xiang-1995.a9701e2d55ad.jpg',
|
||||
sha256: 'a9701e2d55ad94819becf074072f63e21d6cfbbcfbe58a483ac2e35ee10d206f',
|
||||
},
|
||||
'scene.gui-xiang.1998': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/scenes/gui-xiang-1998.jpg',
|
||||
remotePath: 'scenes/gui-xiang-1998.d4d7bebfd04a.jpg',
|
||||
sha256: 'd4d7bebfd04a8b755ba393699708f8971b525fc29f57b457334f73c525d1be14',
|
||||
},
|
||||
'scene.gui-xiang.2001': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/scenes/gui-xiang-2001.jpg',
|
||||
remotePath: 'scenes/gui-xiang-2001.9143455b349d.jpg',
|
||||
sha256: '9143455b349d990d141c6d971a90c31295ec56665502f3d0c55feee6517cfba8',
|
||||
},
|
||||
'scene.gui-xiang.2003': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/scenes/gui-xiang-2003.jpg',
|
||||
remotePath: 'scenes/gui-xiang-2003.68349c74c916.jpg',
|
||||
sha256: '68349c74c9168d16edb91ad308e3071e70b9a9b9abebb21bca8291df1e1f3431',
|
||||
},
|
||||
'scene.gui-xiang.2008': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/scenes/gui-xiang-2008.jpg',
|
||||
remotePath: 'scenes/gui-xiang-2008.c0fd9418aec2.jpg',
|
||||
sha256: 'c0fd9418aec24f2599d52167f15dbba1b1696295df309a931e125da530bc62f5',
|
||||
},
|
||||
'scene.gui-xiang.2026': {
|
||||
kind: 'image',
|
||||
localSeed: '/assets/scenes/gui-xiang-2026.jpg',
|
||||
remotePath: 'scenes/gui-xiang-2026.55e63e85388e.jpg',
|
||||
sha256: '55e63e85388e3c64d63167aadbfce3d0b62762d55aeb144a02508bd67cb2c6a7',
|
||||
},
|
||||
'audio.cast-audition.v1': {
|
||||
kind: 'audio',
|
||||
reviewStatus: 'audition',
|
||||
localSeed: '',
|
||||
remotePath: 'audio/cast-audition-v1.7129d884f445.mp3',
|
||||
sha256: '7129d884f44542434e131efb86f2f5619bedf188a1d8b21e7d0864131b58dd18',
|
||||
},
|
||||
}
|
||||
|
||||
// Legacy C01 cue-level seeds are retained as immutable backup assets only.
|
||||
// The reader no longer maps them as page narration; C01 uses full-page tracks
|
||||
// through the two package-local audio player pages instead.
|
||||
for (const cueId of [
|
||||
'S01-C01-MS007','S01-C01-MS010',
|
||||
]) {
|
||||
const file = `${cueId}.mp3`
|
||||
const sha256 = {
|
||||
'S01-C01-MS007': '1ebae89180bcfef9d1efd174bc6be466593e59fd43366af50603cc5d2c71dde8', 'S01-C01-MS010': '628e19cea16a617c2600d9321339aaa78da683fd33b9c1fd6482a870702ee597',
|
||||
}[cueId]
|
||||
releaseAssets[`audio.s01.c01.${cueId.toLowerCase()}`] = { kind: 'audio', reviewStatus: 'approved', localSeed: `/package-game/assets/audio/${file}`, remotePath: `audio/${file}.${sha256.slice(0, 12)}.mp3`, sha256 }
|
||||
}
|
||||
|
||||
const audioC02Sha256 = {
|
||||
'S01-C02-MS001': '580bbaa7effcdbd1af308842b79943069d22753d74ca9d27f6bf24e216f07233',
|
||||
'S01-C02-MS002-ATTR': 'aa54f392e8d035d9952cfc8ff127d1bd7069f12e8c6c3a08b9c10da349fb46a8',
|
||||
'S01-C02-MS002': 'ccb9fb8872e49880a5e11105b2c721cddef264fa248120989a61806c99995ffe',
|
||||
'S01-C02-MS003': '3f3fc816f6e79d4ee83ab36cd1c2986c9898254bb097582124c50c529bed169f',
|
||||
'S01-C02-MS004': 'e9099bad6986b0a6f48094fb033305045d1d97813d42d46b131186d43a639f7c',
|
||||
'S01-C02-MS005': '6ac0d1f9bea8f4a3280ccad178cdd1976c8735b7bd63c261385a493fee44d34e',
|
||||
'S01-C02-MS006': '067715e6a3715433d499bfd55cd637a6d1f149e6b78b37588d5675c3429f3e88',
|
||||
'S01-C02-MS007': '7d2c022a7e2a4ccb0bb9690fe7cea6cb677f390255e71a7727e9dc22b0511a8c',
|
||||
'S01-C02-MS008': '288131da5b75ec8257345d0aa1c99c3b5ec534435ca02f7040ebbd5542cf940f',
|
||||
'S01-C02-MS009': '5ad03edbc491459429fcd8098a3c56f86f5d4519eca75a8427bdd5a4a50fcda2',
|
||||
'S01-C02-MS010': 'd371d1db33d9adbc2b0f8f8fbb9b0d15cd81a43cb3585d261d73a122608ce71d',
|
||||
'S01-C02-MS011': '2606be3875e8461b102d0417326c2d8cf44207c5cd6662cda6e75ee50fe0baeb',
|
||||
'S01-C02-MS012': '33dc5837d97a745024e080ab76c11af33d492c707e129338a11b9662c64d5b9a',
|
||||
'S01-C02-MT000': '5085e1471366cd7296a1e5bc170b80a26e24d7dff33d768b11fe3f3b7f56586e',
|
||||
'S01-C02-TE900': 'd57638264944a9bb87a3433006f70eba01b08ba7d3220a50d358bbfc77b6a9c1',
|
||||
}
|
||||
|
||||
const audioC03Sha256 = {
|
||||
'S01-C03-MS001': 'b27feb03e2f5db957fa0e81aa5b9ca3e498620cfd2521fdb70b1252343fb9c43',
|
||||
'S01-C03-MS002-ATTR': 'ea3de72562174a4e1b48480b368401df890b2becf98e3fdadb46e58eb3a771dd',
|
||||
'S01-C03-MS002': 'c108896a42d9ec316c7c1dea41d3855edaf577c85e16efede0b28e10613cf83c',
|
||||
'S01-C03-MS003': 'af5b0743979b0ae87c7e0c7a17b20940eebe75ab9cd1bb6b29ce63afc6039184',
|
||||
'S01-C03-MS004': 'c131d2d80ad17a7e6bad708efc919c6349269d320b20eee2dae3393f906f27da',
|
||||
'S01-C03-MS005-ATTR': '4ad0fd3ea4ef7996a95fce3201ecbb05754ea9af08e87f4a03ab664ccf9c6a6e',
|
||||
'S01-C03-MS005': '46de0ae7e37f855412bda3e441fe3d537bb7979f5db0260508dccfd1b543a442',
|
||||
'S01-C03-MS006': '2ae6d3ae24430162941f5ecdb4d426a4e865e6fab0ee37b1445eca1c71a374f5',
|
||||
'S01-C03-MS007-ATTR': 'f172cf850e6f90e8209b7691d5ecd6af637c6bc4f1cbe25206cbe9e78ebcb0c0',
|
||||
'S01-C03-MS007': '68757f28e84dd17fb85faa19eebc4e1e8d6d39e1d49687621606cb61cb738038',
|
||||
'S01-C03-MS008': 'd9352fc81b3bae1bf49f53a742745f7c7ab418e406b1b5c27d54f5da0e2d62f7',
|
||||
'S01-C03-MS009': '97d9395b869e7faa051a461f0ac927aaf3cf73d9ca9cd27b3d0af200dc1131ed',
|
||||
'S01-C03-MS010': '49467f7ac6584f5a9d1e355d4ca2bce5732dd037b6ff22dbf6e899513ed6e1f0',
|
||||
'S01-C03-MS011': '6d76cac756daae850530e4fc295fffec5593af46009be35064fb7820dd54ea25',
|
||||
'S01-C03-MS013': '8c50a597cc7fd01d93d2fc6c2ba27b85690fcde5ce2eea8323b7587889e2771a',
|
||||
'S01-C03-MS014': '8eb817be47b0d933acc8a587b3226bb42160cb64f02fea9f6bbdcf773fc7dfa0',
|
||||
'S01-C03-MS015': '661905745a5bd542da92d2680ab589d80f3e7d8236401acdb61b81b461f2e6bb',
|
||||
'S01-C03-MT000': '374390a364c06922b44dca48e7ffca51f8775ae0d02bff8548aab3e1ff122a65',
|
||||
'S01-C03-TE900': 'f9d770f2104da0e37d1b479f3e25479e49af4ec84ef51339940aef8d90f63993',
|
||||
}
|
||||
|
||||
// C02/C03 cue files are retained only as rollback/source material. A single
|
||||
// cue is not a complete page track, so these assets must not pass the runtime
|
||||
// audio gate or appear as “试听本页”.
|
||||
for (const [chapterNumber, audioHashes] of Object.entries({ '02': audioC02Sha256, '03': audioC03Sha256 })) {
|
||||
for (const [cueId, sha256] of Object.entries(audioHashes)) {
|
||||
const file = `${cueId}.mp3`
|
||||
releaseAssets[`audio.s01.c${chapterNumber}.${cueId.toLowerCase()}`] = {
|
||||
kind: 'audio',
|
||||
reviewStatus: 'reserved',
|
||||
localSeed: `/package-chapter-${chapterNumber}/assets/audio/${file}`,
|
||||
remotePath: `audio/${cueId}.${sha256.slice(0, 12)}.mp3`,
|
||||
sha256,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
RELEASE_ASSET_MANIFEST_VERSION,
|
||||
releaseAssets,
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* C02-C15 remote full-page audio manifest v1.
|
||||
*
|
||||
* Import contract for a future reviewed batch:
|
||||
*
|
||||
* 'S01-C09-P05': Object.freeze({
|
||||
* pageId: 'S01-C09-P05',
|
||||
* chapterNumber: 9,
|
||||
* pageNumber: 5,
|
||||
* assetId: 'audio.page.s01.c09.p05',
|
||||
* durationSeconds: 42.1,
|
||||
* reviewStatus: 'approved',
|
||||
* })
|
||||
*
|
||||
* The matching releaseAssetManifest entry must independently be an approved,
|
||||
* remote-only, immutable hash-named audio asset. Automated QA, pending human
|
||||
* listening, and missing CDN records must never be relabelled as approved.
|
||||
*/
|
||||
|
||||
const REMOTE_PAGE_AUDIO_MANIFEST_VERSION = 1
|
||||
const REMOTE_PAGE_AUDIO_ID_PATTERN = /^S01-C(0[2-9]|1[0-5])-P(0[1-8])$/
|
||||
const SHA256_PATTERN = /^[a-f0-9]{64}$/
|
||||
|
||||
// Deliberately empty until full-page tracks pass the required human reviews
|
||||
// and their immutable CDN objects are available. This is a release gate, not
|
||||
// a placeholder that the UI may treat as playable.
|
||||
const remotePageAudioPages = Object.freeze({})
|
||||
|
||||
function clean(value) {
|
||||
return typeof value === 'string' ? value.trim() : ''
|
||||
}
|
||||
|
||||
function remotePageAudioAssetId(pageId) {
|
||||
const stablePageId = clean(pageId)
|
||||
const match = REMOTE_PAGE_AUDIO_ID_PATTERN.exec(stablePageId)
|
||||
if (!match) return ''
|
||||
return `audio.page.s01.c${match[1]}.p${match[2]}`
|
||||
}
|
||||
|
||||
function getApprovedRemotePageAudio(
|
||||
pageId,
|
||||
releaseAssets = {},
|
||||
pageManifest = remotePageAudioPages,
|
||||
) {
|
||||
const stablePageId = clean(pageId)
|
||||
const match = REMOTE_PAGE_AUDIO_ID_PATTERN.exec(stablePageId)
|
||||
if (!match) return null
|
||||
|
||||
const entry = pageManifest && pageManifest[stablePageId]
|
||||
if (!entry || typeof entry !== 'object') return null
|
||||
const chapterNumber = Number(match[1])
|
||||
const pageNumber = Number(match[2])
|
||||
const assetId = remotePageAudioAssetId(stablePageId)
|
||||
const durationSeconds = Number(entry.durationSeconds)
|
||||
if (
|
||||
clean(entry.reviewStatus).toLowerCase() !== 'approved'
|
||||
|| entry.pageId !== stablePageId
|
||||
|| Number(entry.chapterNumber) !== chapterNumber
|
||||
|| Number(entry.pageNumber) !== pageNumber
|
||||
|| entry.assetId !== assetId
|
||||
|| !Number.isFinite(durationSeconds)
|
||||
|| durationSeconds <= 0
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
const asset = releaseAssets && releaseAssets[assetId]
|
||||
const sha256 = asset && typeof asset.sha256 === 'string'
|
||||
? asset.sha256
|
||||
: ''
|
||||
const remotePath = asset && asset.remotePath
|
||||
const expectedRemotePath = (
|
||||
`audio/${stablePageId.slice(0, 7).toLowerCase()}`
|
||||
+ `/${stablePageId}.${sha256.slice(0, 12)}.mp3`
|
||||
)
|
||||
if (
|
||||
!asset
|
||||
|| asset.kind !== 'audio'
|
||||
|| clean(asset.reviewStatus).toLowerCase() !== 'approved'
|
||||
|| asset.localSeed !== ''
|
||||
|| !SHA256_PATTERN.test(sha256)
|
||||
|| typeof remotePath !== 'string'
|
||||
|| remotePath !== expectedRemotePath
|
||||
) {
|
||||
return null
|
||||
}
|
||||
|
||||
return { ...entry, assetId }
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
REMOTE_PAGE_AUDIO_ID_PATTERN,
|
||||
REMOTE_PAGE_AUDIO_MANIFEST_VERSION,
|
||||
getApprovedRemotePageAudio,
|
||||
remotePageAudioAssetId,
|
||||
remotePageAudioPages,
|
||||
}
|
||||
@@ -0,0 +1,872 @@
|
||||
const {
|
||||
getApprovedRemotePageAudio,
|
||||
} = require('../../data/remotePageAudioManifest')
|
||||
const {
|
||||
releaseAssets,
|
||||
} = require('../../data/releaseAssetManifest')
|
||||
const assetReleaseConfig = require('../../data/assetReleaseConfig')
|
||||
const {
|
||||
createAssetPlatformFacade,
|
||||
createAssetManager,
|
||||
} = require('../../utils/assetManager')
|
||||
const {
|
||||
chapterRoute,
|
||||
normalizeChapterNumber,
|
||||
} = require('../../utils/chapterRoute')
|
||||
|
||||
const REMOTE_PAGE_ID_PATTERN = /^S01-C(0[2-9]|1[0-5])-P(0[1-8])$/
|
||||
const SEEK_TIMEOUT_MS = 1600
|
||||
const PAUSE_LOCK_TIMEOUT_MS = 1200
|
||||
const RATE_VALUES = Object.freeze([0.8, 1, 1.2])
|
||||
const RATE_OPTIONS = Object.freeze([
|
||||
Object.freeze({ value: 0.8, label: '0.8倍' }),
|
||||
Object.freeze({ value: 1, label: '1.0倍' }),
|
||||
Object.freeze({ value: 1.2, label: '1.2倍' }),
|
||||
])
|
||||
const FALLBACK_RATE_OPTIONS = Object.freeze([
|
||||
Object.freeze({ value: 1, label: '1.0倍' }),
|
||||
])
|
||||
|
||||
function formatTime(value) {
|
||||
const seconds = Math.max(0, Math.floor(Number(value) || 0))
|
||||
return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, '0')}`
|
||||
}
|
||||
|
||||
function clamp(value, minimum, maximum) {
|
||||
return Math.min(maximum, Math.max(minimum, Number(value) || 0))
|
||||
}
|
||||
|
||||
function eventValue(event) {
|
||||
return Number(event && event.detail && event.detail.value) || 0
|
||||
}
|
||||
|
||||
function resolveErrorMessage(reason) {
|
||||
if (reason === 'remote-disabled') {
|
||||
return '声音下载地址还没配置好,请返回连环画,稍后再试。'
|
||||
}
|
||||
if (reason === 'remote-failed') {
|
||||
return '网络不太稳,声音没有下载下来。请稍后再试。'
|
||||
}
|
||||
if (reason === 'remote-integrity-failed') {
|
||||
return '声音文件下载不完整,安全校验没有通过。请稍后重试。'
|
||||
}
|
||||
if (reason === 'audio-unapproved') {
|
||||
return '这一页的声音还在审核,暂时不能播放。'
|
||||
}
|
||||
return '这一页的声音暂时没有打开,请返回连环画,稍后再试。'
|
||||
}
|
||||
|
||||
Page({
|
||||
data: {
|
||||
pageId: '',
|
||||
chapterNumber: 2,
|
||||
pageNumber: 1,
|
||||
chapterLabel: '第02回',
|
||||
pageLabel: '第1页',
|
||||
playing: false,
|
||||
loading: false,
|
||||
audioReady: false,
|
||||
hasStarted: false,
|
||||
seekLocked: false,
|
||||
retryAvailable: false,
|
||||
error: '',
|
||||
currentLabel: '0:00',
|
||||
durationLabel: '0:00',
|
||||
durationSeconds: 1,
|
||||
sliderValue: 0,
|
||||
progressStyle: 'width:0%',
|
||||
playbackRate: 1,
|
||||
rateOptions: FALLBACK_RATE_OPTIONS,
|
||||
rateControlsVisible: false,
|
||||
},
|
||||
|
||||
onLoad(options = {}) {
|
||||
this._unloaded = false
|
||||
this._lifecycleGeneration = (Number(this._lifecycleGeneration) || 0) + 1
|
||||
this._contextGeneration = 0
|
||||
this._intentGeneration = 0
|
||||
this._seekOperationGeneration = 0
|
||||
this._controlOperationGeneration = 0
|
||||
this._prepareGeneration = 0
|
||||
this._desiredPlayback = false
|
||||
this._activePlayIntentGeneration = 0
|
||||
this._preparePlayIntentGeneration = 0
|
||||
this._controlLocked = false
|
||||
this._scrubbing = false
|
||||
this._pendingSeek = null
|
||||
this._seekTimer = null
|
||||
this._pendingPauseLock = null
|
||||
this._pauseLockTimer = null
|
||||
this._preparePromise = null
|
||||
this._pageAudio = null
|
||||
this.bindAudioInterruptionHandlers()
|
||||
const pageId = String(options.pageId || '').trim()
|
||||
const match = REMOTE_PAGE_ID_PATTERN.exec(pageId)
|
||||
const chapterNumber = normalizeChapterNumber(options.chapterNumber)
|
||||
const pageChapterNumber = match ? Number(match[1]) : 0
|
||||
const pageNumber = match ? Number(match[2]) : 0
|
||||
this.setData({
|
||||
pageId,
|
||||
chapterNumber,
|
||||
pageNumber: pageNumber || 1,
|
||||
chapterLabel: `第${String(chapterNumber).padStart(2, '0')}回`,
|
||||
pageLabel: `第${pageNumber || 1}页`,
|
||||
})
|
||||
|
||||
if (
|
||||
!match
|
||||
|| chapterNumber < 2
|
||||
|| pageChapterNumber !== chapterNumber
|
||||
) {
|
||||
this.setData({ error: '页面地址不对,请返回连环画重新打开。' })
|
||||
return
|
||||
}
|
||||
|
||||
const pageAudio = getApprovedRemotePageAudio(pageId, releaseAssets)
|
||||
if (!pageAudio) {
|
||||
this.setData({ error: '这一页的声音还在审核,暂时不能播放。' })
|
||||
return
|
||||
}
|
||||
this._pageAudio = pageAudio
|
||||
const durationSeconds = Math.max(1, Number(pageAudio.durationSeconds) || 1)
|
||||
this.setData({
|
||||
durationLabel: formatTime(durationSeconds),
|
||||
durationSeconds,
|
||||
})
|
||||
},
|
||||
|
||||
onReady() {
|
||||
// Opening the leaf is text-only. Downloading starts after an explicit tap.
|
||||
return Promise.resolve(null)
|
||||
},
|
||||
|
||||
isCurrentContext(context, generation) {
|
||||
return !this._unloaded
|
||||
&& this.audioContext === context
|
||||
&& this._contextGeneration === generation
|
||||
},
|
||||
|
||||
setProgress(value, durationValue) {
|
||||
const duration = Math.max(
|
||||
1,
|
||||
Number(durationValue) || Number(this.data.durationSeconds) || 1,
|
||||
)
|
||||
const current = clamp(value, 0, duration)
|
||||
const percent = Math.min(100, current / duration * 100)
|
||||
this.setData({
|
||||
currentLabel: formatTime(current),
|
||||
durationLabel: formatTime(duration),
|
||||
durationSeconds: duration,
|
||||
sliderValue: current,
|
||||
progressStyle: `width:${percent}%`,
|
||||
})
|
||||
},
|
||||
|
||||
disableRateControls(context) {
|
||||
try {
|
||||
if (context && typeof context.playbackRate === 'number') {
|
||||
context.playbackRate = 1
|
||||
}
|
||||
} catch (_) {
|
||||
// A runtime that rejects playbackRate remains safely at normal speed.
|
||||
}
|
||||
this.setData({
|
||||
playbackRate: 1,
|
||||
rateOptions: FALLBACK_RATE_OPTIONS,
|
||||
rateControlsVisible: false,
|
||||
})
|
||||
},
|
||||
|
||||
configureRateControls(context, generation) {
|
||||
try {
|
||||
if (typeof context.playbackRate !== 'number') {
|
||||
this.disableRateControls(context)
|
||||
return
|
||||
}
|
||||
for (const rate of RATE_VALUES) {
|
||||
context.playbackRate = rate
|
||||
if (Math.abs(Number(context.playbackRate) - rate) > 0.001) {
|
||||
this.disableRateControls(context)
|
||||
return
|
||||
}
|
||||
}
|
||||
context.playbackRate = 1
|
||||
if (
|
||||
!this.isCurrentContext(context, generation)
|
||||
|| Math.abs(Number(context.playbackRate) - 1) > 0.001
|
||||
) {
|
||||
this.disableRateControls(context)
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
playbackRate: 1,
|
||||
rateOptions: RATE_OPTIONS,
|
||||
rateControlsVisible: true,
|
||||
})
|
||||
} catch (_) {
|
||||
this.disableRateControls(context)
|
||||
}
|
||||
},
|
||||
|
||||
getAssetManager() {
|
||||
if (!this._assetManager) {
|
||||
this._assetManager = createAssetManager({
|
||||
assetPlatform: createAssetPlatformFacade(),
|
||||
manifest: releaseAssets,
|
||||
...assetReleaseConfig,
|
||||
})
|
||||
}
|
||||
return this._assetManager
|
||||
},
|
||||
|
||||
prepareAudio(intentGeneration) {
|
||||
if (
|
||||
!this._pageAudio
|
||||
|| this._unloaded
|
||||
|| intentGeneration !== this._intentGeneration
|
||||
|| !this._desiredPlayback
|
||||
) return Promise.resolve(null)
|
||||
this._preparePlayIntentGeneration = intentGeneration
|
||||
if (this._preparePromise) return this._preparePromise
|
||||
const prepareGeneration = this._prepareGeneration + 1
|
||||
this._prepareGeneration = prepareGeneration
|
||||
this._controlLocked = true
|
||||
this.setData({
|
||||
loading: true,
|
||||
playing: false,
|
||||
hasStarted: true,
|
||||
retryAvailable: false,
|
||||
error: '',
|
||||
})
|
||||
const assetId = this._pageAudio.assetId
|
||||
const promise = this.getAssetManager().resolve(assetId)
|
||||
.then((result) => {
|
||||
if (
|
||||
this._unloaded
|
||||
|| this._prepareGeneration !== prepareGeneration
|
||||
) return null
|
||||
const activeIntent = this._preparePlayIntentGeneration
|
||||
if (!result || !result.available || !result.uri) {
|
||||
if (
|
||||
activeIntent === this._intentGeneration
|
||||
&& this._desiredPlayback
|
||||
) {
|
||||
this.invalidatePlaybackIntent(false)
|
||||
this.setData({
|
||||
playing: false,
|
||||
loading: false,
|
||||
retryAvailable: true,
|
||||
error: resolveErrorMessage(result && result.reason),
|
||||
})
|
||||
}
|
||||
return result || null
|
||||
}
|
||||
if (
|
||||
!activeIntent
|
||||
|| activeIntent !== this._intentGeneration
|
||||
|| !this._desiredPlayback
|
||||
) return result
|
||||
this.createAudioContext(result.uri)
|
||||
if (
|
||||
activeIntent === this._intentGeneration
|
||||
&& this._desiredPlayback
|
||||
) {
|
||||
this.startPlaybackWithIntent(activeIntent)
|
||||
}
|
||||
return result
|
||||
})
|
||||
.catch(() => {
|
||||
if (
|
||||
!this._unloaded
|
||||
&& this._prepareGeneration === prepareGeneration
|
||||
&& this._preparePlayIntentGeneration === this._intentGeneration
|
||||
&& this._desiredPlayback
|
||||
) {
|
||||
this.invalidatePlaybackIntent(false)
|
||||
this.setData({
|
||||
playing: false,
|
||||
loading: false,
|
||||
retryAvailable: true,
|
||||
error: resolveErrorMessage('remote-failed'),
|
||||
})
|
||||
}
|
||||
return null
|
||||
})
|
||||
.finally(() => {
|
||||
if (this._preparePromise === promise) this._preparePromise = null
|
||||
})
|
||||
this._preparePromise = promise
|
||||
return promise
|
||||
},
|
||||
|
||||
createAudioContext(src) {
|
||||
if (this._unloaded) return null
|
||||
if (this.audioContext) this.destroyAudioContext()
|
||||
const context = wx.createInnerAudioContext()
|
||||
const generation = this._contextGeneration + 1
|
||||
this._contextGeneration = generation
|
||||
this.audioContext = context
|
||||
context.autoplay = false
|
||||
context.src = src
|
||||
this.setData({
|
||||
audioReady: true,
|
||||
loading: false,
|
||||
playing: false,
|
||||
retryAvailable: false,
|
||||
error: '',
|
||||
})
|
||||
this.configureRateControls(context, generation)
|
||||
|
||||
context.onCanplay(() => {
|
||||
if (!this.isCurrentContext(context, generation)) return
|
||||
this.setData({ audioReady: true, error: '' })
|
||||
})
|
||||
context.onPlay(() => {
|
||||
if (!this.isCurrentContext(context, generation)) return
|
||||
if (
|
||||
!this._desiredPlayback
|
||||
|| this._activePlayIntentGeneration !== this._intentGeneration
|
||||
) {
|
||||
context.pause()
|
||||
this._controlLocked = false
|
||||
this.setData({ playing: false, loading: false })
|
||||
return
|
||||
}
|
||||
this._controlLocked = false
|
||||
this.setData({
|
||||
playing: true,
|
||||
loading: false,
|
||||
hasStarted: true,
|
||||
retryAvailable: false,
|
||||
error: '',
|
||||
})
|
||||
})
|
||||
context.onPause(() => {
|
||||
if (!this.isCurrentContext(context, generation)) return
|
||||
if (this._desiredPlayback) return
|
||||
this.releasePauseLockFromEvent(context, generation)
|
||||
this.setData({ playing: false, loading: false })
|
||||
})
|
||||
context.onStop(() => {
|
||||
if (!this.isCurrentContext(context, generation)) return
|
||||
this.invalidatePlaybackIntent(false)
|
||||
this.setData({ playing: false, loading: false })
|
||||
})
|
||||
context.onWaiting(() => {
|
||||
if (
|
||||
!this.isCurrentContext(context, generation)
|
||||
|| !this._desiredPlayback
|
||||
) return
|
||||
this.setData({ playing: false, loading: true })
|
||||
})
|
||||
context.onEnded(() => {
|
||||
if (!this.isCurrentContext(context, generation)) return
|
||||
this.invalidatePlaybackIntent(false)
|
||||
this.setProgress(this.data.durationSeconds, this.data.durationSeconds)
|
||||
this.setData({ playing: false, loading: false })
|
||||
})
|
||||
context.onTimeUpdate(() => {
|
||||
if (
|
||||
!this.isCurrentContext(context, generation)
|
||||
|| this._scrubbing
|
||||
|| this._pendingSeek
|
||||
) return
|
||||
const duration = Number(context.duration) || this.data.durationSeconds
|
||||
const current = Number(context.currentTime) || 0
|
||||
this.setProgress(current, duration)
|
||||
})
|
||||
if (typeof context.onSeeked === 'function') {
|
||||
context.onSeeked(() => {
|
||||
if (!this.isCurrentContext(context, generation)) return
|
||||
this.finishSeekFromEvent(context, generation)
|
||||
})
|
||||
}
|
||||
context.onError(() => {
|
||||
if (!this.isCurrentContext(context, generation)) return
|
||||
this.invalidatePlaybackIntent(false)
|
||||
this.setData({
|
||||
playing: false,
|
||||
loading: false,
|
||||
retryAvailable: true,
|
||||
error: '声音播放失败了。您可以重试,或返回连环画继续看。',
|
||||
})
|
||||
})
|
||||
this.bindAudioInterruptionHandlers()
|
||||
return context
|
||||
},
|
||||
|
||||
beginPlaybackIntent() {
|
||||
this._intentGeneration += 1
|
||||
this._desiredPlayback = true
|
||||
this._activePlayIntentGeneration = this._intentGeneration
|
||||
return this._intentGeneration
|
||||
},
|
||||
|
||||
clearSeekState(updateData = true) {
|
||||
if (this._seekTimer !== null) {
|
||||
clearTimeout(this._seekTimer)
|
||||
this._seekTimer = null
|
||||
}
|
||||
this._seekOperationGeneration += 1
|
||||
this._pendingSeek = null
|
||||
this._scrubbing = false
|
||||
if (updateData && !this._unloaded) this.setData({ seekLocked: false })
|
||||
},
|
||||
|
||||
clearPauseLock(unlock = true) {
|
||||
if (this._pauseLockTimer !== null) {
|
||||
clearTimeout(this._pauseLockTimer)
|
||||
this._pauseLockTimer = null
|
||||
}
|
||||
this._controlOperationGeneration += 1
|
||||
this._pendingPauseLock = null
|
||||
if (unlock) this._controlLocked = false
|
||||
},
|
||||
|
||||
beginPauseLock(context) {
|
||||
this.clearPauseLock(true)
|
||||
const operationGeneration = this._controlOperationGeneration + 1
|
||||
this._controlOperationGeneration = operationGeneration
|
||||
const pending = {
|
||||
operationGeneration,
|
||||
contextGeneration: this._contextGeneration,
|
||||
intentGeneration: this._intentGeneration,
|
||||
lifecycleGeneration: this._lifecycleGeneration,
|
||||
context,
|
||||
}
|
||||
this._pendingPauseLock = pending
|
||||
this._controlLocked = true
|
||||
this._pauseLockTimer = setTimeout(() => {
|
||||
this.releasePauseLock(
|
||||
operationGeneration,
|
||||
pending.contextGeneration,
|
||||
pending.intentGeneration,
|
||||
pending.lifecycleGeneration,
|
||||
context,
|
||||
)
|
||||
}, PAUSE_LOCK_TIMEOUT_MS)
|
||||
},
|
||||
|
||||
releasePauseLock(
|
||||
operationGeneration,
|
||||
contextGeneration,
|
||||
intentGeneration,
|
||||
lifecycleGeneration,
|
||||
context,
|
||||
) {
|
||||
const pending = this._pendingPauseLock
|
||||
if (
|
||||
!pending
|
||||
|| pending.operationGeneration !== operationGeneration
|
||||
|| pending.contextGeneration !== contextGeneration
|
||||
|| pending.intentGeneration !== intentGeneration
|
||||
|| pending.lifecycleGeneration !== lifecycleGeneration
|
||||
|| pending.context !== context
|
||||
|| !this.isCurrentContext(context, contextGeneration)
|
||||
|| this._intentGeneration !== intentGeneration
|
||||
|| this._lifecycleGeneration !== lifecycleGeneration
|
||||
|| this._desiredPlayback
|
||||
) return false
|
||||
if (this._pauseLockTimer !== null) {
|
||||
clearTimeout(this._pauseLockTimer)
|
||||
this._pauseLockTimer = null
|
||||
}
|
||||
this._pendingPauseLock = null
|
||||
this._controlLocked = false
|
||||
return true
|
||||
},
|
||||
|
||||
releasePauseLockFromEvent(context, contextGeneration) {
|
||||
const pending = this._pendingPauseLock
|
||||
if (!pending) {
|
||||
if (this.isCurrentContext(context, contextGeneration)) {
|
||||
this._controlLocked = false
|
||||
}
|
||||
return
|
||||
}
|
||||
this.releasePauseLock(
|
||||
pending.operationGeneration,
|
||||
contextGeneration,
|
||||
pending.intentGeneration,
|
||||
pending.lifecycleGeneration,
|
||||
context,
|
||||
)
|
||||
},
|
||||
|
||||
invalidatePlaybackIntent(pauseContext = true) {
|
||||
this._intentGeneration += 1
|
||||
this._activePlayIntentGeneration = 0
|
||||
this._preparePlayIntentGeneration = 0
|
||||
this._desiredPlayback = false
|
||||
this.clearPauseLock(true)
|
||||
this.clearSeekState(!this._unloaded)
|
||||
if (
|
||||
pauseContext
|
||||
&& this.audioContext
|
||||
&& typeof this.audioContext.pause === 'function'
|
||||
) {
|
||||
this.audioContext.pause()
|
||||
}
|
||||
},
|
||||
|
||||
startPlaybackWithIntent(intentGeneration) {
|
||||
const context = this.audioContext
|
||||
if (
|
||||
!context
|
||||
|| this._unloaded
|
||||
|| intentGeneration !== this._intentGeneration
|
||||
|| !this._desiredPlayback
|
||||
) return false
|
||||
this._controlLocked = true
|
||||
this.setData({
|
||||
loading: true,
|
||||
playing: false,
|
||||
hasStarted: true,
|
||||
retryAvailable: false,
|
||||
error: '',
|
||||
})
|
||||
context.play()
|
||||
return true
|
||||
},
|
||||
|
||||
bindAudioInterruptionHandlers() {
|
||||
if (this._audioInterruptionBeginHandler) return
|
||||
const generation = this._lifecycleGeneration
|
||||
this._audioInterruptionBeginHandler = () => {
|
||||
if (this._unloaded || this._lifecycleGeneration !== generation) return
|
||||
this.pauseWithoutAutoResume()
|
||||
}
|
||||
this._audioInterruptionEndHandler = () => {
|
||||
if (this._unloaded || this._lifecycleGeneration !== generation) return
|
||||
this.invalidatePlaybackIntent(false)
|
||||
this.setData({ playing: false, loading: false })
|
||||
}
|
||||
if (typeof wx.onAudioInterruptionBegin === 'function') {
|
||||
wx.onAudioInterruptionBegin(this._audioInterruptionBeginHandler)
|
||||
}
|
||||
if (typeof wx.onAudioInterruptionEnd === 'function') {
|
||||
wx.onAudioInterruptionEnd(this._audioInterruptionEndHandler)
|
||||
}
|
||||
},
|
||||
|
||||
unbindAudioInterruptionHandlers() {
|
||||
if (
|
||||
this._audioInterruptionBeginHandler
|
||||
&& typeof wx.offAudioInterruptionBegin === 'function'
|
||||
) {
|
||||
wx.offAudioInterruptionBegin(this._audioInterruptionBeginHandler)
|
||||
}
|
||||
if (
|
||||
this._audioInterruptionEndHandler
|
||||
&& typeof wx.offAudioInterruptionEnd === 'function'
|
||||
) {
|
||||
wx.offAudioInterruptionEnd(this._audioInterruptionEndHandler)
|
||||
}
|
||||
this._audioInterruptionBeginHandler = null
|
||||
this._audioInterruptionEndHandler = null
|
||||
},
|
||||
|
||||
pauseWithoutAutoResume() {
|
||||
const context = this.audioContext
|
||||
this.invalidatePlaybackIntent(false)
|
||||
if (context && typeof context.pause === 'function') {
|
||||
this.beginPauseLock(context)
|
||||
try {
|
||||
context.pause()
|
||||
} catch (_) {
|
||||
this.clearPauseLock(true)
|
||||
}
|
||||
}
|
||||
if (!this._unloaded) {
|
||||
this.setData({ playing: false, loading: false })
|
||||
}
|
||||
},
|
||||
|
||||
onHide() {
|
||||
this.pauseWithoutAutoResume()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
if (this._unloaded) return
|
||||
this.clearPauseLock(true)
|
||||
this.setData({ playing: false, loading: false, seekLocked: false })
|
||||
},
|
||||
|
||||
togglePlayback() {
|
||||
if (this.data.loading || this._controlLocked || this._unloaded) return
|
||||
if (!this.audioContext) {
|
||||
const intentGeneration = this.beginPlaybackIntent()
|
||||
return this.prepareAudio(intentGeneration)
|
||||
}
|
||||
if (this.data.playing || this._desiredPlayback) {
|
||||
this.pauseWithoutAutoResume()
|
||||
return
|
||||
}
|
||||
const intentGeneration = this.beginPlaybackIntent()
|
||||
this.startPlaybackWithIntent(intentGeneration)
|
||||
},
|
||||
|
||||
requestSeek(targetValue, options = {}) {
|
||||
const context = this.audioContext
|
||||
if (
|
||||
!context
|
||||
|| this._unloaded
|
||||
|| this.data.loading
|
||||
|| this._pendingSeek
|
||||
) return false
|
||||
const duration = Math.max(
|
||||
1,
|
||||
Number(context.duration) || Number(this.data.durationSeconds) || 1,
|
||||
)
|
||||
const target = clamp(targetValue, 0, duration)
|
||||
const actualBeforeSeek = Number(context.currentTime)
|
||||
const previousValue = clamp(
|
||||
Number.isFinite(actualBeforeSeek)
|
||||
? actualBeforeSeek
|
||||
: Number(this.data.sliderValue) || 0,
|
||||
0,
|
||||
duration,
|
||||
)
|
||||
const operationGeneration = this._seekOperationGeneration + 1
|
||||
this._seekOperationGeneration = operationGeneration
|
||||
const pending = {
|
||||
operationGeneration,
|
||||
contextGeneration: this._contextGeneration,
|
||||
intentGeneration: this._intentGeneration,
|
||||
context,
|
||||
target,
|
||||
previousValue,
|
||||
playAfterSeek: Boolean(options.playAfterSeek),
|
||||
}
|
||||
this._pendingSeek = pending
|
||||
this._scrubbing = false
|
||||
this.setProgress(target, duration)
|
||||
this.setData({ seekLocked: true, error: '' })
|
||||
this._seekTimer = setTimeout(() => {
|
||||
this.failSeek(
|
||||
operationGeneration,
|
||||
pending.contextGeneration,
|
||||
pending.intentGeneration,
|
||||
context,
|
||||
)
|
||||
}, SEEK_TIMEOUT_MS)
|
||||
try {
|
||||
context.seek(target)
|
||||
} catch (_) {
|
||||
this.failSeek(
|
||||
operationGeneration,
|
||||
pending.contextGeneration,
|
||||
pending.intentGeneration,
|
||||
context,
|
||||
)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
},
|
||||
|
||||
finishSeekFromEvent(context, contextGeneration) {
|
||||
const pending = this._pendingSeek
|
||||
if (!pending) return
|
||||
const actual = Number(context.currentTime)
|
||||
if (Number.isFinite(actual) && Math.abs(actual - pending.target) > 1.25) return
|
||||
this.finishSeek(
|
||||
pending.operationGeneration,
|
||||
contextGeneration,
|
||||
pending.intentGeneration,
|
||||
context,
|
||||
)
|
||||
},
|
||||
|
||||
finishSeek(
|
||||
operationGeneration,
|
||||
contextGeneration,
|
||||
intentGeneration,
|
||||
context,
|
||||
) {
|
||||
const pending = this._pendingSeek
|
||||
if (
|
||||
!pending
|
||||
|| pending.operationGeneration !== operationGeneration
|
||||
|| pending.contextGeneration !== contextGeneration
|
||||
|| pending.intentGeneration !== intentGeneration
|
||||
|| pending.context !== context
|
||||
|| !this.isCurrentContext(context, contextGeneration)
|
||||
|| this._intentGeneration !== intentGeneration
|
||||
) return
|
||||
if (this._seekTimer !== null) {
|
||||
clearTimeout(this._seekTimer)
|
||||
this._seekTimer = null
|
||||
}
|
||||
this._pendingSeek = null
|
||||
this.setData({ seekLocked: false })
|
||||
if (
|
||||
pending.playAfterSeek
|
||||
&& this._desiredPlayback
|
||||
&& this._activePlayIntentGeneration === intentGeneration
|
||||
) {
|
||||
this.startPlaybackWithIntent(intentGeneration)
|
||||
}
|
||||
},
|
||||
|
||||
failSeek(
|
||||
operationGeneration,
|
||||
contextGeneration,
|
||||
intentGeneration,
|
||||
context,
|
||||
) {
|
||||
const pending = this._pendingSeek
|
||||
if (
|
||||
!pending
|
||||
|| pending.operationGeneration !== operationGeneration
|
||||
|| pending.contextGeneration !== contextGeneration
|
||||
|| pending.intentGeneration !== intentGeneration
|
||||
|| pending.context !== context
|
||||
|| !this.isCurrentContext(context, contextGeneration)
|
||||
|| this._intentGeneration !== intentGeneration
|
||||
) return false
|
||||
if (this._seekTimer !== null) {
|
||||
clearTimeout(this._seekTimer)
|
||||
this._seekTimer = null
|
||||
}
|
||||
this._pendingSeek = null
|
||||
this._scrubbing = false
|
||||
const actual = Number(context.currentTime)
|
||||
const restoredValue = Number.isFinite(actual)
|
||||
? actual
|
||||
: pending.previousValue
|
||||
if (pending.playAfterSeek) this.invalidatePlaybackIntent(false)
|
||||
this.setProgress(restoredValue, this.data.durationSeconds)
|
||||
this.setData({
|
||||
playing: pending.playAfterSeek ? false : this.data.playing,
|
||||
loading: false,
|
||||
seekLocked: false,
|
||||
error: '进度没有调好,请再试一次。',
|
||||
})
|
||||
return true
|
||||
},
|
||||
|
||||
previewSeek(event) {
|
||||
if (!this.audioContext || this.data.loading || this._pendingSeek) return
|
||||
this._scrubbing = true
|
||||
this.setProgress(eventValue(event), this.data.durationSeconds)
|
||||
},
|
||||
|
||||
commitSeek(event) {
|
||||
if (!this.audioContext || this.data.loading || this._pendingSeek) return
|
||||
this._scrubbing = false
|
||||
this.requestSeek(eventValue(event))
|
||||
},
|
||||
|
||||
rewindTenSeconds() {
|
||||
if (!this.audioContext || this.data.loading || this._pendingSeek) return
|
||||
const current = Number(this.audioContext.currentTime)
|
||||
const fallback = Number(this.data.sliderValue) || 0
|
||||
this.requestSeek(Math.max(0, (Number.isFinite(current) ? current : fallback) - 10))
|
||||
},
|
||||
|
||||
replay() {
|
||||
if (
|
||||
!this.audioContext
|
||||
|| this.data.loading
|
||||
|| this._controlLocked
|
||||
|| this._pendingSeek
|
||||
|| this._unloaded
|
||||
) return
|
||||
const alreadyPlaying = this.data.playing && this._desiredPlayback
|
||||
const intentGeneration = alreadyPlaying
|
||||
? this._intentGeneration
|
||||
: this.beginPlaybackIntent()
|
||||
this.setData({ hasStarted: true, error: '' })
|
||||
this.requestSeek(0, {
|
||||
playAfterSeek: !alreadyPlaying,
|
||||
intentGeneration,
|
||||
})
|
||||
},
|
||||
|
||||
changePlaybackRate(event) {
|
||||
const requested = Number(
|
||||
event && event.currentTarget && event.currentTarget.dataset.rate,
|
||||
)
|
||||
if (
|
||||
!RATE_VALUES.includes(requested)
|
||||
|| !this.audioContext
|
||||
|| !this.data.rateControlsVisible
|
||||
) return
|
||||
const allowed = this.data.rateOptions.some((item) => item.value === requested)
|
||||
if (!allowed) return
|
||||
try {
|
||||
this.audioContext.playbackRate = requested
|
||||
if (Math.abs(Number(this.audioContext.playbackRate) - requested) > 0.001) {
|
||||
this.disableRateControls(this.audioContext)
|
||||
return
|
||||
}
|
||||
this.setData({ playbackRate: requested })
|
||||
} catch (_) {
|
||||
this.disableRateControls(this.audioContext)
|
||||
}
|
||||
},
|
||||
|
||||
retryLoad() {
|
||||
if (this.data.loading || this._controlLocked || this._unloaded) return
|
||||
if (this.audioContext) {
|
||||
const intentGeneration = this.beginPlaybackIntent()
|
||||
this.startPlaybackWithIntent(intentGeneration)
|
||||
return
|
||||
}
|
||||
const intentGeneration = this.beginPlaybackIntent()
|
||||
return this.prepareAudio(intentGeneration)
|
||||
},
|
||||
|
||||
goBack() {
|
||||
const pages = typeof getCurrentPages === 'function' ? getCurrentPages() : []
|
||||
const returnToChapter = () => {
|
||||
if (typeof wx.reLaunch === 'function') {
|
||||
wx.reLaunch({
|
||||
url: chapterRoute(this.data.chapterNumber),
|
||||
})
|
||||
}
|
||||
}
|
||||
if (pages.length > 1 && typeof wx.navigateBack === 'function') {
|
||||
wx.navigateBack({ delta: 1, fail: returnToChapter })
|
||||
return
|
||||
}
|
||||
returnToChapter()
|
||||
},
|
||||
|
||||
destroyAudioContext() {
|
||||
const context = this.audioContext
|
||||
if (!context) return
|
||||
this.invalidatePlaybackIntent(false)
|
||||
this._contextGeneration += 1
|
||||
this.audioContext = null
|
||||
context.destroy()
|
||||
if (!this._unloaded) {
|
||||
this.setData({
|
||||
audioReady: false,
|
||||
playing: false,
|
||||
loading: false,
|
||||
rateOptions: FALLBACK_RATE_OPTIONS,
|
||||
rateControlsVisible: false,
|
||||
playbackRate: 1,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
this._unloaded = true
|
||||
this._lifecycleGeneration += 1
|
||||
this._prepareGeneration += 1
|
||||
this._preparePlayIntentGeneration = 0
|
||||
this._intentGeneration += 1
|
||||
this._activePlayIntentGeneration = 0
|
||||
this._desiredPlayback = false
|
||||
this._controlLocked = true
|
||||
this.clearPauseLock(false)
|
||||
this.clearSeekState(false)
|
||||
this.unbindAudioInterruptionHandlers()
|
||||
const context = this.audioContext
|
||||
this._contextGeneration += 1
|
||||
this.audioContext = null
|
||||
if (context) context.destroy()
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"disableScroll": true
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<view class="audio-page">
|
||||
<view class="audio-topbar">
|
||||
<button class="back-top" bindtap="goBack" aria-label="返回刚才的连环画">‹ 返回连环画</button>
|
||||
<view class="page-heading">
|
||||
<text class="page-kicker">{{chapterLabel}} · 有声夹页</text>
|
||||
<text class="page-count">{{pageNumber}}/8</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="audio-spread">
|
||||
<view class="story-card" aria-label="本页文字封面">
|
||||
<view class="story-card-border">
|
||||
<text class="story-card-kicker">桂香里的有声夹页</text>
|
||||
<text class="story-card-title">桂香里的这一页</text>
|
||||
<view class="story-card-rule"></view>
|
||||
<text class="story-card-chapter">{{chapterLabel}}</text>
|
||||
<text class="story-card-page">{{pageLabel}}</text>
|
||||
<text class="story-card-note">声音单独下载,画面仍留在原来的连环画里。</text>
|
||||
<text class="story-card-stamp">桂香故事</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="audio-copy">
|
||||
<text class="audio-title">听这一页</text>
|
||||
<text class="audio-caption">点“开始听”后才下载并播放;来电话或离开页面会暂停,不会自己续播。</text>
|
||||
|
||||
<view class="audio-seek-row">
|
||||
<slider
|
||||
class="audio-slider"
|
||||
aria-label="播放进度,可左右拖动"
|
||||
min="0"
|
||||
max="{{durationSeconds}}"
|
||||
step="1"
|
||||
value="{{sliderValue}}"
|
||||
activeColor="#9b3328"
|
||||
backgroundColor="#d6c6a1"
|
||||
block-color="#8f271f"
|
||||
block-size="24"
|
||||
disabled="{{loading || !audioReady || seekLocked}}"
|
||||
bindchanging="previewSeek"
|
||||
bindchange="commitSeek"
|
||||
></slider>
|
||||
<text class="audio-time">{{currentLabel}} / {{durationLabel}}</text>
|
||||
</view>
|
||||
|
||||
<view class="audio-controls">
|
||||
<button class="audio-button" disabled="{{loading || !audioReady || seekLocked}}" bindtap="rewindTenSeconds">后退10秒</button>
|
||||
<button class="audio-button primary" disabled="{{loading || seekLocked || error}}" bindtap="togglePlayback">
|
||||
{{loading ? '正在准备' : playing ? '暂停' : hasStarted ? '继续听' : '开始听'}}
|
||||
</button>
|
||||
<button class="audio-button" disabled="{{loading || !audioReady || seekLocked}}" bindtap="replay">从头重听</button>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{rateControlsVisible}}" class="audio-rate-row" aria-label="播放速度">
|
||||
<text class="audio-rate-label">语速</text>
|
||||
<button
|
||||
wx:for="{{rateOptions}}"
|
||||
wx:key="value"
|
||||
class="audio-rate-button {{playbackRate == item.value ? 'active' : ''}}"
|
||||
data-rate="{{item.value}}"
|
||||
disabled="{{loading || seekLocked}}"
|
||||
bindtap="changePlaybackRate"
|
||||
>{{item.label}}</button>
|
||||
</view>
|
||||
|
||||
<view wx:if="{{error}}" class="audio-error" role="alert">
|
||||
<text>{{error}}</text>
|
||||
<button wx:if="{{retryAvailable}}" class="retry-button" disabled="{{loading}}" bindtap="retryLoad">再试一次</button>
|
||||
</view>
|
||||
<button class="back-bottom" bindtap="goBack">回到连环画</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,192 @@
|
||||
page {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
background: #1c130f;
|
||||
color: #2f241d;
|
||||
}
|
||||
|
||||
button::after { border: 0; }
|
||||
|
||||
.audio-page {
|
||||
box-sizing: border-box;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
min-height: 320px;
|
||||
padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
background: radial-gradient(circle at 48% 45%, #443125 0, #211611 70%);
|
||||
}
|
||||
|
||||
.audio-topbar {
|
||||
height: 52px;
|
||||
flex: 0 0 52px;
|
||||
display: grid;
|
||||
grid-template-columns: 160px minmax(0, 1fr);
|
||||
gap: 10px;
|
||||
align-items: center;
|
||||
padding-right: max(92px, env(safe-area-inset-right));
|
||||
color: #f5e6b7;
|
||||
}
|
||||
|
||||
.back-top {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
min-height: 48px;
|
||||
border: 1px solid #9b7a51;
|
||||
border-radius: 10px;
|
||||
background: #38251b;
|
||||
color: #f7e8bd;
|
||||
font-size: 20px;
|
||||
line-height: 48px;
|
||||
text-align: center;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
.page-heading { display: flex; align-items: baseline; gap: 12px; }
|
||||
.page-kicker { font-size: 20px; font-weight: 700; }
|
||||
.page-count { color: #d9bb78; font-size: 18px; }
|
||||
|
||||
.audio-spread {
|
||||
min-height: 0;
|
||||
flex: 1;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr);
|
||||
border: 2px solid #b99762;
|
||||
background: #efe2bd;
|
||||
box-shadow: 0 10px 34px rgba(0, 0, 0, .4);
|
||||
}
|
||||
|
||||
.story-card {
|
||||
box-sizing: border-box;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
padding: 18px;
|
||||
background: repeating-linear-gradient(0deg, rgba(245, 225, 177, .035) 0, rgba(245, 225, 177, .035) 1px, transparent 1px, transparent 5px), #251813;
|
||||
border-right: 4px solid #8d271f;
|
||||
}
|
||||
|
||||
.story-card-border {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 2px solid #b99762;
|
||||
outline: 1px solid rgba(185, 151, 98, .55);
|
||||
outline-offset: -8px;
|
||||
color: #f4e3b8;
|
||||
text-align: center;
|
||||
padding: 28px;
|
||||
}
|
||||
|
||||
.story-card-kicker { color: #d1b274; font-size: 17px; letter-spacing: 3px; }
|
||||
.story-card-title { margin-top: 10px; font-size: 32px; font-weight: 800; letter-spacing: 5px; }
|
||||
.story-card-rule { width: 58%; height: 2px; margin: 16px 0; background: #8f3027; }
|
||||
.story-card-chapter { color: #f8eac8; font-size: 28px; font-weight: 800; }
|
||||
.story-card-page { margin-top: 6px; color: #d8bd83; font-size: 22px; }
|
||||
.story-card-note { max-width: 430px; margin-top: 20px; color: #d8c8a5; font-size: 18px; line-height: 1.55; }
|
||||
.story-card-stamp { position: absolute; right: 22px; bottom: 18px; padding: 6px 10px; border: 2px solid #9d3a2e; color: #d98673; font-size: 16px; letter-spacing: 2px; }
|
||||
|
||||
.audio-copy {
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
padding: 18px 20px 14px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: repeating-linear-gradient(0deg, rgba(119, 87, 46, .04) 0, rgba(119, 87, 46, .04) 1px, transparent 1px, transparent 4px), #f6edcf;
|
||||
}
|
||||
|
||||
.audio-title { color: #8f271f; font-size: 28px; font-weight: 800; line-height: 1.25; }
|
||||
.audio-caption { margin-top: 10px; font-size: 20px; font-weight: 600; line-height: 1.48; }
|
||||
.audio-seek-row {
|
||||
min-width: 0;
|
||||
min-height: 48px;
|
||||
margin-top: auto;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
}
|
||||
.audio-slider { min-width: 0; width: 100%; margin: 0; }
|
||||
.audio-time { min-width: 82px; color: #6d5b48; font-size: 17px; text-align: right; }
|
||||
.audio-controls {
|
||||
min-width: 0;
|
||||
margin-top: 6px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
}
|
||||
.audio-button,
|
||||
.retry-button,
|
||||
.back-bottom {
|
||||
box-sizing: border-box;
|
||||
min-height: 48px;
|
||||
border: 2px solid #7e6648;
|
||||
border-radius: 10px;
|
||||
background: #eadbb5;
|
||||
color: #37291f;
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
line-height: 46px;
|
||||
min-width: 0;
|
||||
margin: 0;
|
||||
padding: 0 6px;
|
||||
}
|
||||
.audio-button { width: 100%; max-width: 100%; }
|
||||
.audio-button.primary { border-color: #8f271f; background: #9e3027; color: #fff2cf; }
|
||||
.audio-button[disabled], .retry-button[disabled] { opacity: .72; }
|
||||
.audio-rate-row {
|
||||
min-width: 0;
|
||||
min-height: 48px;
|
||||
margin-top: 6px;
|
||||
display: grid;
|
||||
grid-template-columns: auto repeat(3, minmax(48px, 1fr));
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
}
|
||||
.audio-rate-label { color: #6d5b48; font-size: 18px; font-weight: 700; }
|
||||
.audio-rate-button {
|
||||
box-sizing: border-box;
|
||||
min-width: 48px;
|
||||
min-height: 48px;
|
||||
margin: 0;
|
||||
padding: 0 4px;
|
||||
border: 2px solid #9d896a;
|
||||
border-radius: 9px;
|
||||
background: #f3e7c8;
|
||||
color: #4d3b2d;
|
||||
font-size: 17px;
|
||||
font-weight: 700;
|
||||
line-height: 46px;
|
||||
}
|
||||
.audio-rate-button { width: 100%; max-width: 100%; }
|
||||
.audio-rate-button.active { border-color: #8f271f; background: #8f271f; color: #fff2cf; }
|
||||
.audio-rate-button[disabled] { opacity: .72; }
|
||||
.audio-error { margin-top: 8px; color: #8f271f; font-size: 17px; line-height: 1.35; }
|
||||
.retry-button { width: 100%; min-height: 48px; margin-top: 8px; line-height: 46px; font-size: 18px; }
|
||||
.back-bottom { margin-top: 8px; width: 100%; }
|
||||
|
||||
@media (max-height: 430px) {
|
||||
.audio-page { gap: 4px; padding-top: 4px; padding-bottom: 4px; }
|
||||
.audio-topbar { height: 48px; flex-basis: 48px; }
|
||||
.story-card { padding: 10px; }
|
||||
.story-card-border { padding: 16px; }
|
||||
.story-card-title { font-size: 26px; }
|
||||
.story-card-note { margin-top: 10px; font-size: 16px; }
|
||||
.audio-copy { padding: 8px 12px; overflow-y: auto; }
|
||||
.audio-title { font-size: 23px; }
|
||||
.audio-caption { margin-top: 4px; font-size: 17px; line-height: 1.3; }
|
||||
.audio-seek-row { min-height: 48px; }
|
||||
.audio-controls, .audio-rate-row { margin-top: 3px; gap: 5px; }
|
||||
.audio-button, .retry-button, .back-bottom { min-height: 48px; line-height: 46px; font-size: 17px; }
|
||||
.audio-rate-button { min-height: 48px; line-height: 46px; font-size: 16px; }
|
||||
.audio-rate-label { font-size: 16px; }
|
||||
.back-bottom { display: none; }
|
||||
}
|
||||
@@ -0,0 +1,674 @@
|
||||
const CACHE_INDEX_VERSION = 2
|
||||
const CACHE_FOLDER = 'tang-detective-assets-v2'
|
||||
const CACHE_INDEX_FILE = 'index.json'
|
||||
const DEFAULT_IMAGE_BUDGET = 28 * 1024 * 1024
|
||||
const DEFAULT_AUDIO_BUDGET = 32 * 1024 * 1024
|
||||
const DEFAULT_AUDIO_MAX_ENTRIES = 32
|
||||
|
||||
const SHA256_ROUND_CONSTANTS = [
|
||||
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
|
||||
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
||||
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
|
||||
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
|
||||
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
|
||||
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
|
||||
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
|
||||
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
|
||||
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
|
||||
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
|
||||
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
|
||||
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
|
||||
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
|
||||
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
|
||||
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
|
||||
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
|
||||
]
|
||||
|
||||
function utf8Bytes(value) {
|
||||
const encoded = encodeURIComponent(String(value || ''))
|
||||
const bytes = []
|
||||
for (let index = 0; index < encoded.length; index += 1) {
|
||||
if (encoded[index] === '%') {
|
||||
bytes.push(parseInt(encoded.slice(index + 1, index + 3), 16))
|
||||
index += 2
|
||||
} else {
|
||||
bytes.push(encoded.charCodeAt(index))
|
||||
}
|
||||
}
|
||||
return new Uint8Array(bytes)
|
||||
}
|
||||
|
||||
function toBytes(value) {
|
||||
if (typeof value === 'string') return utf8Bytes(value)
|
||||
if (value instanceof ArrayBuffer) return new Uint8Array(value)
|
||||
if (ArrayBuffer.isView(value)) {
|
||||
return new Uint8Array(value.buffer, value.byteOffset, value.byteLength)
|
||||
}
|
||||
throw new Error('unsupported SHA-256 input')
|
||||
}
|
||||
|
||||
function rotateRight(value, bits) {
|
||||
return (value >>> bits) | (value << (32 - bits))
|
||||
}
|
||||
|
||||
function sha256Hex(value) {
|
||||
const bytes = toBytes(value)
|
||||
const paddedLength = Math.ceil((bytes.length + 9) / 64) * 64
|
||||
const message = new Uint8Array(paddedLength)
|
||||
message.set(bytes)
|
||||
message[bytes.length] = 0x80
|
||||
const bitLength = bytes.length * 8
|
||||
const highBits = Math.floor(bitLength / 0x100000000)
|
||||
const lowBits = bitLength >>> 0
|
||||
const lengthOffset = paddedLength - 8
|
||||
message[lengthOffset] = (highBits >>> 24) & 0xff
|
||||
message[lengthOffset + 1] = (highBits >>> 16) & 0xff
|
||||
message[lengthOffset + 2] = (highBits >>> 8) & 0xff
|
||||
message[lengthOffset + 3] = highBits & 0xff
|
||||
message[lengthOffset + 4] = (lowBits >>> 24) & 0xff
|
||||
message[lengthOffset + 5] = (lowBits >>> 16) & 0xff
|
||||
message[lengthOffset + 6] = (lowBits >>> 8) & 0xff
|
||||
message[lengthOffset + 7] = lowBits & 0xff
|
||||
|
||||
const hash = [
|
||||
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
|
||||
0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
|
||||
]
|
||||
const words = new Uint32Array(64)
|
||||
for (let offset = 0; offset < paddedLength; offset += 64) {
|
||||
for (let index = 0; index < 16; index += 1) {
|
||||
const start = offset + index * 4
|
||||
words[index] = (
|
||||
(message[start] << 24)
|
||||
| (message[start + 1] << 16)
|
||||
| (message[start + 2] << 8)
|
||||
| message[start + 3]
|
||||
) >>> 0
|
||||
}
|
||||
for (let index = 16; index < 64; index += 1) {
|
||||
const word15 = words[index - 15]
|
||||
const word2 = words[index - 2]
|
||||
const sigma0 = (
|
||||
rotateRight(word15, 7)
|
||||
^ rotateRight(word15, 18)
|
||||
^ (word15 >>> 3)
|
||||
)
|
||||
const sigma1 = (
|
||||
rotateRight(word2, 17)
|
||||
^ rotateRight(word2, 19)
|
||||
^ (word2 >>> 10)
|
||||
)
|
||||
words[index] = (
|
||||
words[index - 16]
|
||||
+ sigma0
|
||||
+ words[index - 7]
|
||||
+ sigma1
|
||||
) >>> 0
|
||||
}
|
||||
|
||||
let a = hash[0]
|
||||
let b = hash[1]
|
||||
let c = hash[2]
|
||||
let d = hash[3]
|
||||
let e = hash[4]
|
||||
let f = hash[5]
|
||||
let g = hash[6]
|
||||
let h = hash[7]
|
||||
for (let index = 0; index < 64; index += 1) {
|
||||
const sum1 = rotateRight(e, 6) ^ rotateRight(e, 11) ^ rotateRight(e, 25)
|
||||
const choice = (e & f) ^ (~e & g)
|
||||
const temp1 = (
|
||||
h + sum1 + choice + SHA256_ROUND_CONSTANTS[index] + words[index]
|
||||
) >>> 0
|
||||
const sum0 = rotateRight(a, 2) ^ rotateRight(a, 13) ^ rotateRight(a, 22)
|
||||
const majority = (a & b) ^ (a & c) ^ (b & c)
|
||||
const temp2 = (sum0 + majority) >>> 0
|
||||
h = g
|
||||
g = f
|
||||
f = e
|
||||
e = (d + temp1) >>> 0
|
||||
d = c
|
||||
c = b
|
||||
b = a
|
||||
a = (temp1 + temp2) >>> 0
|
||||
}
|
||||
hash[0] = (hash[0] + a) >>> 0
|
||||
hash[1] = (hash[1] + b) >>> 0
|
||||
hash[2] = (hash[2] + c) >>> 0
|
||||
hash[3] = (hash[3] + d) >>> 0
|
||||
hash[4] = (hash[4] + e) >>> 0
|
||||
hash[5] = (hash[5] + f) >>> 0
|
||||
hash[6] = (hash[6] + g) >>> 0
|
||||
hash[7] = (hash[7] + h) >>> 0
|
||||
}
|
||||
return hash.map((word) => word.toString(16).padStart(8, '0')).join('')
|
||||
}
|
||||
|
||||
function constantTimeEqualHex(left, right) {
|
||||
const leftValue = String(left || '').toLowerCase()
|
||||
const rightValue = String(right || '').toLowerCase()
|
||||
const length = Math.max(leftValue.length, rightValue.length)
|
||||
let difference = leftValue.length ^ rightValue.length
|
||||
for (let index = 0; index < length; index += 1) {
|
||||
const leftCode = index < leftValue.length ? leftValue.charCodeAt(index) : 0
|
||||
const rightCode = index < rightValue.length ? rightValue.charCodeAt(index) : 0
|
||||
difference |= leftCode ^ rightCode
|
||||
}
|
||||
return difference === 0
|
||||
}
|
||||
|
||||
function trimSlash(value) {
|
||||
return String(value || '').replace(/\/+$/, '')
|
||||
}
|
||||
|
||||
function joinPath(left, right) {
|
||||
return `${trimSlash(left)}/${String(right || '').replace(/^\/+/, '')}`
|
||||
}
|
||||
|
||||
function normalizeIndex(value) {
|
||||
if (
|
||||
!value
|
||||
|| value.version !== CACHE_INDEX_VERSION
|
||||
|| !value.entries
|
||||
|| typeof value.entries !== 'object'
|
||||
) {
|
||||
return {
|
||||
version: CACHE_INDEX_VERSION,
|
||||
entries: {},
|
||||
}
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
function callFs(fs, method, options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!fs || typeof fs[method] !== 'function') {
|
||||
reject(new Error(`fs.${method} unavailable`))
|
||||
return
|
||||
}
|
||||
fs[method]({
|
||||
...options,
|
||||
success: resolve,
|
||||
fail: reject,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function createAssetPlatformFacade() {
|
||||
if (typeof wx === 'undefined') return null
|
||||
const env = Object.freeze({
|
||||
USER_DATA_PATH: String(
|
||||
wx.env && wx.env.USER_DATA_PATH || '',
|
||||
),
|
||||
})
|
||||
return Object.freeze({
|
||||
downloadFile(options) {
|
||||
if (typeof wx.downloadFile !== 'function') {
|
||||
if (options && typeof options.fail === 'function') {
|
||||
options.fail(new Error('wx.downloadFile unavailable'))
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
return wx.downloadFile(options)
|
||||
},
|
||||
getFileSystemManager() {
|
||||
if (typeof wx.getFileSystemManager !== 'function') return null
|
||||
return wx.getFileSystemManager()
|
||||
},
|
||||
env,
|
||||
})
|
||||
}
|
||||
|
||||
function download(assetPlatform, url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (!assetPlatform || typeof assetPlatform.downloadFile !== 'function') {
|
||||
reject(new Error('wx.downloadFile unavailable'))
|
||||
return
|
||||
}
|
||||
assetPlatform.downloadFile({
|
||||
url,
|
||||
success(result) {
|
||||
if (
|
||||
result
|
||||
&& result.statusCode >= 200
|
||||
&& result.statusCode < 300
|
||||
&& result.tempFilePath
|
||||
) {
|
||||
resolve(result)
|
||||
return
|
||||
}
|
||||
reject(new Error(`download status ${result && result.statusCode}`))
|
||||
},
|
||||
fail: reject,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function safeCacheName(assetId, asset) {
|
||||
const extensionMatch = String(asset.remotePath || '').match(/(\.[a-z0-9]+)$/i)
|
||||
const extension = extensionMatch ? extensionMatch[1].toLowerCase() : '.bin'
|
||||
const safeId = assetId.replace(/[^a-z0-9._-]/gi, '_')
|
||||
return `${safeId}.${asset.sha256.slice(0, 12)}${extension}`
|
||||
}
|
||||
|
||||
function createAssetManager(options = {}) {
|
||||
const assetPlatform = options.assetPlatform || createAssetPlatformFacade()
|
||||
const manifest = options.manifest || {}
|
||||
const cdnBaseUrl = trimSlash(options.cdnBaseUrl)
|
||||
const imageBudgetBytes = Number.isFinite(options.imageCacheBudgetBytes)
|
||||
? Math.max(0, options.imageCacheBudgetBytes)
|
||||
: DEFAULT_IMAGE_BUDGET
|
||||
const audioBudgetBytes = Number.isFinite(options.audioCacheBudgetBytes)
|
||||
? Math.max(0, options.audioCacheBudgetBytes)
|
||||
: DEFAULT_AUDIO_BUDGET
|
||||
const audioMaxEntries = Number.isFinite(options.audioCacheMaxEntries)
|
||||
? Math.max(0, Math.floor(options.audioCacheMaxEntries))
|
||||
: DEFAULT_AUDIO_MAX_ENTRIES
|
||||
const downloadConcurrency = Number.isFinite(options.downloadConcurrency)
|
||||
? Math.max(1, Math.floor(options.downloadConcurrency))
|
||||
: 2
|
||||
const now = typeof options.now === 'function' ? options.now : Date.now
|
||||
const fs = assetPlatform
|
||||
&& typeof assetPlatform.getFileSystemManager === 'function'
|
||||
? assetPlatform.getFileSystemManager()
|
||||
: null
|
||||
const userDataPath = (
|
||||
assetPlatform
|
||||
&& assetPlatform.env
|
||||
&& assetPlatform.env.USER_DATA_PATH
|
||||
) || ''
|
||||
const cacheRoot = userDataPath ? joinPath(userDataPath, CACHE_FOLDER) : ''
|
||||
const indexPath = cacheRoot ? joinPath(cacheRoot, CACHE_INDEX_FILE) : ''
|
||||
|
||||
let initialized = false
|
||||
let index = normalizeIndex(null)
|
||||
let activeDownloads = 0
|
||||
const inflight = new Map()
|
||||
const downloadWaiters = []
|
||||
|
||||
function fallback(assetId, reason) {
|
||||
return {
|
||||
assetId,
|
||||
available: false,
|
||||
uri: '',
|
||||
source: 'text-fallback',
|
||||
reason,
|
||||
}
|
||||
}
|
||||
|
||||
async function ensureCacheFolder() {
|
||||
if (!cacheRoot) return false
|
||||
try {
|
||||
await callFs(fs, 'mkdir', {
|
||||
dirPath: cacheRoot,
|
||||
recursive: true,
|
||||
})
|
||||
} catch (error) {
|
||||
// EEXIST and older base-library mkdir failures are both safe to ignore.
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
async function persistIndex() {
|
||||
if (!indexPath) return
|
||||
try {
|
||||
await ensureCacheFolder()
|
||||
await callFs(fs, 'writeFile', {
|
||||
filePath: indexPath,
|
||||
data: JSON.stringify(index),
|
||||
encoding: 'utf8',
|
||||
})
|
||||
} catch (error) {
|
||||
// Cache metadata must never block the text-first game.
|
||||
}
|
||||
}
|
||||
|
||||
async function fileExists(filePath) {
|
||||
if (!filePath) return false
|
||||
try {
|
||||
await callFs(fs, 'access', { path: filePath })
|
||||
return true
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function fileMatchesSha256(filePath, expectedSha256) {
|
||||
try {
|
||||
const result = await callFs(fs, 'readFile', { filePath })
|
||||
return constantTimeEqualHex(
|
||||
sha256Hex(result.data),
|
||||
expectedSha256,
|
||||
)
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
async function init() {
|
||||
if (initialized) return
|
||||
initialized = true
|
||||
if (!indexPath) return
|
||||
try {
|
||||
const result = await callFs(fs, 'readFile', {
|
||||
filePath: indexPath,
|
||||
encoding: 'utf8',
|
||||
})
|
||||
index = normalizeIndex(JSON.parse(result.data))
|
||||
} catch (error) {
|
||||
index = normalizeIndex(null)
|
||||
}
|
||||
|
||||
let changed = false
|
||||
for (const [assetId, entry] of Object.entries(index.entries)) {
|
||||
if (!manifest[assetId] || !(await fileExists(entry.filePath))) {
|
||||
delete index.entries[assetId]
|
||||
changed = true
|
||||
}
|
||||
}
|
||||
if (changed) await persistIndex()
|
||||
await enforceImageBudget()
|
||||
await enforceAudioBudget()
|
||||
}
|
||||
|
||||
function cacheBytes(kind) {
|
||||
return Object.values(index.entries).reduce(
|
||||
(total, entry) => (
|
||||
entry.kind === kind
|
||||
? total + Math.max(0, Number(entry.size) || 0)
|
||||
: total
|
||||
),
|
||||
0,
|
||||
)
|
||||
}
|
||||
|
||||
function cacheEntries(kind) {
|
||||
return Object.values(index.entries)
|
||||
.filter((entry) => entry.kind === kind)
|
||||
.length
|
||||
}
|
||||
|
||||
function imageCacheBytes() {
|
||||
return cacheBytes('image')
|
||||
}
|
||||
|
||||
function audioCacheBytes() {
|
||||
return cacheBytes('audio')
|
||||
}
|
||||
|
||||
async function unlinkQuietly(filePath) {
|
||||
try {
|
||||
await callFs(fs, 'unlink', { filePath })
|
||||
} catch (error) {
|
||||
// A missing cache file is already evicted.
|
||||
}
|
||||
}
|
||||
|
||||
async function enforceImageBudget(protectedAssetId = '') {
|
||||
let total = imageCacheBytes()
|
||||
if (total <= imageBudgetBytes) return
|
||||
|
||||
const candidates = Object.entries(index.entries)
|
||||
.filter(([assetId, entry]) => (
|
||||
entry.kind === 'image' && assetId !== protectedAssetId
|
||||
))
|
||||
.sort((left, right) => (
|
||||
(Number(left[1].lastAccessedAt) || 0)
|
||||
- (Number(right[1].lastAccessedAt) || 0)
|
||||
))
|
||||
|
||||
for (const [assetId, entry] of candidates) {
|
||||
if (total <= imageBudgetBytes) break
|
||||
await unlinkQuietly(entry.filePath)
|
||||
total -= Math.max(0, Number(entry.size) || 0)
|
||||
delete index.entries[assetId]
|
||||
}
|
||||
await persistIndex()
|
||||
}
|
||||
|
||||
async function enforceAudioBudget(protectedAssetId = '') {
|
||||
let total = audioCacheBytes()
|
||||
let entries = cacheEntries('audio')
|
||||
if (total <= audioBudgetBytes && entries <= audioMaxEntries) return
|
||||
|
||||
const candidates = Object.entries(index.entries)
|
||||
.filter(([assetId, entry]) => (
|
||||
entry.kind === 'audio' && assetId !== protectedAssetId
|
||||
))
|
||||
.sort((left, right) => (
|
||||
(Number(left[1].lastAccessedAt) || 0)
|
||||
- (Number(right[1].lastAccessedAt) || 0)
|
||||
))
|
||||
|
||||
for (const [assetId, entry] of candidates) {
|
||||
if (total <= audioBudgetBytes && entries <= audioMaxEntries) break
|
||||
await unlinkQuietly(entry.filePath)
|
||||
total -= Math.max(0, Number(entry.size) || 0)
|
||||
entries -= 1
|
||||
delete index.entries[assetId]
|
||||
}
|
||||
await persistIndex()
|
||||
}
|
||||
|
||||
async function resolveCached(assetId, asset) {
|
||||
const entry = index.entries[assetId]
|
||||
if (!entry || entry.sha256 !== asset.sha256) return null
|
||||
if (!(await fileExists(entry.filePath))) {
|
||||
delete index.entries[assetId]
|
||||
await persistIndex()
|
||||
return null
|
||||
}
|
||||
if (!(await fileMatchesSha256(entry.filePath, asset.sha256))) {
|
||||
await unlinkQuietly(entry.filePath)
|
||||
delete index.entries[assetId]
|
||||
await persistIndex()
|
||||
return fallback(assetId, 'remote-integrity-failed')
|
||||
}
|
||||
entry.lastAccessedAt = now()
|
||||
await persistIndex()
|
||||
return {
|
||||
assetId,
|
||||
available: true,
|
||||
uri: entry.filePath,
|
||||
source: 'cache',
|
||||
kind: asset.kind,
|
||||
}
|
||||
}
|
||||
|
||||
async function getTempFileSize(tempFilePath, response) {
|
||||
if (Number.isFinite(response.fileSize)) return response.fileSize
|
||||
try {
|
||||
const statResult = await callFs(fs, 'stat', {
|
||||
path: tempFilePath,
|
||||
})
|
||||
const stat = statResult && statResult.stats
|
||||
return Math.max(0, Number(stat && stat.size) || 0)
|
||||
} catch (error) {
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchRemote(assetId, asset) {
|
||||
if (!cdnBaseUrl || !asset.remotePath) {
|
||||
return fallback(assetId, 'remote-disabled')
|
||||
}
|
||||
|
||||
const response = await new Promise((resolve, reject) => {
|
||||
const run = () => {
|
||||
activeDownloads += 1
|
||||
download(assetPlatform, joinPath(cdnBaseUrl, asset.remotePath))
|
||||
.then(resolve, reject)
|
||||
.finally(() => {
|
||||
activeDownloads -= 1
|
||||
const next = downloadWaiters.shift()
|
||||
if (next) next()
|
||||
})
|
||||
}
|
||||
if (activeDownloads < downloadConcurrency) run()
|
||||
else downloadWaiters.push(run)
|
||||
})
|
||||
if (!(await fileMatchesSha256(response.tempFilePath, asset.sha256))) {
|
||||
await unlinkQuietly(response.tempFilePath)
|
||||
return fallback(assetId, 'remote-integrity-failed')
|
||||
}
|
||||
const size = await getTempFileSize(response.tempFilePath, response)
|
||||
|
||||
const exceedsCachePolicy = (
|
||||
(asset.kind === 'image' && size > imageBudgetBytes)
|
||||
|| (
|
||||
asset.kind === 'audio'
|
||||
&& (size > audioBudgetBytes || audioMaxEntries < 1)
|
||||
)
|
||||
)
|
||||
if (!cacheRoot || exceedsCachePolicy) {
|
||||
return {
|
||||
assetId,
|
||||
available: true,
|
||||
uri: response.tempFilePath,
|
||||
source: 'remote',
|
||||
kind: asset.kind,
|
||||
persistent: false,
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await ensureCacheFolder()
|
||||
const filePath = joinPath(cacheRoot, safeCacheName(assetId, asset))
|
||||
await callFs(fs, 'saveFile', {
|
||||
tempFilePath: response.tempFilePath,
|
||||
filePath,
|
||||
})
|
||||
index.entries[assetId] = {
|
||||
assetId,
|
||||
filePath,
|
||||
kind: asset.kind,
|
||||
sha256: asset.sha256,
|
||||
size,
|
||||
lastAccessedAt: now(),
|
||||
}
|
||||
await enforceImageBudget(assetId)
|
||||
await enforceAudioBudget(assetId)
|
||||
await persistIndex()
|
||||
return {
|
||||
assetId,
|
||||
available: true,
|
||||
uri: filePath,
|
||||
source: 'remote',
|
||||
kind: asset.kind,
|
||||
persistent: true,
|
||||
}
|
||||
} catch (error) {
|
||||
return {
|
||||
assetId,
|
||||
available: true,
|
||||
uri: response.tempFilePath,
|
||||
source: 'remote',
|
||||
kind: asset.kind,
|
||||
persistent: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function resolve(assetId, resolveOptions = {}) {
|
||||
await init()
|
||||
const asset = manifest[assetId]
|
||||
if (!asset) return fallback(assetId, 'unknown-asset')
|
||||
if (
|
||||
asset.kind === 'audio'
|
||||
&& String(asset.reviewStatus || '').toLowerCase() !== 'approved'
|
||||
) {
|
||||
return fallback(assetId, 'audio-unapproved')
|
||||
}
|
||||
|
||||
// 包内种子永远优先:首屏无需等网络,离线也能继续读和玩。
|
||||
if (asset.localSeed && resolveOptions.preferRemote !== true) {
|
||||
return {
|
||||
assetId,
|
||||
available: true,
|
||||
uri: asset.localSeed,
|
||||
source: 'local',
|
||||
kind: asset.kind,
|
||||
}
|
||||
}
|
||||
|
||||
const cached = await resolveCached(assetId, asset)
|
||||
if (cached) return cached
|
||||
|
||||
if (resolveOptions.allowRemote === false) {
|
||||
if (asset.localSeed) {
|
||||
return {
|
||||
assetId,
|
||||
available: true,
|
||||
uri: asset.localSeed,
|
||||
source: 'local',
|
||||
kind: asset.kind,
|
||||
}
|
||||
}
|
||||
return fallback(assetId, 'remote-disallowed')
|
||||
}
|
||||
|
||||
if (inflight.has(assetId)) return inflight.get(assetId)
|
||||
|
||||
const request = fetchRemote(assetId, asset)
|
||||
.catch(() => (
|
||||
asset.localSeed
|
||||
? {
|
||||
assetId,
|
||||
available: true,
|
||||
uri: asset.localSeed,
|
||||
source: 'local',
|
||||
kind: asset.kind,
|
||||
}
|
||||
: fallback(assetId, 'remote-failed')
|
||||
))
|
||||
.finally(() => inflight.delete(assetId))
|
||||
inflight.set(assetId, request)
|
||||
return request
|
||||
}
|
||||
|
||||
async function prefetch(assetIds) {
|
||||
const ids = Array.isArray(assetIds) ? assetIds : []
|
||||
return Promise.all(ids.map((assetId) => resolve(assetId)))
|
||||
}
|
||||
|
||||
async function clearCache() {
|
||||
await init()
|
||||
const entries = Object.values(index.entries)
|
||||
for (const entry of entries) await unlinkQuietly(entry.filePath)
|
||||
index = normalizeIndex(null)
|
||||
await persistIndex()
|
||||
}
|
||||
|
||||
function getCacheStats() {
|
||||
return {
|
||||
entries: Object.keys(index.entries).length,
|
||||
imageBytes: imageCacheBytes(),
|
||||
imageBudgetBytes,
|
||||
audioEntries: cacheEntries('audio'),
|
||||
audioBytes: audioCacheBytes(),
|
||||
audioBudgetBytes,
|
||||
audioMaxEntries,
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
init,
|
||||
resolve,
|
||||
prefetch,
|
||||
clearCache,
|
||||
getCacheStats,
|
||||
getAsset(assetId) {
|
||||
return manifest[assetId] || null
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
CACHE_INDEX_VERSION,
|
||||
DEFAULT_AUDIO_BUDGET,
|
||||
DEFAULT_AUDIO_MAX_ENTRIES,
|
||||
constantTimeEqualHex,
|
||||
createAssetPlatformFacade,
|
||||
createAssetManager,
|
||||
sha256Hex,
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
const SHARED_GAME_CHAPTERS = new Set([1])
|
||||
|
||||
function normalizeChapterNumber(value) {
|
||||
const number = Number(value)
|
||||
if (!Number.isFinite(number)) return 1
|
||||
return Math.min(15, Math.max(1, Math.floor(number)))
|
||||
}
|
||||
|
||||
function chapterPackageRoot(value) {
|
||||
const chapter = normalizeChapterNumber(value)
|
||||
if (SHARED_GAME_CHAPTERS.has(chapter)) return 'package-game'
|
||||
return `package-chapter-${String(chapter).padStart(2, '0')}`
|
||||
}
|
||||
|
||||
function chapterRoute(value, options = {}) {
|
||||
const chapter = normalizeChapterNumber(value)
|
||||
const replay = options && options.replay === true ? '&replay=1' : ''
|
||||
return `/${chapterPackageRoot(chapter)}/pages/chapter/chapter?chapter=${chapter}${replay}`
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
normalizeChapterNumber,
|
||||
chapterPackageRoot,
|
||||
chapterRoute,
|
||||
}
|
||||
Reference in New Issue
Block a user