From f1b37ea02dd1240a6a68ae7d27dc7defab9ba309 Mon Sep 17 00:00:00 2001 From: daniel-j Date: Mon, 22 Jul 2024 17:59:54 +0200 Subject: [PATCH] add Tolino support (UA contains "eReader") reported in #28 --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index ebca70b..e1ce207 100644 --- a/index.js +++ b/index.js @@ -370,7 +370,7 @@ router.post('/upload', async (ctx, next) => { return } - } else if (mimetype === TYPE_EPUB && (info.agent.includes('Kobo') || info.agent.toLowerCase().includes('tolino')) && ctx.request.body.kepubify) { + } else if (mimetype === TYPE_EPUB && info.agent.includes('Kobo') && ctx.request.body.kepubify) { // convert to Kobo EPUB conversion = 'kepubify' const outname = ctx.request.file.path.replace(/\.epub$/i, '.kepub.epub') @@ -562,7 +562,7 @@ router.get('/receive', async ctx => { router.get('/', async ctx => { const agent = ctx.get('user-agent') console.log(ctx.ip, agent) - await sendfile(ctx, agent.includes('Kobo') || agent.includes('Kindle') || agent.toLowerCase().includes('tolino') ? 'static/download.html' : 'static/upload.html') + await sendfile(ctx, agent.includes('Kobo') || agent.includes('Kindle') || agent.toLowerCase().includes('tolino') || agent.includes('eReader') /*"eReader" is on Tolino*/ ? 'static/download.html' : 'static/upload.html') }) router.get('/:filename', downloadFile)