aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-09-16 01:30:16 +0200
committerdec05eba <dec05eba@protonmail.com>2023-09-16 01:30:16 +0200
commitd14f96048d30b0f536f59b70bf999d4d6e9bb0d0 (patch)
tree36a7a76ae3c99cb7dd69d52b0539ae8ef799fa17
parent3b541a9a4c0423178d68a1c34ab85efa9d97fc3b (diff)
Update example config (and some other minor changes)
-rw-r--r--example-config.json3
-rw-r--r--plugins/LocalAnime.hpp6
-rw-r--r--src/plugins/LocalAnime.cpp8
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<LocalAnimeItem> episodes;
- time_t modified_time_seconds;
+ time_t modified_time_seconds = 0;
};
struct LocalAnime {
std::string name;
std::vector<LocalAnimeItem> items;
- time_t modified_time_seconds;
+ time_t modified_time_seconds = 0;
};
std::vector<LocalAnimeItem> 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<LocalAnime>(item)) {
LocalAnime &anime = std::get<LocalAnime>(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<LocalAnimeSeason>(item)) {
LocalAnimeSeason &season = std::get<LocalAnimeSeason>(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;