Add display_name to libraries' custom fields

This commit is contained in:
zv0n 2022-03-12 15:30:21 +01:00
parent 5538da535c
commit 9b860ce609
3 changed files with 22 additions and 8 deletions

View File

@ -26,7 +26,7 @@ extern "C" {
bool init(const string &configuration); bool init(const string &configuration);
std::vector< RenameObject > getOptions( const RenameObject &search ); std::vector< RenameObject > getOptions( const RenameObject &search );
bool renamePath( const string &path, const RenameObject &renamer ); bool renamePath( const string &path, const RenameObject &renamer );
// key name, key type // TODO create object
std::vector< std::unordered_map<string, string> > getCustomKeys(); std::vector< std::unordered_map<string, string> > getCustomKeys();
// option internal representation, option display value // option internal representation, option display value
std::vector< std::pair<string, string> > getCustomKeyOptions(const string &key); std::vector< std::pair<string, string> > getCustomKeyOptions(const string &key);

View File

@ -469,27 +469,32 @@ bool renamePath( const string &path, const RenameObject &renamer ) {
std::vector< std::unordered_map< string, string > > getCustomKeys() { std::vector< std::unordered_map< string, string > > getCustomKeys() {
return { { return { {
{ "name", "id"}, { "name", "id"},
{"type", NUM_TYPE}, { "display_name", "Movie ID" },
{"input", "true"} {"type", NUM_TYPE},
{"input", "true"}
}, },
{ {
{ "name", "language" }, { "name", "language" },
{ "display_name", "Language to use" },
{ "type", MULTICHOICE_TYPE }, { "type", MULTICHOICE_TYPE },
{ "input", "true" }, { "input", "true" },
}, },
{ {
{ "name", "year" }, { "name", "year" },
{ "display_name", "Year of release" },
{ "type", YEAR_TYPE }, { "type", YEAR_TYPE },
{ "input", "true" }, { "input", "true" },
}, },
{ {
{ "name", "original_title" }, { "name", "original_title" },
{ "display_name", "" },
{ "type", STRING_TYPE }, { "type", STRING_TYPE },
{ "input", "false" }, { "input", "false" },
}, },
{ {
{ "name", "use_original" }, { "name", "use_original" },
{ "display_name", "Use the original language title" },
{ "type", BOOL_TYPE }, { "type", BOOL_TYPE },
{ "input", "true" }, { "input", "true" },
}, },

View File

@ -591,27 +591,32 @@ bool renamePath( const string &path, const RenameObject &renamer ) {
std::vector< std::unordered_map< string, string > > getCustomKeys() { std::vector< std::unordered_map< string, string > > getCustomKeys() {
return { { return { {
{ "name", "id"}, { "name", "id"},
{"type", NUM_TYPE}, { "display_name", "TV Show ID" },
{"input", "true"} {"type", NUM_TYPE},
{"input", "true"}
}, },
{ {
{ "name", "language" }, { "name", "language" },
{ "type", STRING_TYPE }, { "display_name", "Language to use" },
{ "type", MULTICHOICE_TYPE },
{ "input", "true" }, { "input", "true" },
}, },
{ {
{ "name", "pattern" }, { "name", "pattern" },
{ "display_name", "Rename name pattern" },
{ "type", STRING_TYPE }, { "type", STRING_TYPE },
{ "input", "true" }, { "input", "true" },
}, },
{ {
{ "name", "order" }, { "name", "order" },
{ "display_name", "Episode order to use" },
{ "type", MULTICHOICE_TYPE }, { "type", MULTICHOICE_TYPE },
{ "input", "true" }, { "input", "true" },
}, },
{ {
{ "name", "year" }, { "name", "year" },
{ "display_name", "" },
{ "type", YEAR_TYPE }, { "type", YEAR_TYPE },
{ "input", "false" }, { "input", "false" },
} }
@ -621,6 +626,8 @@ std::vector< std::unordered_map< string, string > > getCustomKeys() {
std::vector< std::pair< string, string > > getCustomKeyOptions(const string &key) { std::vector< std::pair< string, string > > getCustomKeyOptions(const string &key) {
if(key == "language") { if(key == "language") {
return languages; return languages;
} else if(key == "order") {
return { {"aired", "Aired order"}, {"dvd", "DVD order"}};
} }
return {}; return {};
} }
@ -632,6 +639,8 @@ const string choiceDisplay() {
const string getCustomKeyDefault(const string &key) { const string getCustomKeyDefault(const string &key) {
if(key == "language") { if(key == "language") {
return "en"; return "en";
} else if(key == "order") {
return "aired";
} }
return ""; return "";
} }