diff --git a/src/calibre/srv/legacy.py b/src/calibre/srv/legacy.py index d3470258bc..5872740123 100644 --- a/src/calibre/srv/legacy.py +++ b/src/calibre/srv/legacy.py @@ -252,7 +252,20 @@ def mobile(ctx, rd): @endpoint('/browse/{+rest=""}') def browse(ctx, rd, rest): - raise HTTPRedirect(ctx.url_for(None)) + if rest.startswith('book/'): + # implementation of https://bugs.launchpad.net/calibre/+bug/1698411 + # redirect old server book URLs to new URLs + redirect = ctx.url_for(None) + '#book_id=' + rest[5:] + "&panel=book_details" + from lxml import etree as ET + return html(ctx, rd, endpoint, + E.html(E.head( + ET.XML(''), + ET.XML('' + )))) + else: + raise HTTPRedirect(ctx.url_for(None)) @endpoint('/stanza/{+rest=""}')