From b6b972e2dae816a8f0686f4986029a5ed50e592c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 4 Nov 2020 01:30:38 +0100 Subject: Add channels page to related videos menu, fix related videos menu broken after video failing to load --- include/QuickMedia.hpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/QuickMedia.hpp b/include/QuickMedia.hpp index 0641228..0d4b384 100644 --- a/include/QuickMedia.hpp +++ b/include/QuickMedia.hpp @@ -26,6 +26,7 @@ namespace QuickMedia { class ImageBoardThreadPage; class RoomData; class MatrixChatPage; + class VideoPage; enum class ImageViewMode { SINGLE, @@ -63,10 +64,14 @@ namespace QuickMedia { void set_go_to_previous_page(); TaskResult run_task_with_loading_screen(std::function callback); + + const char* get_plugin_name() const; + void manga_get_watch_history(const char *plugin_name, BodyItems &history_items); + void youtube_get_watch_history(BodyItems &history_items); private: void base_event_handler(sf::Event &event, PageType previous_page, Body *body, SearchBar *search_bar, bool handle_key_press = true, bool handle_searchbar = true); - void page_loop(std::vector &tabs); - void video_content_page(Page *page, std::string video_url, std::string video_title, bool download_if_streaming_fails); + void page_loop(std::vector &tabs, int start_tab_index = 0, std::function after_submit_handler = nullptr); + void video_content_page(VideoPage *video_page, std::string video_url, std::string video_title, bool download_if_streaming_fails); // Returns -1 to go to previous chapter, 0 to stay on same chapter and 1 to go to next chapter int image_page(MangaImagesPage *images_page, Body *chapters_body); void image_continuous_page(MangaImagesPage *images_page); @@ -88,12 +93,10 @@ namespace QuickMedia { // Returns PageType::EXIT if empty PageType pop_page_stack(); - void manga_get_watch_history(const char *plugin_name, BodyItems &history_items); - void youtube_get_watch_history(BodyItems &history_items); Json::Value load_video_history_json(); Json::Value load_recommended_json(); - void save_recommendations_from_related_videos(const std::string &video_url, const std::string &video_title, const Body *related_media_body); + void save_recommendations_from_related_videos(const std::string &video_url, const std::string &video_title, const BodyItems &related_media_body_items); private: enum class UpscaleImageAction { NO, -- cgit v1.2.3