diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-09-20 03:37:00 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-09-20 03:37:00 +0200 |
commit | 7934864d58ec39b237e2b45d0180aa567b29b944 (patch) | |
tree | 94103a8fd9e8f857537f63490af9e8857a96a22f | |
parent | cd3c2a139ed17fe9a4abf5f08a95d995843e6d44 (diff) |
Order mangadex search by relevence
-rw-r--r-- | plugins/youtube/Signature.hpp | 4 | ||||
-rw-r--r-- | src/plugins/Mangadex.cpp | 2 | ||||
-rw-r--r-- | src/plugins/Youtube.cpp | 3 | ||||
-rw-r--r-- | src/plugins/youtube/Signature.cpp | 4 |
4 files changed, 9 insertions, 4 deletions
diff --git a/plugins/youtube/Signature.hpp b/plugins/youtube/Signature.hpp index fc235df..265bbce 100644 --- a/plugins/youtube/Signature.hpp +++ b/plugins/youtube/Signature.hpp @@ -1,5 +1,6 @@ #pragma once +#ifdef YOUTUBE_SIGNATURE_DECRYPTOR #include "../../include/AsyncTask.hpp" #include <string> #include <vector> @@ -42,4 +43,5 @@ namespace QuickMedia { std::vector<DecryptFuncCall> func_calls; std::map<std::string, DecryptFunction> func_decls; }; -}
\ No newline at end of file +} +#endif
\ No newline at end of file diff --git a/src/plugins/Mangadex.cpp b/src/plugins/Mangadex.cpp index 671e9c7..a232d65 100644 --- a/src/plugins/Mangadex.cpp +++ b/src/plugins/Mangadex.cpp @@ -94,7 +94,7 @@ namespace QuickMedia { }; static PluginResult search_manga(Page *plugin_page, SearchType search_type, const std::string &query, int page, BodyItems &result_items) { - std::string url = "https://api.mangadex.org/manga?limit=20&includes[]=cover_art&offset=" + std::to_string(page * 20); + std::string url = "https://api.mangadex.org/manga?limit=20&order[relevance]=desc&includes[]=cover_art&offset=" + std::to_string(page * 20); const std::string query_encoded = url_param_encode(query); switch(search_type) { case SearchType::TITLE: diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp index a289b65..06e030b 100644 --- a/src/plugins/Youtube.cpp +++ b/src/plugins/Youtube.cpp @@ -2581,13 +2581,14 @@ R"END( //std::string url_decoded = url_param_decode(url); //url_decoded += "&alr=yes&cver=2.20210615.01.00&cpn=" + cpn; +#ifdef YOUTUBE_SIGNATURE_DECRYPTOR const std::string &s = cipher_params["s"]; const std::string &sp = cipher_params["sp"]; std::string sig_key; std::string sig_value; if(YoutubeSignatureDecryptor::get_instance().decrypt(s, sp, sig_key, sig_value)) url += "&" + std::move(sig_key) + "=" + std::move(sig_value); - +#endif youtube_format.url = std::move(url); return true; } diff --git a/src/plugins/youtube/Signature.cpp b/src/plugins/youtube/Signature.cpp index 30c78b6..91796d0 100644 --- a/src/plugins/youtube/Signature.cpp +++ b/src/plugins/youtube/Signature.cpp @@ -1,3 +1,4 @@ +#ifdef YOUTUBE_SIGNATURE_DECRYPTOR #include "../../../plugins/youtube/Signature.hpp" #include "../../../include/Storage.hpp" #include "../../../include/Notification.hpp" @@ -311,4 +312,5 @@ namespace QuickMedia { file_overwrite_atomic(get_cache_dir().join("youtube").join("decryption_function"), decryption_function); return 0; } -}
\ No newline at end of file +} +#endif
\ No newline at end of file |