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);
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<string, string> > getCustomKeys();
// option internal representation, option display value
std::vector< std::pair<string, string> > getCustomKeyOptions(const string &key);

View File

@ -470,26 +470,31 @@ bool renamePath( const string &path, const RenameObject &renamer ) {
std::vector< std::unordered_map< string, string > > getCustomKeys() {
return { {
{ "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" },
},

View File

@ -592,26 +592,31 @@ bool renamePath( const string &path, const RenameObject &renamer ) {
std::vector< std::unordered_map< string, string > > getCustomKeys() {
return { {
{ "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 "";
}