- option to resume/start from beginning at the title view

- option to toggle read/unread status at the title view
- move all embeded JS to public/
This commit is contained in:
Alex Ling
2020-02-16 03:19:29 +00:00
parent 08a1052ca4
commit 93e6d7cae6
9 changed files with 176 additions and 78 deletions

View File

@@ -287,6 +287,25 @@ class Server
end
end
post "/api/progress/:title/:entry/:page" do |env|
begin
username = get_username env
title = (@library.get_title env.params.url["title"]).not_nil!
entry = (title.get_entry env.params.url["entry"]).not_nil!
page = env.params.url["page"].to_i
raise "incorrect page value" if page < 0 || page > entry.pages
title.save_progress username, entry.title, page
rescue e
send_json env, {
"success" => false,
"error" => e.message
}.to_json
else
send_json env, {"success" => true}.to_json
end
end
add_handler AuthHandler.new @storage
{% if flag?(:release) %}
# when building for relase, embed the static files in binary