From 7934864d58ec39b237e2b45d0180aa567b29b944 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 20 Sep 2021 03:37:00 +0200 Subject: Order mangadex search by relevence --- plugins/youtube/Signature.hpp | 4 +++- src/plugins/Mangadex.cpp | 2 +- src/plugins/Youtube.cpp | 3 ++- 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 #include @@ -42,4 +43,5 @@ namespace QuickMedia { std::vector func_calls; std::map 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 -- cgit v1.2.3