Add support for decimal chapters (e.g., 107.5) - check after integer chapters
This commit is contained in:
parent
190edb9003
commit
422d9c8a32
@ -47,6 +47,30 @@ async function loadChaptersData() {
|
||||
}
|
||||
}
|
||||
|
||||
// 额外检查小数章节(如107.5)
|
||||
for (let i = 1; i <= chapterNum + 10; i++) {
|
||||
try {
|
||||
const decimalId = i + 0.5;
|
||||
const response = await fetch(`data/chapter-${decimalId}.json`, {
|
||||
cache: 'no-store',
|
||||
headers: {
|
||||
'Cache-Control': 'no-cache',
|
||||
'Pragma': 'no-cache'
|
||||
}
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const data = await response.json();
|
||||
chapters.push(normalizeChapterData(data, decimalId));
|
||||
}
|
||||
} catch (error) {
|
||||
// 忽略错误
|
||||
}
|
||||
}
|
||||
|
||||
// 按id排序
|
||||
chapters.sort((a, b) => parseFloat(a.id) - parseFloat(b.id));
|
||||
|
||||
chaptersData = chapters;
|
||||
isDataLoaded = true;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user