mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
implemented https://bugs.launchpad.net/calibre/+bug/1698411 feature
This commit is contained in:
parent
a9589b8983
commit
7499637ce6
@ -251,8 +251,19 @@ def mobile(ctx, rd):
|
|||||||
|
|
||||||
|
|
||||||
@endpoint('/browse/{+rest=""}')
|
@endpoint('/browse/{+rest=""}')
|
||||||
def browse(ctx, rd, rest):
|
def browse(ctx, rd, rest): # implementation of https://bugs.launchpad.net/calibre/+bug/1698411
|
||||||
raise HTTPRedirect(ctx.url_for(None))
|
if rest.find('book/') == 0:
|
||||||
|
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('<meta http-equiv="refresh" content="0;url=' + redirect + '"/>'),
|
||||||
|
ET.XML('<script language="javascript">' +
|
||||||
|
'window.location.href = "' + redirect + '"' +
|
||||||
|
'</script>'
|
||||||
|
))))
|
||||||
|
else:
|
||||||
|
raise HTTPRedirect(ctx.url_for(None))
|
||||||
|
|
||||||
|
|
||||||
@endpoint('/stanza/{+rest=""}')
|
@endpoint('/stanza/{+rest=""}')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user