From 9b860ce609bc72054f883c82b5d009da0ed18d83 Mon Sep 17 00:00:00 2001 From: zv0n Date: Sat, 12 Mar 2022 15:30:21 +0100 Subject: [PATCH] Add display_name to libraries' custom fields --- library.hpp | 2 +- themoviedb/moviedb.cpp | 11 ++++++++--- thetvdb/tv_rename.cpp | 17 +++++++++++++---- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/library.hpp b/library.hpp index 4a76f2b..cb02f49 100644 --- a/library.hpp +++ b/library.hpp @@ -26,7 +26,7 @@ extern "C" { bool init(const string &configuration); std::vector< RenameObject > getOptions( const RenameObject &search ); bool renamePath( const string &path, const RenameObject &renamer ); -// key name, key type +// TODO create object std::vector< std::unordered_map > getCustomKeys(); // option internal representation, option display value std::vector< std::pair > getCustomKeyOptions(const string &key); diff --git a/themoviedb/moviedb.cpp b/themoviedb/moviedb.cpp index 605567d..015c095 100644 --- a/themoviedb/moviedb.cpp +++ b/themoviedb/moviedb.cpp @@ -469,27 +469,32 @@ bool renamePath( const string &path, const RenameObject &renamer ) { std::vector< std::unordered_map< string, string > > getCustomKeys() { return { { - { "name", "id"}, - {"type", NUM_TYPE}, - {"input", "true"} + { "name", "id"}, + { "display_name", "Movie ID" }, + {"type", NUM_TYPE}, + {"input", "true"} }, { { "name", "language" }, + { "display_name", "Language to use" }, { "type", MULTICHOICE_TYPE }, { "input", "true" }, }, { { "name", "year" }, + { "display_name", "Year of release" }, { "type", YEAR_TYPE }, { "input", "true" }, }, { { "name", "original_title" }, + { "display_name", "" }, { "type", STRING_TYPE }, { "input", "false" }, }, { { "name", "use_original" }, + { "display_name", "Use the original language title" }, { "type", BOOL_TYPE }, { "input", "true" }, }, diff --git a/thetvdb/tv_rename.cpp b/thetvdb/tv_rename.cpp index 37386fa..5d4cdef 100644 --- a/thetvdb/tv_rename.cpp +++ b/thetvdb/tv_rename.cpp @@ -591,27 +591,32 @@ bool renamePath( const string &path, const RenameObject &renamer ) { std::vector< std::unordered_map< string, string > > getCustomKeys() { return { { - { "name", "id"}, - {"type", NUM_TYPE}, - {"input", "true"} + { "name", "id"}, + { "display_name", "TV Show ID" }, + {"type", NUM_TYPE}, + {"input", "true"} }, { { "name", "language" }, - { "type", STRING_TYPE }, + { "display_name", "Language to use" }, + { "type", MULTICHOICE_TYPE }, { "input", "true" }, }, { { "name", "pattern" }, + { "display_name", "Rename name pattern" }, { "type", STRING_TYPE }, { "input", "true" }, }, { { "name", "order" }, + { "display_name", "Episode order to use" }, { "type", MULTICHOICE_TYPE }, { "input", "true" }, }, { { "name", "year" }, + { "display_name", "" }, { "type", YEAR_TYPE }, { "input", "false" }, } @@ -621,6 +626,8 @@ std::vector< std::unordered_map< string, string > > getCustomKeys() { std::vector< std::pair< string, string > > getCustomKeyOptions(const string &key) { if(key == "language") { return languages; + } else if(key == "order") { + return { {"aired", "Aired order"}, {"dvd", "DVD order"}}; } return {}; } @@ -632,6 +639,8 @@ const string choiceDisplay() { const string getCustomKeyDefault(const string &key) { if(key == "language") { return "en"; + } else if(key == "order") { + return "aired"; } return ""; }