From 33167be93badbd69f703b2c081b0bb6df3a65ce6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 27 Jun 2024 00:06:08 +0200 Subject: Add local_anime.sort_episodes_by_name config to allow sorting episodes differently than series. True by default --- src/Config.cpp | 1 + src/plugins/LocalAnime.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Config.cpp b/src/Config.cpp index 8a9752d..5d16083 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -273,6 +273,7 @@ namespace QuickMedia { if(local_anime_json.isObject()) { get_json_value_path(local_anime_json, "directory", config->local_anime.directory); get_json_value(local_anime_json, "sort_by_name", config->local_anime.sort_by_name); + get_json_value(local_anime_json, "sort_episodes_by_name", config->local_anime.sort_episodes_by_name); get_json_value(local_anime_json, "auto_group_episodes", config->local_anime.auto_group_episodes); } diff --git a/src/plugins/LocalAnime.cpp b/src/plugins/LocalAnime.cpp index bab662b..c906b9b 100644 --- a/src/plugins/LocalAnime.cpp +++ b/src/plugins/LocalAnime.cpp @@ -173,7 +173,7 @@ namespace QuickMedia { } update_modified_time_from_episodes(grouped_anime.anime); - if(get_config().local_anime.sort_by_name) + if(get_config().local_anime.sort_episodes_by_name) sort_anime_items_by_name_desc(grouped_anime.anime.items); else sort_anime_items_by_timestamp_asc(grouped_anime.anime.items); @@ -228,7 +228,7 @@ namespace QuickMedia { return true; }; - if(get_config().local_anime.sort_by_name) + if(get_config().local_anime.sort_episodes_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)); -- cgit v1.2.3