aboutsummaryrefslogtreecommitdiff
path: root/src/QuickMedia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/QuickMedia.cpp')
-rw-r--r--src/QuickMedia.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index d006f3d..9b982a1 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -14,6 +14,7 @@
#include "../plugins/Saucenao.hpp"
#include "../plugins/Info.hpp"
#include "../plugins/HotExamples.hpp"
+#include "../plugins/MyAnimeList.hpp"
#include "../include/Scale.hpp"
#include "../include/Program.hpp"
#include "../include/VideoPlayer.hpp"
@@ -77,6 +78,7 @@ static const std::pair<const char*, const char*> valid_plugins[] = {
std::make_pair("4chan", "4chan_logo.png"),
std::make_pair("nyaa.si", "nyaa_si_logo.png"),
std::make_pair("matrix", "matrix_logo.png"),
+ std::make_pair("mal", "mal_logo.png"),
std::make_pair("hotexamples", nullptr),
std::make_pair("file-manager", nullptr),
std::make_pair("stdin", nullptr),
@@ -308,7 +310,7 @@ namespace QuickMedia {
return PluginResult::OK;
}
- bool submit_is_async() override { return false; }
+ bool submit_is_async() const override { return false; }
void add_option(Body *body, std::string title, std::string description, OptionsPageHandler handler) {
assert(handler);
@@ -349,7 +351,7 @@ namespace QuickMedia {
static void usage() {
fprintf(stderr, "usage: quickmedia [plugin] [--no-video] [--use-system-mpv-config] [--dir <directory>] [-e <window>] [youtube-url]\n");
fprintf(stderr, "OPTIONS:\n");
- fprintf(stderr, " plugin The plugin to use. Should be either launcher, 4chan, manga, manganelo, manganelos, mangatown, mangakatana, mangadex, readm, onimanga, youtube, soundcloud, nyaa.si, matrix, saucenao, hotexamples, file-manager, stdin, pornhub, spankbang, xvideos or xhamster\n");
+ fprintf(stderr, " plugin The plugin to use. Should be either launcher, 4chan, manga, manganelo, manganelos, mangatown, mangakatana, mangadex, readm, onimanga, youtube, soundcloud, nyaa.si, matrix, saucenao, hotexamples, mal, file-manager, stdin, pornhub, spankbang, xvideos or xhamster\n");
fprintf(stderr, " --no-video Only play audio when playing a video. Disabled by default\n");
fprintf(stderr, " --use-system-mpv-config Use system mpv config instead of no config. Disabled by default\n");
fprintf(stderr, " --upscale-images Upscale low-resolution manga pages using waifu2x-ncnn-vulkan. Disabled by default\n");
@@ -1091,6 +1093,7 @@ namespace QuickMedia {
pipe_body->set_items({
create_launcher_body_item("4chan", "4chan", resources_root + "icons/4chan_launcher.png"),
create_launcher_body_item("Hot Examples", "hotexamples", ""),
+ create_launcher_body_item("MyAnimeList", "mal", resources_root + "images/mal_logo.png"),
create_launcher_body_item("Manga (all)", "manga", ""),
create_launcher_body_item("Mangadex", "mangadex", resources_root + "icons/mangadex_launcher.png"),
create_launcher_body_item("Mangakatana", "mangakatana", resources_root + "icons/mangakatana_launcher.png"),
@@ -1204,6 +1207,8 @@ namespace QuickMedia {
hot_examples_front_page_fill(body_items);
body->set_items(std::move(body_items));
tabs.push_back(Tab{std::move(body), std::make_unique<HotExamplesLanguageSelectPage>(this), create_search_bar("Search...", SEARCH_DELAY_FILTER)});
+ } else if(strcmp(plugin_name, "mal") == 0) {
+ tabs.push_back(Tab{create_body(), std::make_unique<MyAnimeListSearchPage>(this), create_search_bar("Search...", 400)});
} else if(strcmp(plugin_name, "file-manager") == 0) {
auto file_manager_page = std::make_unique<FileManagerPage>(this, fm_mime_type, file_selection_handler);
if(!file_manager_page->set_current_directory(file_manager_start_dir))
@@ -1685,7 +1690,6 @@ namespace QuickMedia {
for(Tab &tab : tabs) {
if(tab.body->attach_side == AttachSide::BOTTOM)
tab.body->select_last_item();
- tab.body->thumbnail_max_size = tab.page->get_thumbnail_max_size();
tab.page->on_navigate_to_page(tab.body.get());
}