aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/LocalAnime.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/LocalAnime.cpp b/src/plugins/LocalAnime.cpp
index 8434810..0de33b4 100644
--- a/src/plugins/LocalAnime.cpp
+++ b/src/plugins/LocalAnime.cpp
@@ -321,15 +321,15 @@ namespace QuickMedia {
LocalAnimeBodyItemData *item_data = static_cast<LocalAnimeBodyItemData*>(args.extra.get());
if(std::holds_alternative<LocalAnime>(*item_data->anime_item)) {
const LocalAnime &anime = std::get<LocalAnime>(*item_data->anime_item);
- result_tabs.push_back(Tab{ create_body(), std::make_unique<LocalAnimeSearchPage>(program, anime.items), create_search_bar("Search...", SEARCH_DELAY_FILTER) });
+ result_tabs.push_back(Tab{ create_body(), std::make_unique<LocalAnimeSearchPage>(program, anime.items, this), create_search_bar("Search...", SEARCH_DELAY_FILTER) });
return PluginResult::OK;
} else if(std::holds_alternative<LocalAnimeSeason>(*item_data->anime_item)) {
const LocalAnimeSeason &season = std::get<LocalAnimeSeason>(*item_data->anime_item);
- result_tabs.push_back(Tab{ create_body(), std::make_unique<LocalAnimeSearchPage>(program, season.episodes), create_search_bar("Search...", SEARCH_DELAY_FILTER) });
+ result_tabs.push_back(Tab{ create_body(), std::make_unique<LocalAnimeSearchPage>(program, season.episodes, this), create_search_bar("Search...", SEARCH_DELAY_FILTER) });
return PluginResult::OK;
} else if(std::holds_alternative<LocalAnimeEpisode>(*item_data->anime_item)) {
const LocalAnimeEpisode &episode = std::get<LocalAnimeEpisode>(*item_data->anime_item);
- result_tabs.push_back(Tab{ nullptr, std::make_unique<LocalAnimeVideoPage>(program, episode.path.data, &item_data->watch_progress), nullptr });
+ result_tabs.push_back(Tab{ nullptr, std::make_unique<LocalAnimeVideoPage>(program, this, episode.path.data, &item_data->watch_progress), nullptr });
return PluginResult::OK;
}
return PluginResult::ERR;
@@ -483,6 +483,13 @@ namespace QuickMedia {
return std::to_string(watch_progress->time_pos_sec);
}
+ static void refresh_pages_recursive(LocalAnimeSearchPage *search_page) {
+ while(search_page) {
+ search_page->needs_refresh = true;
+ search_page = search_page->parent_search_page;
+ }
+ }
+
void LocalAnimeVideoPage::set_watch_progress(int64_t time_pos_sec) {
std::string filename_relative_to_anime_dir = anime_path_to_item_name(url);
@@ -497,6 +504,7 @@ namespace QuickMedia {
return;
}
+ refresh_pages_recursive(search_page);
watch_progress->time_pos_sec = time_pos_sec;
watch_progress->duration_sec = *file_analyzer.get_duration_seconds();
set_watch_progress_for_plugin("local-anime", filename_relative_to_anime_dir, time_pos_sec, *file_analyzer.get_duration_seconds(), url);