1
0
mirror of https://github.com/ElvishArtisan/rivendell.git synced 2025-04-11 07:12:56 +02:00

2017-06-27 Fred Gleason <fredg@paravelsystems.com>

* Added a '--title=' option to rdexport(1).
This commit is contained in:
Fred Gleason 2017-06-27 08:40:39 -04:00
parent 7d660a1485
commit 31dc2e5605
4 changed files with 45 additions and 0 deletions

@ -15866,3 +15866,5 @@
events with a hard time set when using the web API 'SaveLog' call.
2017-06-26 Fred Gleason <fredg@paravelsystems.com>
* Updated the package version to 2.16.0int03.
2017-06-27 Fred Gleason <fredg@paravelsystems.com>
* Added a '--title=' option to rdexport(1).

@ -380,6 +380,18 @@
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--title=</option><replaceable>title</replaceable>
</term>
<listitem>
<para>
Export all carts with a title of <replaceable>title</replaceable>.
This option may be given multiple times.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--xml</option>

@ -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;