aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-16 02:24:28 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-16 02:24:28 +0100
commitd89ea960364f6518f412897d0601a1161b5aee6a (patch)
treeddb96665dc92ee4bae24bd7bbf14d3e709a6219e /src/plugins
parent2030684b16004a4f6c60f499584366ae5ad57bc9 (diff)
local_manga: move local manga config from local_manga_... to local_manga. object
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/LocalManga.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/plugins/LocalManga.cpp b/src/plugins/LocalManga.cpp
index 8ab8cd1..4367401 100644
--- a/src/plugins/LocalManga.cpp
+++ b/src/plugins/LocalManga.cpp
@@ -131,7 +131,7 @@ namespace QuickMedia {
return only_include_latest ? false : true;
};
- if(get_config().local_manga_sort_chapters_by_name)
+ if(get_config().local_manga.sort_chapters_by_name)
for_files_in_dir_sort_name(directory, std::move(callback), FileSortDirection::DESC);
else
for_files_in_dir_sort_last_modified(directory, std::move(callback));
@@ -155,7 +155,7 @@ namespace QuickMedia {
return true;
};
- if(get_config().local_manga_sort_by_name)
+ if(get_config().local_manga.sort_by_name)
for_files_in_dir_sort_name(directory, std::move(callback), FileSortDirection::ASC);
else
for_files_in_dir_sort_last_modified(directory, std::move(callback));
@@ -164,13 +164,13 @@ namespace QuickMedia {
}
static bool validate_local_manga_dir_config_is_set() {
- if(get_config().local_manga_directory.empty()) {
- show_notification("QuickMedia", "local_manga_directory config is not set", Urgency::CRITICAL);
+ if(get_config().local_manga.directory.empty()) {
+ show_notification("QuickMedia", "local_manga.directory config is not set", Urgency::CRITICAL);
return false;
}
- if(get_file_type(get_config().local_manga_directory) != FileType::DIRECTORY) {
- show_notification("QuickMedia", "local_manga_directory config is not set to a valid directory", Urgency::CRITICAL);
+ if(get_file_type(get_config().local_manga.directory) != FileType::DIRECTORY) {
+ show_notification("QuickMedia", "local_manga.directory config is not set to a valid directory", Urgency::CRITICAL);
return false;
}
@@ -187,7 +187,7 @@ namespace QuickMedia {
if(!validate_local_manga_dir_config_is_set())
return false;
- Path manga_url = Path(get_config().local_manga_directory).join(manga_name);
+ Path manga_url = Path(get_config().local_manga.directory).join(manga_name);
std::vector<LocalMangaChapter> chapters = get_chapters_in_manga(manga_name, manga_url, true, true);
if(chapters.empty() || chapters.front().pages.empty())
return false;
@@ -337,7 +337,7 @@ namespace QuickMedia {
if(!validate_local_manga_dir_config_is_set())
return PluginResult::OK;
- Path manga_url = Path(get_config().local_manga_directory).join(args.url);
+ Path manga_url = Path(get_config().local_manga.directory).join(args.url);
std::vector<LocalMangaChapter> chapters = get_chapters_in_manga(args.url, manga_url, false, false);
auto manga_it = std::find_if(manga_list.begin(), manga_list.end(), [&args](const LocalManga &local_manga) {
@@ -374,7 +374,7 @@ namespace QuickMedia {
if(!validate_local_manga_dir_config_is_set())
return PluginResult::OK;
- manga_list = get_manga_in_directory(get_config().local_manga_directory, true);
+ manga_list = get_manga_in_directory(get_config().local_manga.directory, true);
if(standalone)
finished_reading_manga = get_manga_finished_reading(manga_list);
@@ -475,7 +475,7 @@ namespace QuickMedia {
ImageResult LocalMangaImagesPage::update_image_urls(int &num_images) {
num_images = 0;
- Path chapter_url = Path(get_config().local_manga_directory).join(manga_name).join(url);
+ Path chapter_url = Path(get_config().local_manga.directory).join(manga_name).join(url);
std::vector<LocalMangaPage> pages = get_images_in_manga(chapter_url);
if(pages.empty())
return ImageResult::ERR;