From d14f96048d30b0f536f59b70bf999d4d6e9bb0d0 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 16 Sep 2023 01:30:16 +0200 Subject: Update example config (and some other minor changes) --- example-config.json | 3 +++ plugins/LocalAnime.hpp | 6 +++--- src/plugins/LocalAnime.cpp | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/example-config.json b/example-config.json index a8f3aa0..5c220ec 100644 --- a/example-config.json +++ b/example-config.json @@ -102,6 +102,9 @@ }, // Font names should either be the full filepath to the font file or the font name. If font name is used then the fc-match command is used // to find the font file that matches that font name. + // Example font name: "DejaVu Sans" + // Example bold font name: "DejaVu Sans:bold" + // The config "use_system_fonts" has to be set to false to use these font configs. "font": { "latin": "", "latin_bold": "", diff --git a/plugins/LocalAnime.hpp b/plugins/LocalAnime.hpp index d0194ba..708cf45 100644 --- a/plugins/LocalAnime.hpp +++ b/plugins/LocalAnime.hpp @@ -13,19 +13,19 @@ namespace QuickMedia { struct LocalAnimeEpisode { Path path; - time_t modified_time_seconds; + time_t modified_time_seconds = 0; }; struct LocalAnimeSeason { std::string name; std::vector episodes; - time_t modified_time_seconds; + time_t modified_time_seconds = 0; }; struct LocalAnime { std::string name; std::vector items; - time_t modified_time_seconds; + time_t modified_time_seconds = 0; }; std::vector get_anime_in_directory(const Path &directory); diff --git a/src/plugins/LocalAnime.cpp b/src/plugins/LocalAnime.cpp index 5e4c1d7..e5c8e81 100644 --- a/src/plugins/LocalAnime.cpp +++ b/src/plugins/LocalAnime.cpp @@ -90,7 +90,7 @@ namespace QuickMedia { static time_t update_modified_time_from_episodes(LocalAnimeItem &item) { if(std::holds_alternative(item)) { LocalAnime &anime = std::get(item); - time_t last_modified = 0; + time_t last_modified = anime.modified_time_seconds; for(LocalAnimeItem &item : anime.items) { last_modified = std::max(last_modified, update_modified_time_from_episodes(item)); @@ -100,7 +100,7 @@ namespace QuickMedia { return last_modified; } else if(std::holds_alternative(item)) { LocalAnimeSeason &season = std::get(item); - time_t last_modified = 0; + time_t last_modified = season.modified_time_seconds; for(LocalAnimeItem &item : season.episodes) { last_modified = std::max(last_modified, update_modified_time_from_episodes(item)); @@ -117,7 +117,7 @@ namespace QuickMedia { } static time_t update_modified_time_from_episodes(LocalAnime &anime) { - time_t last_modified = 0; + time_t last_modified = anime.modified_time_seconds; for(LocalAnimeItem &item : anime.items) { last_modified = std::max(last_modified, update_modified_time_from_episodes(item)); @@ -163,7 +163,7 @@ namespace QuickMedia { } } - for(auto anime_it : anime_by_name) { + for(auto &anime_it : anime_by_name) { GroupedAnime &grouped_anime = anime_it.second; for(auto season_it : grouped_anime.seasons_by_name) { LocalAnimeSeason &season = season_it.second; -- cgit v1.2.3