This commit is contained in:
Alex Ling
2021-06-05 10:53:45 +00:00
parent 87c479bf42
commit 59bcb4db3b
7 changed files with 496 additions and 631 deletions
+10 -4
View File
@@ -638,8 +638,8 @@ struct APIRouter
"success" => Bool,
"error" => String?,
"chapters?" => [{
"id" => String,
"title" => String,
"id" => String,
"title?" => String,
}],
"title" => String?,
}
@@ -649,8 +649,14 @@ struct APIRouter
plugin = Plugin.new env.params.query["plugin"].as String
json = plugin.list_chapters query
chapters = json["chapters"]
title = json["title"]
if plugin.info.version == 1
chapters = json["chapters"]
title = json["title"]
else
chapters = json
title = nil
end
send_json env, {
"success" => true,
-19
View File
@@ -79,16 +79,6 @@ struct MainRouter
get "/download/plugins" do |env|
begin
id = env.params.query["plugin"]?
plugins = Plugin.list
plugin = nil
if id
plugin = Plugin.new id
elsif !plugins.empty?
plugin = Plugin.new plugins[0][:id]
end
layout "plugin-download"
rescue e
Logger.error e
@@ -96,15 +86,6 @@ struct MainRouter
end
end
get "/download/plugins2" do |env|
begin
layout "plugin-download-2"
rescue e
Logger.error e
env.response.status_code = 500
end
end
get "/download/subscription" do |env|
mangadex_base_url = Config.current.mangadex["base_url"]
username = get_username env