aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/LocalAnime.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/plugins/LocalAnime.cpp b/src/plugins/LocalAnime.cpp
index a47ea74..cc82df1 100644
--- a/src/plugins/LocalAnime.cpp
+++ b/src/plugins/LocalAnime.cpp
@@ -330,11 +330,11 @@ 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, this), create_search_bar("Search...", SEARCH_DELAY_FILTER) });
+ result_tabs.push_back(Tab{ create_body(false, true), 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, this), create_search_bar("Search...", SEARCH_DELAY_FILTER) });
+ result_tabs.push_back(Tab{ create_body(false, true), 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);
@@ -365,9 +365,9 @@ namespace QuickMedia {
const LocalAnime &anime = std::get<LocalAnime>(anime_item);
std::string title;
- if(has_finished_watching)
- title = "[Finished watching] ";
title += anime.name;
+ if(has_finished_watching)
+ title += "\n[Finished watching]";
auto body_item = BodyItem::create(std::move(title));
if(has_finished_watching)
@@ -390,9 +390,9 @@ namespace QuickMedia {
const LocalAnimeSeason &season = std::get<LocalAnimeSeason>(anime_item);
std::string title;
- if(has_finished_watching)
- title = "[Finished watching] ";
title += season.name;
+ if(has_finished_watching)
+ title += "\n[Finished watching]";
auto body_item = BodyItem::create(std::move(title));
if(has_finished_watching)
@@ -415,15 +415,30 @@ namespace QuickMedia {
const LocalAnimeEpisode &episode = std::get<LocalAnimeEpisode>(anime_item);
std::string title;
+
+ title += "Episode ";
+ std::optional<EpisodeNameParts> name_parts = episode_name_extract_parts(episode.path.filename());
+ if(name_parts)
+ title += name_parts->episode;
+ else
+ title += episode.path.filename_no_ext();
+
if(has_finished_watching)
- title = "[Finished watching] ";
- title += episode.path.filename();
+ title += "\n[Finished watching]";
auto body_item = BodyItem::create(std::move(title));
if(has_finished_watching)
body_item->set_title_color(finished_watching_color);
- body_item->set_description("Updated " + seconds_to_relative_time_str(time_now - episode.modified_time_seconds));
+ std::string description;
+ if(name_parts) {
+ description += "Resolution: ";
+ description += name_parts->resolution;
+ description += '\n';
+ }
+
+ description += "Updated " + seconds_to_relative_time_str(time_now - episode.modified_time_seconds);
+ body_item->set_description(std::move(description));
body_item->set_description_color(get_theme().faded_text_color);
body_item->url = episode.path.data;
@@ -465,8 +480,9 @@ namespace QuickMedia {
mgl::Color color = get_theme().text_color;
std::string title;
+ title += Path(selected_item->url).filename();
if(watch_status == WatchedStatus::WATCHED) {
- title = "[Finished watching] ";
+ title += "\n[Finished watching]";
color = finished_watching_color;
item_data->watch_progress.time_pos_sec = *file_analyzer.get_duration_seconds();
@@ -475,7 +491,6 @@ namespace QuickMedia {
item_data->watch_progress.time_pos_sec = 0;
item_data->watch_progress.duration_sec = *file_analyzer.get_duration_seconds();
}
- title += Path(selected_item->url).filename();
selected_item->set_title(std::move(title));
selected_item->set_title_color(color);