diff --git a/koreader-plugin/bookorbit.koplugin/bookorbit_updater.lua b/koreader-plugin/bookorbit.koplugin/bookorbit_updater.lua index f0b158889..1448fef65 100644 --- a/koreader-plugin/bookorbit.koplugin/bookorbit_updater.lua +++ b/koreader-plugin/bookorbit.koplugin/bookorbit_updater.lua @@ -211,7 +211,7 @@ function UpdateCheck:doCheckForUpdate() end function UpdateCheck:handleUpdateVersionResponse(body, interactive, prompt_allowed) - local server_ver = body.serverVersion or "unknown" + local server_ver = tostring(body.serverVersion or "unknown"):gsub("^v", "") local plugin_latest = body.pluginVersion self.settings.update_check_last_at = os.time() diff --git a/server/src/modules/koreader/koreader-plugin-source.test.ts b/server/src/modules/koreader/koreader-plugin-source.test.ts index 97a32fd01..d1ce97c21 100644 --- a/server/src/modules/koreader/koreader-plugin-source.test.ts +++ b/server/src/modules/koreader/koreader-plugin-source.test.ts @@ -182,6 +182,14 @@ describe('KOReader plugin update source wiring', () => { expect(updater).toContain('self.settings.update_dismissed_version = plugin_latest'); }); + it('renders the server version with exactly one v prefix in update dialogs', async () => { + const updater = await readPluginFile('bookorbit_updater.lua'); + + expect(updater).toContain('local server_ver = tostring(body.serverVersion or "unknown"):gsub("^v", "")'); + expect(updater).toContain('Plugin is up to date (v%1).\\nServer: v%2'); + expect(updater).toContain('Update available: v%1 -> v%2\\nServer: v%3'); + }); + it('runs a throttled update check after successful full-library sweeps', async () => { const main = await readPluginFile('main.lua'); const sweep = await readPluginFile('bookorbit_sweep.lua');