Upgrade to MangaDex API v2

This commit is contained in:
Alex Ling
2021-01-30 17:08:04 +00:00
parent ca8e9a164e
commit 70d418d1a1
9 changed files with 92 additions and 275 deletions

View File

@@ -27,7 +27,7 @@ class Config
@[YAML::Field(ignore: true)]
@mangadex_defaults = {
"base_url" => "https://mangadex.org",
"api_url" => "https://mangadex.org/api",
"api_url" => "https://mangadex.org/api/v2",
"download_wait_seconds" => 5,
"download_retries" => 4,
"download_queue_db_path" => File.expand_path("~/mango/queue.db",
@@ -91,5 +91,14 @@ class Config
raise "Login is disabled, but default username is not set. " \
"Please set a default username"
end
unless mangadex["api_url"] =~ /\/v2/
# `Logger.default` is not available yet
Log.setup :debug
Log.warn { "It looks like you are using the deprecated MangaDex API " \
"v1 in your config file. Please update it to either " \
"https://mangadex.org/api/v2 or " \
"https://api.mangadex.org/v2 to suppress this warning." }
mangadex["api_url"] = "https://mangadex.org/api/v2"
end
end
end