mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-07 09:23:22 +02:00
2020-06-30 Fred Gleason <fredg@paravelsystems.com>
* Removed the 'exemplar' parameter from the 'RDFeed::create()' method. * Removed the 'Base Feed On' dropdown from the 'Add Feed' dialog in rdadmin(1). Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
4f96349789
commit
a3fcd11bab
@ -20059,3 +20059,8 @@
|
||||
main window of rdcastmanager(1).
|
||||
* Added a 'Public URL' column and a 'Copy URL to Clipboard'
|
||||
button to the main window of rdcastmanager(1).
|
||||
2020-06-30 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed the 'exemplar' parameter from the 'RDFeed::create()'
|
||||
method.
|
||||
* Removed the 'Base Feed On' dropdown from the 'Add Feed'
|
||||
dialog in rdadmin(1).
|
||||
|
175
lib/rdfeed.cpp
175
lib/rdfeed.cpp
@ -1422,13 +1422,12 @@ RDRssSchemas *RDFeed::rssSchemas() const
|
||||
|
||||
|
||||
unsigned RDFeed::create(const QString &keyname,bool enable_users,
|
||||
QString *err_msg,const QString &exemplar)
|
||||
QString *err_msg)
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDSqlQuery *q1;
|
||||
unsigned feed_id=0;
|
||||
bool ok=false;
|
||||
|
||||
//
|
||||
// Sanity Checks
|
||||
@ -1443,166 +1442,18 @@ unsigned RDFeed::create(const QString &keyname,bool enable_users,
|
||||
}
|
||||
delete q;
|
||||
|
||||
if(exemplar.isEmpty()) {
|
||||
//
|
||||
// Create an Empty Feed
|
||||
//
|
||||
sql=QString("insert into FEEDS set ")+
|
||||
"KEY_NAME=\""+RDEscapeString(keyname)+"\","+
|
||||
"ORIGIN_DATETIME=now(),"+
|
||||
"HEADER_XML=\"\","+
|
||||
"CHANNEL_XML=\"\","+
|
||||
"ITEM_XML=\"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
feed_id=q->lastInsertId().toUInt();
|
||||
delete q;
|
||||
}
|
||||
else {
|
||||
//
|
||||
// Create a Cloned Feed
|
||||
//
|
||||
sql=QString("select ")+
|
||||
"IS_SUPERFEED,"+ // 00
|
||||
"AUDIENCE_METRICS,"+ // 01
|
||||
"CHANNEL_TITLE,"+ // 02
|
||||
"CHANNEL_DESCRIPTION,"+ // 03
|
||||
"CHANNEL_CATEGORY,"+ // 04
|
||||
"CHANNEL_LINK,"+ // 05
|
||||
"CHANNEL_COPYRIGHT,"+ // 06
|
||||
"CHANNEL_WEBMASTER,"+ // 07
|
||||
"CHANNEL_LANGUAGE,"+ // 08
|
||||
"BASE_URL,"+ // 09
|
||||
"BASE_PREAMBLE,"+ // 10
|
||||
"PURGE_URL,"+ // 11
|
||||
"PURGE_USERNAME,"+ // 12
|
||||
"PURGE_PASSWORD,"+ // 13
|
||||
"HEADER_XML,"+ // 14
|
||||
"CHANNEL_XML,"+ // 15
|
||||
"ITEM_XML,"+ // 16
|
||||
"CAST_ORDER,"+ // 17
|
||||
"MAX_SHELF_LIFE,"+ // 18
|
||||
"ENABLE_AUTOPOST,"+ // 19
|
||||
"KEEP_METADATA,"+ // 20
|
||||
"UPLOAD_FORMAT,"+ // 21
|
||||
"UPLOAD_CHANNELS,"+ // 22
|
||||
"UPLOAD_SAMPRATE,"+ // 23
|
||||
"UPLOAD_BITRATE,"+ // 24
|
||||
"UPLOAD_QUALITY,"+ // 25
|
||||
"UPLOAD_EXTENSION,"+ // 26
|
||||
"NORMALIZE_LEVEL,"+ // 27
|
||||
"REDIRECT_PATH,"+ // 28
|
||||
"MEDIA_LINK_MODE,"+ // 29
|
||||
"CHANNEL_IMAGE_ID "+ // 30
|
||||
"from FEEDS where "+
|
||||
"KEY_NAME=\""+RDEscapeString(exemplar)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
sql=QString("insert into FEEDS set ")+
|
||||
"KEY_NAME=\""+RDEscapeString(keyname)+"\","+
|
||||
"IS_SUPERFEED=\""+q->value(0).toString()+"\","+
|
||||
"AUDIENCE_METRICS=\""+q->value(1).toString()+"\","+
|
||||
"CHANNEL_TITLE=\""+RDEscapeString(q->value(2).toString())+"\","+
|
||||
"CHANNEL_DESCRIPTION=\""+RDEscapeString(q->value(3).toString())+"\","+
|
||||
"CHANNEL_CATEGORY=\""+RDEscapeString(q->value(4).toString())+"\","+
|
||||
"CHANNEL_LINK=\""+RDEscapeString(q->value(5).toString())+"\","+
|
||||
"CHANNEL_COPYRIGHT=\""+RDEscapeString(q->value(6).toString())+"\","+
|
||||
"CHANNEL_WEBMASTER=\""+RDEscapeString(q->value(7).toString())+"\","+
|
||||
"CHANNEL_LANGUAGE=\""+RDEscapeString(q->value(8).toString())+"\","+
|
||||
"BASE_URL=\""+RDEscapeString(q->value(9).toString())+"\","+
|
||||
"BASE_PREAMBLE=\""+RDEscapeString(q->value(10).toString())+"\","+
|
||||
"PURGE_URL=\""+RDEscapeString(q->value(11).toString())+"\","+
|
||||
"PURGE_USERNAME=\""+RDEscapeString(q->value(12).toString())+"\","+
|
||||
"PURGE_PASSWORD=\""+RDEscapeString(q->value(13).toString())+"\","+
|
||||
"HEADER_XML=\""+RDEscapeString(q->value(14).toString())+"\","+
|
||||
"CHANNEL_XML=\""+RDEscapeString(q->value(15).toString())+"\","+
|
||||
"ITEM_XML=\""+RDEscapeString(q->value(16).toString())+"\","+
|
||||
"CAST_ORDER=\""+RDEscapeString(q->value(17).toString())+"\","+
|
||||
QString().sprintf("MAX_SHELF_LIFE=%d,",q->value(18).toInt())+
|
||||
"LAST_BUILD_DATETIME=now(),"+
|
||||
"ORIGIN_DATETIME=now(),"+
|
||||
"ENABLE_AUTOPOST=\""+RDEscapeString(q->value(19).toString())+"\","+
|
||||
"KEEP_METADATA=\""+RDEscapeString(q->value(20).toString())+"\","+
|
||||
QString().sprintf("UPLOAD_FORMAT=%d,",q->value(21).toInt())+
|
||||
QString().sprintf("UPLOAD_CHANNELS=%d,",q->value(22).toInt())+
|
||||
QString().sprintf("UPLOAD_SAMPRATE=%d,",q->value(23).toInt())+
|
||||
QString().sprintf("UPLOAD_BITRATE=%d,",q->value(24).toInt())+
|
||||
QString().sprintf("UPLOAD_QUALITY=%d,",q->value(25).toInt())+
|
||||
"UPLOAD_EXTENSION=\""+RDEscapeString(q->value(26).toString())+"\","+
|
||||
QString().sprintf("NORMALIZE_LEVEL=%d,",q->value(27).toInt())+
|
||||
"REDIRECT_PATH=\""+RDEscapeString(q->value(28).toString())+"\","+
|
||||
QString().sprintf("MEDIA_LINK_MODE=%d",q->value(29).toInt());
|
||||
// QString().sprintf("CHANNEL_IMAGE_ID=%d",q->value(30).toInt());
|
||||
|
||||
feed_id=RDSqlQuery::run(sql,&ok).toUInt();
|
||||
if(!ok) {
|
||||
*err_msg=tr("Unable to insert new feed record!");
|
||||
delete q;
|
||||
return 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Duplicate member feed references
|
||||
//
|
||||
if(q->value(0).toString()=="Y") {
|
||||
sql=QString("select ")+
|
||||
"MEMBER_KEY_NAME,"+ // 00
|
||||
"FEED_ID,"+ // 01
|
||||
"MEMBER_FEED_ID "+ // 02
|
||||
"from SUPERFEED_MAPS where "+
|
||||
"KEY_NAME=\""+RDEscapeString(exemplar)+"\"";
|
||||
q1=new RDSqlQuery(sql);
|
||||
while(q1->next()) {
|
||||
sql=QString("insert into SUPERFEED_MAPS set ")+
|
||||
"KEY_NAME=\""+RDEscapeString(keyname)+"\","+
|
||||
"MEMBER_KEY_NAME=\""+RDEscapeString(q1->value(0).toString())+"\","+
|
||||
QString().sprintf("FEED_ID=%u,",q1->value(1).toUInt())+
|
||||
QString().sprintf("MEMBER_FEED_ID=%u",q1->value(2).toUInt());
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
delete q1;
|
||||
}
|
||||
|
||||
//
|
||||
// Duplicate Image Library Entries
|
||||
//
|
||||
sql=QString("select ")+
|
||||
"ID,"+ // 00
|
||||
"WIDTH,"+ // 01
|
||||
"HEIGHT,"+ // 02
|
||||
"DEPTH,"+ // 03
|
||||
"DESCRIPTION,"+ // 04
|
||||
"FILE_EXTENSION,"+ // 05
|
||||
"DATA " // 06
|
||||
"from FEED_IMAGES where "+
|
||||
"FEED_KEY_NAME=\""+RDEscapeString(exemplar)+"\"";
|
||||
q1=new RDSqlQuery(sql);
|
||||
while(q1->next()) {
|
||||
sql=QString("insert into FEED_IMAGES set ")+
|
||||
QString().sprintf("FEED_ID=%u,",feed_id)+
|
||||
"FEED_KEY_NAME=\""+RDEscapeString(keyname)+"\","+
|
||||
QString().sprintf("WIDTH=%d,",q1->value(1).toInt())+
|
||||
QString().sprintf("HEIGHT=%d,",q1->value(2).toInt())+
|
||||
QString().sprintf("DEPTH=%d,",q1->value(3).toInt())+
|
||||
"DESCRIPTION=\""+RDEscapeString(q1->value(4).toString())+"\","+
|
||||
"FILE_EXTENSION=\""+RDEscapeString(q1->value(5).toString())+"\","+
|
||||
"DATA="+RDEscapeBlob(q1->value(6).toByteArray());
|
||||
int img_id=RDSqlQuery::run(sql,&ok).toInt();
|
||||
if(ok&&(q1->value(0).toInt()==q->value(30).toInt())) {
|
||||
sql=QString("update FEEDS set ")+
|
||||
QString().sprintf("CHANNEL_IMAGE_ID=%d ",img_id)+
|
||||
"where KEY_NAME=\""+RDEscapeString(keyname)+"\"";
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
}
|
||||
delete q1;
|
||||
}
|
||||
else {
|
||||
*err_msg=tr("Exemplar feed")+" \""+exemplar+"\" "+tr("does not exist!");
|
||||
delete q;
|
||||
return 0;
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
//
|
||||
// Create Feed
|
||||
//
|
||||
sql=QString("insert into FEEDS set ")+
|
||||
"KEY_NAME=\""+RDEscapeString(keyname)+"\","+
|
||||
"ORIGIN_DATETIME=now(),"+
|
||||
"HEADER_XML=\"\","+
|
||||
"CHANNEL_XML=\"\","+
|
||||
"ITEM_XML=\"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
feed_id=q->lastInsertId().toUInt();
|
||||
delete q;
|
||||
|
||||
//
|
||||
// Create Default Feed Perms
|
||||
|
@ -151,7 +151,7 @@ class RDFeed : public QObject
|
||||
QString rssXml(QString *err_msg,bool *ok=NULL);
|
||||
RDRssSchemas *rssSchemas() const;
|
||||
static unsigned create(const QString &keyname,bool enable_users,
|
||||
QString *err_msg,const QString &exemplar="");
|
||||
QString *err_msg);
|
||||
static QString errorString(RDFeed::Error err);
|
||||
static QString imageFilename(int feed_id,int img_id,const QString &ext);
|
||||
static QString publicUrl(const QString &base_url,const QString &keyname);
|
||||
|
@ -65,23 +65,6 @@ AddFeed::AddFeed(unsigned *id,QString *keyname,QWidget *parent)
|
||||
feed_keyname_label->setFont(labelFont());
|
||||
feed_keyname_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
|
||||
//
|
||||
// Exemplar
|
||||
//
|
||||
feed_exemplar_box=new QComboBox(this);
|
||||
feed_exemplar_box->insertItem(0,tr("Empty Feed Config"));
|
||||
QString sql=QString("select KEY_NAME from FEEDS order by KEY_NAME");
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
feed_exemplar_box->
|
||||
insertItem(feed_exemplar_box->count(),q->value(0).toString());
|
||||
}
|
||||
delete q;
|
||||
feed_exemplar_label=
|
||||
new QLabel(feed_exemplar_box,tr("Base Feed On")+": ",this);
|
||||
feed_exemplar_label->setFont(labelFont());
|
||||
feed_exemplar_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
|
||||
//
|
||||
// Enable Users Checkbox
|
||||
//
|
||||
@ -119,7 +102,7 @@ AddFeed::~AddFeed()
|
||||
|
||||
QSize AddFeed::sizeHint() const
|
||||
{
|
||||
return QSize(290,153);
|
||||
return QSize(290,123);
|
||||
}
|
||||
|
||||
|
||||
@ -138,13 +121,9 @@ void AddFeed::keynameChangedData(const QString &str)
|
||||
void AddFeed::okData()
|
||||
{
|
||||
QString err_msg;
|
||||
QString exemplar="";
|
||||
|
||||
if(feed_exemplar_box->currentIndex()!=0) {
|
||||
exemplar=feed_exemplar_box->currentText();
|
||||
}
|
||||
*feed_id=RDFeed::create(feed_keyname_edit->text(),feed_users_box->isChecked(),
|
||||
&err_msg,exemplar);
|
||||
&err_msg);
|
||||
if(*feed_id!=0) {
|
||||
*feed_keyname=feed_keyname_edit->text();
|
||||
done(0);
|
||||
@ -166,11 +145,8 @@ void AddFeed::resizeEvent(QResizeEvent *e)
|
||||
feed_keyname_label->setGeometry(10,11,120,19);
|
||||
feed_keyname_edit->setGeometry(135,11,sizeHint().width()-140,19);
|
||||
|
||||
feed_exemplar_label->setGeometry(10,35,120,19);
|
||||
feed_exemplar_box->setGeometry(135,35,sizeHint().width()-140,19);
|
||||
|
||||
feed_users_box->setGeometry(40,65,15,15);
|
||||
feed_users_label->setGeometry(60,63,sizeHint().width()-60,19);
|
||||
feed_users_box->setGeometry(40,35,15,15);
|
||||
feed_users_label->setGeometry(60,33,sizeHint().width()-60,19);
|
||||
|
||||
feed_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);
|
||||
feed_cancel_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
||||
|
@ -49,8 +49,6 @@ class AddFeed : public RDDialog
|
||||
private:
|
||||
QLabel *feed_keyname_label;
|
||||
QLineEdit *feed_keyname_edit;
|
||||
QLabel *feed_exemplar_label;
|
||||
QComboBox *feed_exemplar_box;
|
||||
QCheckBox *feed_users_box;
|
||||
QLabel *feed_users_label;
|
||||
QPushButton *feed_ok_button;
|
||||
|
@ -246,14 +246,6 @@ a záloha původní databáze uložena v </translation>
|
||||
<source>Add RSS Feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty Feed Config</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Base Feed On</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddGroup</name>
|
||||
|
@ -172,14 +172,6 @@ worden. Aktuelle Version</translation>
|
||||
<source>Add RSS Feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty Feed Config</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Base Feed On</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add Feed Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -255,14 +255,6 @@ y un respaldo de la base de datos se guardó en </translation>
|
||||
<source>Add RSS Feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty Feed Config</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Base Feed On</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddGroup</name>
|
||||
|
@ -23,14 +23,6 @@
|
||||
<source>Add RSS Feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty Feed Config</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Base Feed On</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add Feed Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -162,14 +162,6 @@ oppdatert til versjon </translation>
|
||||
<source>Add RSS Feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty Feed Config</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Base Feed On</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add Feed Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -162,14 +162,6 @@ oppdatert til versjon </translation>
|
||||
<source>Add RSS Feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty Feed Config</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Base Feed On</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add Feed Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
@ -155,14 +155,6 @@ atualizada para a Versão</translation>
|
||||
<source>Add RSS Feed</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Empty Feed Config</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Base Feed On</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Add Feed Error</source>
|
||||
<translation type="unfinished"></translation>
|
||||
|
Loading…
x
Reference in New Issue
Block a user