mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-10-11 09:03:40 +02:00
2017-06-27 Fred Gleason <fredg@paravelsystems.com>
* Added a '--title=' option to rdexport(1).
This commit is contained in:
@@ -175,6 +175,10 @@ MainObject::MainObject(QObject *parent)
|
||||
}
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(cmd->key(i)=="--title") {
|
||||
export_titles.push_back(cmd->value(i));
|
||||
cmd->setProcessed(i,true);
|
||||
}
|
||||
if(cmd->key(i)=="--verbose") {
|
||||
export_verbose=true;
|
||||
cmd->setProcessed(i,true);
|
||||
@@ -276,6 +280,14 @@ void MainObject::userData()
|
||||
exit(256);
|
||||
}
|
||||
|
||||
//
|
||||
// Process Titles
|
||||
//
|
||||
for(unsigned i=0;i<export_titles.size();i++) {
|
||||
Verbose("Processing title \""+export_titles[i]+"\"...");
|
||||
ExportTitle(export_titles[i]);
|
||||
}
|
||||
|
||||
//
|
||||
// Process Groups
|
||||
//
|
||||
@@ -300,6 +312,23 @@ void MainObject::userData()
|
||||
}
|
||||
|
||||
|
||||
void MainObject::ExportTitle(const QString &title)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("select NUMBER from CART where ")+
|
||||
"(TITLE=\""+RDEscapeString(title)+"\")&&"+
|
||||
QString().sprintf("(TYPE=%u) ",RDCart::Audio)+
|
||||
"order by NUMBER";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
ExportCart(q->value(0).toUInt());
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
void MainObject::ExportGroup(const QString &groupname)
|
||||
{
|
||||
QString sql;
|
||||
|
@@ -45,6 +45,7 @@ class MainObject : public QObject
|
||||
void userData();
|
||||
|
||||
private:
|
||||
void ExportTitle(const QString &title);
|
||||
void ExportGroup(const QString &groupname);
|
||||
void ExportCart(unsigned cartnum);
|
||||
void ExportCut(RDCart *cart,RDCut *cut);
|
||||
@@ -54,6 +55,7 @@ class MainObject : public QObject
|
||||
std::vector<unsigned> export_start_carts;
|
||||
std::vector<unsigned> export_end_carts;
|
||||
std::vector<QString> export_groups;
|
||||
std::vector<QString> export_titles;
|
||||
QString export_metadata_pattern;
|
||||
QString export_output_to;
|
||||
QString export_format;
|
||||
|
Reference in New Issue
Block a user