aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-06 20:41:53 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-06 20:41:53 +0200
commitf30b6fdf5c40a703b5a8d6fb2a21002377ec9067 (patch)
treec5a73a2529229bef776880068838b4568b458862 /include
parent09b44d9681eaf66670f77cbd440300cdc22f3df3 (diff)
Reduce local-anime/local-manga disk access for speed up on mechanical harddrives, add local_anime.recursive option to make local-anime much faster when local-anime directory is a downloads directory
Diffstat (limited to 'include')
-rw-r--r--include/Config.hpp1
-rw-r--r--include/Storage.hpp6
2 files changed, 5 insertions, 2 deletions
diff --git a/include/Config.hpp b/include/Config.hpp
index 68e4462..e737fee 100644
--- a/include/Config.hpp
+++ b/include/Config.hpp
@@ -48,6 +48,7 @@ namespace QuickMedia {
bool sort_by_name = false; // Series
bool sort_episodes_by_name = true;
bool auto_group_episodes = true;
+ bool recursive = true;
};
struct YoutubeSponsorblock {
diff --git a/include/Storage.hpp b/include/Storage.hpp
index 19dd345..60c15f6 100644
--- a/include/Storage.hpp
+++ b/include/Storage.hpp
@@ -20,8 +20,8 @@ namespace QuickMedia {
DESC
};
- // Return false to stop the iterator
- using FileIteratorCallback = std::function<bool(const Path &filepath, FileType file_type)>;
+ // Return false to stop the iterator.
+ using FileIteratorCallback = std::function<bool(const Path &filepath, FileType file_type, time_t last_modified_seconds)>;
Path get_home_dir();
Path get_storage_dir();
@@ -34,8 +34,10 @@ namespace QuickMedia {
bool file_get_last_modified_time_seconds(const char *path, time_t *result);
int file_overwrite(const Path &path, const std::string &data);
int file_overwrite_atomic(const Path &path, const std::string &data);
+ // The callback is called with 0 as the argument (last_modified_seconds)
void for_files_in_dir(const Path &path, FileIteratorCallback callback);
void for_files_in_dir_sort_last_modified(const Path &path, FileIteratorCallback callback, FileSortDirection sort_dir = FileSortDirection::ASC);
+ // The callback is called with 0 as the argument (last_modified_seconds)
void for_files_in_dir_sort_name(const Path &path, FileIteratorCallback callback, FileSortDirection sort_dir = FileSortDirection::ASC);
bool read_file_as_json(const Path &filepath, Json::Value &result);