Improvement: Novel Updates: Plugin Update (#1553)

* novel-updates: plugin update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* chapter-sync: update test version

* chapter-sync: update

* chapter-sync: update

* chapter-sync: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: update

* novel-updates: revert test version
This commit is contained in:
Batorian
2025-03-20 11:19:27 +01:00
committed by GitHub
parent 7ad6a5e4b7
commit ade1efa2e7
2 changed files with 459 additions and 564 deletions
+9 -13
View File
@@ -18,7 +18,7 @@ class Genesis implements Plugin.PluginBase {
icon = 'src/en/genesis/icon.png';
customCSS = 'src/en/genesis/customCSS.css';
site = 'https://genesistudio.com';
version = '1.1.1';
version = '1.1.2';
imageRequestInit?: Plugin.ImageRequestInit | undefined = {
headers: {
@@ -421,6 +421,7 @@ class Genesis implements Plugin.PluginBase {
// Extract the main novel data from the nodes
const data = this.extractData(nodes);
// Look for chapter container with required fields
const contentKey = 'content';
const notesKey = 'notes';
const footnotesKey = 'footnotes';
@@ -429,7 +430,7 @@ class Genesis implements Plugin.PluginBase {
for (const key in data) {
const mapping = data[key];
// Look for an object with a 'chapters' key
// Check container for keys that match the required fields
if (
mapping &&
typeof mapping === 'object' &&
@@ -437,21 +438,16 @@ class Genesis implements Plugin.PluginBase {
notesKey in mapping &&
footnotesKey in mapping
) {
// Use the found mapping object to determine the actual keys.
const contentMappingKey = mapping[contentKey];
const notesMappingKey = mapping[notesKey];
const footnotesMappingKey = mapping[footnotesKey];
// Retrieve the chapter's content, notes, and footnotes using the mapping.
// Provide a fallback for content if needed.
const content = data[contentMappingKey] ?? data[19];
const notes = data[notesMappingKey];
const footnotes = data[footnotesMappingKey];
const content = data[mapping[contentKey]];
const notes = data[mapping[notesKey]];
const footnotes = data[mapping[footnotesKey]];
// Return the combined parts with appropriate formatting
return (
content +
(notes ? `<b>Notes</b><br>${notes}` : '') +
(footnotes ? `<b>Footnotes</b><br>${footnotes}` : '')
(notes ? `<h2>Notes</h2><br>${notes}` : '') +
(footnotes ?? '')
);
}
}
File diff suppressed because it is too large Load Diff