Add CWA_ENABLED to run Bindery without CWA
With CWA_ENABLED=false, Bindery ignores the CWA settings, makes no request to CWA, and shows nothing about CWA in the log and the web interface. A set INGEST_DIR still gets each changed book as a plain epub. Without it, the log names each CWA function that a missing setting turns off.
This commit is contained in:
+23
-1
@@ -14,7 +14,7 @@ const { setUnauthorizedHandler } = await import('../../bindery/static/js/lib.js'
|
||||
let api, main, details, cleanups;
|
||||
const config = {
|
||||
metadata_fields: { title: 'Title', authors: 'Authors', comments: 'Description', series: 'Series', pubdate: 'Published', tags: 'Tags', languages: 'Language' },
|
||||
mode_labels: { new: 'New chapters' }, library_available: true, update_interval: 2,
|
||||
mode_labels: { new: 'New chapters' }, library_available: true, cwa_enabled: true, update_interval: 2,
|
||||
job_list_max_hours: 720, job_list_max_count: 500,
|
||||
};
|
||||
const rule = { pattern: 'before', replacement: 'after', flags: 'i', note: '', enabled: true };
|
||||
@@ -641,3 +641,25 @@ test('chapter titles show the entities that FanFicFare keeps as text', async ()
|
||||
render([{ id: 'j', status: 'done', story_id: 1, result: { changed: [{ chapter_id: 2, title: 'A & B' }] } }]);
|
||||
assert.ok(find(el, 'a', 'A & B'));
|
||||
});
|
||||
|
||||
test('with CWA off, the pages show nothing about CWA', async () => {
|
||||
await mountStory();
|
||||
assert.ok(section(main, 'Library link'));
|
||||
const off = { ...config, cwa_enabled: false, library_available: false };
|
||||
// Values that show a notice with CWA on.
|
||||
Object.assign(details, { uploads_paused: true, ingest_available: false, link_books: false });
|
||||
details.story.upload_held = true;
|
||||
await mountStory(off);
|
||||
assert.ok(section(main, 'Metadata'));
|
||||
assert.equal(section(main, 'Library link'), undefined);
|
||||
assert.doesNotMatch(main.textContent, /CWA|INGEST_DIR|library/i);
|
||||
await mountStories(off);
|
||||
assert.ok(section(main, 'Add stories'));
|
||||
assert.equal(section(main, 'Import from the library'), undefined);
|
||||
assert.doesNotMatch(main.textContent, /CWA|INGEST_DIR|library/i);
|
||||
settingsPage(main, {}, off);
|
||||
await settle();
|
||||
assert.ok(section(main, 'Jobs list'));
|
||||
assert.equal(section(main, 'Uploads to CWA'), undefined);
|
||||
assert.doesNotMatch(main.textContent, /CWA|INGEST_DIR|library/i);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user