mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-09 22:43:11 +02:00
Merge branch 'deltecent-rdexport'
This commit is contained in:
commit
92a019aebb
@ -20398,3 +20398,5 @@
|
||||
2020-10-07 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Changed the predicted next release version from '4.0' to '3.5'.
|
||||
in rddbmgr(8).
|
||||
2020-10-07 Patrick Linstruth <patrick@deltecent.com>
|
||||
* Added '--scheduler-code=' switch to rdexport(1).
|
||||
|
@ -424,6 +424,18 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--scheduler-code=</option><replaceable>scheduler-code</replaceable>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specify a scheduler code to be exported. This option may be given multiple
|
||||
times.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--title=</option><replaceable>title</replaceable>
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <rdcart.h>
|
||||
#include <rdescape_string.h>
|
||||
#include <rdgroup.h>
|
||||
#include <rdschedcode.h>
|
||||
|
||||
#include "rdexport.h"
|
||||
|
||||
@ -51,6 +52,7 @@ MainObject::MainObject(QObject *parent)
|
||||
export_channels=0;
|
||||
export_quality=3;
|
||||
export_xml=false;
|
||||
export_verbose=false;
|
||||
|
||||
//
|
||||
// Open the Database
|
||||
@ -162,6 +164,10 @@ MainObject::MainObject(QObject *parent)
|
||||
export_groups.push_back(rda->cmdSwitch()->value(i));
|
||||
rda->cmdSwitch()->setProcessed(i,true);
|
||||
}
|
||||
if(rda->cmdSwitch()->key(i)=="--scheduler-code") {
|
||||
export_schedcodes.push_back(rda->cmdSwitch()->value(i));
|
||||
rda->cmdSwitch()->setProcessed(i,true);
|
||||
}
|
||||
if(rda->cmdSwitch()->key(i)=="--metadata-pattern") {
|
||||
export_metadata_pattern=rda->cmdSwitch()->value(i);
|
||||
rda->cmdSwitch()->setProcessed(i,true);
|
||||
@ -231,6 +237,27 @@ MainObject::MainObject(QObject *parent)
|
||||
exit(256);
|
||||
}
|
||||
|
||||
//
|
||||
// Validate Scheduler Code List
|
||||
//
|
||||
std::vector<QString> bad_schedcodes;
|
||||
for(unsigned i=0;i<export_schedcodes.size();i++) {
|
||||
RDSchedCode *sch=new RDSchedCode(export_schedcodes[i]);
|
||||
if(!sch->exists()) {
|
||||
bad_schedcodes.push_back(export_schedcodes[i]);
|
||||
}
|
||||
delete sch;
|
||||
}
|
||||
if(bad_schedcodes.size()>0) {
|
||||
QString str="no such scheduler code(s): ";
|
||||
for(unsigned i=0;i<bad_schedcodes.size();i++) {
|
||||
str+=bad_schedcodes[i]+", ";
|
||||
}
|
||||
str=str.left(str.length()-2);
|
||||
fprintf(stderr,"rdexport: %s\n",(const char *)str.toUtf8());
|
||||
exit(256);
|
||||
}
|
||||
|
||||
//
|
||||
// RIPC Connection
|
||||
//
|
||||
@ -272,6 +299,14 @@ void MainObject::userData()
|
||||
ExportGroup(export_groups[i]);
|
||||
}
|
||||
|
||||
//
|
||||
// Process Scheduler Codes
|
||||
//
|
||||
for(unsigned i=0;i<export_schedcodes.size();i++) {
|
||||
Verbose("Processing scheduler code \""+export_schedcodes[i]+"\"...");
|
||||
ExportSchedCode(export_schedcodes[i]);
|
||||
}
|
||||
|
||||
//
|
||||
// Process Cart Ranges
|
||||
//
|
||||
@ -322,6 +357,22 @@ void MainObject::ExportGroup(const QString &groupname)
|
||||
}
|
||||
|
||||
|
||||
void MainObject::ExportSchedCode(const QString &schedcode)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
sql=QString("select CART_NUMBER from CART_SCHED_CODES where ")+
|
||||
"SCHED_CODE=\""+RDEscapeString(schedcode)+"\" "+
|
||||
"order by CART_NUMBER";
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
ExportCart(q->value(0).toUInt());
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
void MainObject::ExportCart(unsigned cartnum)
|
||||
{
|
||||
RDCart *cart=new RDCart(cartnum);
|
||||
|
@ -43,6 +43,7 @@ class MainObject : public QObject
|
||||
private:
|
||||
void ExportTitle(const QString &title);
|
||||
void ExportGroup(const QString &groupname);
|
||||
void ExportSchedCode(const QString &schedcode);
|
||||
void ExportCart(unsigned cartnum);
|
||||
void ExportCut(RDCart *cart,RDCut *cut);
|
||||
QString ResolveOutputName(RDCart *cart,RDCut *cut,const QString &exten);
|
||||
@ -52,6 +53,7 @@ class MainObject : public QObject
|
||||
std::vector<unsigned> export_end_carts;
|
||||
std::vector<QString> export_groups;
|
||||
std::vector<QString> export_titles;
|
||||
std::vector<QString> export_schedcodes;
|
||||
QString export_metadata_pattern;
|
||||
QString export_output_to;
|
||||
QString export_format;
|
||||
|
Loading…
x
Reference in New Issue
Block a user