From 2eba5464536c2c11aef8ed4701e7676cc807dfef Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Fri, 3 Jul 2020 12:57:13 -0400 Subject: [PATCH] 2020-07-03 Fred Gleason * Dropped the 'FEEDS.AUDIENCE_METRICS' field from the database. * Dropped the 'FEEDS.KEEP_METADATA' field from the database. * Dropped the 'FEEDS.MEDIA_LINK_MODE' field from the database. * Dropped the 'FEEDS.REDIRECT_PATH' field from the database. * Dropped the 'CAST_DOWNLOADS' table from the database. * Incremented the database version to 328. * Removed support for dynamically generated RSS feed metadata. Signed-off-by: Fred Gleason --- .gitignore | 1 - ChangeLog | 8 + conf/rd-bin.conf.in | 10 +- configure.ac | 1 - docs/tables/Makefile.am | 1 - docs/tables/cast_downloads.txt | 12 - docs/tables/feeds.txt | 4 - lib/Makefile.am | 1 - lib/dbversion.h | 2 +- lib/rdfeed.cpp | 160 +++--------- lib/rdfeed.h | 12 +- lib/rdfeedlog.cpp | 96 ------- lib/rdfeedlog.h | 33 --- rdadmin/add_feed.cpp | 1 - rdadmin/edit_feed.cpp | 366 ++++++++------------------- rdadmin/edit_feed.h | 15 +- rdadmin/list_feeds.cpp | 37 +-- rdadmin/rdadmin_cs.ts | 38 +-- rdadmin/rdadmin_de.ts | 64 +---- rdadmin/rdadmin_es.ts | 38 +-- rdadmin/rdadmin_fr.ts | 64 +---- rdadmin/rdadmin_nb.ts | 62 +---- rdadmin/rdadmin_nn.ts | 62 +---- rdadmin/rdadmin_pt_BR.ts | 62 +---- rdcastmanager/Makefile.am | 2 - rdcastmanager/edit_cast.cpp | 45 +--- rdcastmanager/edit_cast.h | 4 - rdcastmanager/list_casts.cpp | 43 +--- rdcastmanager/list_casts.h | 2 - rdcastmanager/pick_report_dates.cpp | 290 --------------------- rdcastmanager/pick_report_dates.h | 55 ---- rdcastmanager/rdcastmanager_cs.ts | 29 +-- rdcastmanager/rdcastmanager_de.ts | 29 +-- rdcastmanager/rdcastmanager_es.ts | 18 +- rdcastmanager/rdcastmanager_fr.ts | 42 --- rdcastmanager/rdcastmanager_nb.ts | 31 +-- rdcastmanager/rdcastmanager_nn.ts | 31 +-- rdcastmanager/rdcastmanager_pt_BR.ts | 29 +-- rivendell.spec.in | 4 +- utils/rddbmgr/revertschema.cpp | 49 ++++ utils/rddbmgr/schemamap.cpp | 2 +- utils/rddbmgr/updateschema.cpp | 10 + utils/rdpurgecasts/rdpurgecasts.cpp | 28 +- web/Makefile.am | 3 +- web/rdcastmanager/rdcastmanager.cpp | 3 +- web/rdfeed/Makefile.am | 48 ---- web/rdfeed/rdfeed.pro | 0 web/rdfeed/rdfeed_script.cpp | 262 ------------------- web/rdfeed/rdfeed_script.h | 43 ---- 49 files changed, 355 insertions(+), 1897 deletions(-) delete mode 100644 docs/tables/cast_downloads.txt delete mode 100644 lib/rdfeedlog.cpp delete mode 100644 lib/rdfeedlog.h delete mode 100644 rdcastmanager/pick_report_dates.cpp delete mode 100644 rdcastmanager/pick_report_dates.h delete mode 100644 web/rdfeed/Makefile.am delete mode 100644 web/rdfeed/rdfeed.pro delete mode 100644 web/rdfeed/rdfeed_script.cpp delete mode 100644 web/rdfeed/rdfeed_script.h diff --git a/.gitignore b/.gitignore index 6978a1a9..14013623 100644 --- a/.gitignore +++ b/.gitignore @@ -165,7 +165,6 @@ utils/rdselect_helper/rdprofile.cpp utils/rdselect_helper/rdprofile.h utils/rdselect_helper/rdselect_helper utils/sas_shim/sas_shim -web/rdfeed/rdfeed.xml xdg/rdalsaconfig-root-consolehelper xdg/rddbconfig-root-consolehelper xdg/rivendell-opsguide-html.desktop diff --git a/ChangeLog b/ChangeLog index c79e7829..c0517524 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20088,3 +20088,11 @@ 'Editing Podcast' dialog in rdcastmanager(1). * Made the 'Category' control conditional in the 'Editing Podcast' dialog in rdcastmanager(1). +2020-07-03 Fred Gleason + * Dropped the 'FEEDS.AUDIENCE_METRICS' field from the database. + * Dropped the 'FEEDS.KEEP_METADATA' field from the database. + * Dropped the 'FEEDS.MEDIA_LINK_MODE' field from the database. + * Dropped the 'FEEDS.REDIRECT_PATH' field from the database. + * Dropped the 'CAST_DOWNLOADS' table from the database. + * Incremented the database version to 328. + * Removed support for dynamically generated RSS feed metadata. diff --git a/conf/rd-bin.conf.in b/conf/rd-bin.conf.in index 5a686a74..6e0cc041 100644 --- a/conf/rd-bin.conf.in +++ b/conf/rd-bin.conf.in @@ -1,8 +1,8 @@ -# rdfeed.conf +# rd-bin.conf # # This is the Apache Web Server configuration for Rivendell. # -# (C) Copyright 2007,2010,2016 Fred Gleason +# (C) Copyright 2007-2020 Fred Gleason # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as @@ -35,15 +35,9 @@ SetHandler default-handler - - SetHandler cgi-script - SetHandler cgi-script - - SetHandler cgi-script - ScriptAlias /rd-bin/ "@libexecdir@/" TimeOut 1200 diff --git a/configure.ac b/configure.ac index 0c49c32b..93cb573d 100644 --- a/configure.ac +++ b/configure.ac @@ -507,7 +507,6 @@ AC_CONFIG_FILES([rivendell.spec \ rdhpi/Makefile \ cae/Makefile \ web/Makefile \ - web/rdfeed/Makefile \ web/rdcastmanager/Makefile \ web/rdxport/Makefile \ web/tests/Makefile \ diff --git a/docs/tables/Makefile.am b/docs/tables/Makefile.am index 2ede8dbb..3077cba4 100644 --- a/docs/tables/Makefile.am +++ b/docs/tables/Makefile.am @@ -28,7 +28,6 @@ EXTRA_DIST = audio_cards.txt\ aux_metadata.txt\ cart.txt\ cartslots.txt\ - cast_downloads.txt\ clipboard.txt\ clock_lines.txt\ clock_perms.txt\ diff --git a/docs/tables/cast_downloads.txt b/docs/tables/cast_downloads.txt deleted file mode 100644 index c6016e22..00000000 --- a/docs/tables/cast_downloads.txt +++ /dev/null @@ -1,12 +0,0 @@ - CAST_DOWNLOADS Table Layout for Rivendell - -The CAST_DOWNLOADS table holds data concerning downloads of podcast episodes. - - -FIELD NAME TYPE REMARKS ------------------------------------------------------------------------------- -ID int(10) unsigned Primary key, Auto Increment -FEED_KEY_NAME varchar(8) From FEEDS.KEY_NAME -CAST_ID int(10) unsigned From PODCASTS.ID -ACCESS_DATE date -ACCESS_COUNT int(10) unsigned diff --git a/docs/tables/feeds.txt b/docs/tables/feeds.txt index 7005c661..386384bc 100644 --- a/docs/tables/feeds.txt +++ b/docs/tables/feeds.txt @@ -7,7 +7,6 @@ FIELD NAME TYPE REMARKS ID int(10) unsigned Primary key, auto increment KEY_NAME varchar(8) Unique IS_SUPERFEED enum('N','Y') -AUDIENCE_METRICS enum('N','Y') CHANNEL_TITLE varchar(191) CHANNEL_DESCRIPTION text CHANNEL_CATEGORY varchar(64) @@ -36,7 +35,6 @@ MAX_SHELF_LIFE int(11) LAST_BUILD_DATETIME datetime ORIGIN_DATETIME datetime ENABLE_AUTOPOST enum('N','Y') -KEEP_METADATA enum('N','Y') DEFAULT_ITEM_IMAGE_ID int(11) From FEED_IMAGES.ID UPLOAD_FORMAT int(11) UPLOAD_CHANNELS int(11) @@ -45,5 +43,3 @@ UPLOAD_BITRATE int(11) UPLOAD_QUALITY int(11) UPLOAD_EXTENSION varchar(16) NORMALIZE_LEVEL int(11) -REDIRECT_PATH varchar(191) -MEDIA_LINK_MODE int(11) diff --git a/lib/Makefile.am b/lib/Makefile.am index 3f7efb19..ef89d9dc 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -127,7 +127,6 @@ dist_librd_la_SOURCES = dbversion.h\ rdeventimportlist.cpp rdeventimportlist.h\ rdexport_settings_dialog.cpp rdexport_settings_dialog.h\ rdfeed.cpp rdfeed.h\ - rdfeedlog.cpp rdfeedlog.h\ rdfontengine.cpp rdfontengine.h\ rdformpost.cpp rdformpost.h\ rdflacdecode.cpp rdflacdecode.h\ diff --git a/lib/dbversion.h b/lib/dbversion.h index 9b7a83b5..b84a64e8 100644 --- a/lib/dbversion.h +++ b/lib/dbversion.h @@ -24,7 +24,7 @@ /* * Current Database Version */ -#define RD_VERSION_DATABASE 327 +#define RD_VERSION_DATABASE 328 #endif // DBVERSION_H diff --git a/lib/rdfeed.cpp b/lib/rdfeed.cpp index 9f742aab..d0b4de57 100644 --- a/lib/rdfeed.cpp +++ b/lib/rdfeed.cpp @@ -163,19 +163,6 @@ QStringList RDFeed::isSubfeedOf() const } -bool RDFeed::audienceMetrics() const -{ - return RDBool(RDGetSqlValue("FEEDS","KEY_NAME",feed_keyname, - "AUDIENCE_METRICS").toString()); -} - - -void RDFeed::setAudienceMetrics(bool state) -{ - SetRow("AUDIENCE_METRICS",RDYesNo(state)); -} - - QString RDFeed::keyName() const { return feed_keyname; @@ -585,19 +572,6 @@ void RDFeed::setEnableAutopost(bool state) const } -bool RDFeed::keepMetadata() const -{ - return RDBool(RDGetSqlValue("FEEDS","KEY_NAME",feed_keyname, - "KEEP_METADATA").toString()); -} - - -void RDFeed::setKeepMetadata(bool state) -{ - SetRow("KEEP_METADATA",RDYesNo(state)); -} - - RDSettings::Format RDFeed::uploadFormat() const { return (RDSettings::Format)RDGetSqlValue("FEEDS","KEY_NAME",feed_keyname, @@ -702,33 +676,6 @@ void RDFeed::setNormalizeLevel(int lvl) const } -QString RDFeed::redirectPath() const -{ - return RDGetSqlValue("FEEDS","KEY_NAME",feed_keyname,"REDIRECT_PATH"). - toString(); -} - - -void RDFeed::setRedirectPath(const QString &str) -{ - SetRow("REDIRECT_PATH",str); -} - - -RDFeed::MediaLinkMode RDFeed::mediaLinkMode() const -{ - return (RDFeed::MediaLinkMode)RDGetSqlValue("FEEDS","KEY_NAME", - feed_keyname,"MEDIA_LINK_MODE"). - toUInt(); -} - - -void RDFeed::setMediaLinkMode(RDFeed::MediaLinkMode mode) const -{ - SetRow("MEDIA_LINK_MODE",(unsigned)mode); -} - - int RDFeed::importImageFile(const QString &pathname,QString *err_msg, QString desc) const { @@ -832,29 +779,13 @@ bool RDFeed::deleteImage(int img_id,QString *err_msg) } -QString RDFeed::audioUrl(RDFeed::MediaLinkMode mode, - const QString &cgi_hostname,unsigned cast_id) +QString RDFeed::audioUrl(const QString &cgi_hostname,unsigned cast_id) { RDPodcast *cast=new RDPodcast(feed_config,cast_id); QUrl url(baseUrl(cast->feedId())); QString ret; - switch(mode) { - case RDFeed::LinkNone: - ret=""; - break; - - case RDFeed::LinkDirect: - cast=new RDPodcast(feed_config,cast_id); - ret=url.toString()+"/"+cast->audioFilename(); - break; - - case RDFeed::LinkCounted: - ret=QString("http://")+basePreamble()+cgi_hostname+ - "/rd-bin/rdfeed."+uploadExtension()+"?"+keyName()+ - QString().sprintf("&cast_id=%d",cast_id); - break; - } + ret=url.toString()+"/"+cast->audioFilename(); delete cast; return ret; @@ -946,15 +877,12 @@ bool RDFeed::postXmlConditional(const QString &caption,QWidget *widget) { QString err_msg; - if(!audienceMetrics()) { - if(!postXml(&err_msg)) { - QMessageBox::warning(widget,caption+" - "+tr("Error"), - tr("XML data upload failed!")+"\n"+ - "["+err_msg+"]"); - return false; - } + if(!postXml(&err_msg)) { + QMessageBox::warning(widget,caption+" - "+tr("Error"), + tr("XML data upload failed!")+"\n"+ + "["+err_msg+"]"); + return false; } - return true; } @@ -1118,10 +1046,8 @@ unsigned RDFeed::postCut(RDUser *user,RDStation *station, cast->setItemImageId(defaultItemImageId()); delete cast; - if(!audienceMetrics()) { - emit postProgressChanged(4); - postXml(&err_msg); - } + emit postProgressChanged(4); + postXml(&err_msg); emit postProgressChanged(totalPostSteps()); @@ -1248,10 +1174,8 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station, cast->setItemImageId(defaultItemImageId()); delete cast; - if(!audienceMetrics()) { - emit postProgressChanged(4); - postXml(&err_msg); - } + emit postProgressChanged(4); + postXml(&err_msg); emit postProgressChanged(totalPostSteps()); @@ -1262,9 +1186,6 @@ unsigned RDFeed::postFile(RDUser *user,RDStation *station, int RDFeed::totalPostSteps() const { - if(audienceMetrics()) { - return RDFEED_TOTAL_POST_STEPS; - } return RDFEED_TOTAL_POST_STEPS+1; } @@ -1285,9 +1206,7 @@ QString RDFeed::rssXml(QString *err_msg,bool *ok) "FEEDS.CHANNEL_TITLE,"+ // 00 "FEEDS.CHANNEL_DESCRIPTION,"+ // 01 "FEEDS.CHANNEL_CATEGORY,"+ // 02 - "FEEDS.CHANNEL_SUB_CATEGORY,"+ // 03 - "FEEDS.CHANNEL_LINK,"+ // 04 "FEEDS.CHANNEL_COPYRIGHT,"+ // 05 "FEEDS.CHANNEL_EDITOR,"+ // 06 @@ -1306,15 +1225,13 @@ QString RDFeed::rssXml(QString *err_msg,bool *ok) "FEEDS.ID,"+ // 19 "FEEDS.UPLOAD_EXTENSION,"+ // 20 "FEEDS.CAST_ORDER,"+ // 21 - "FEEDS.REDIRECT_PATH,"+ // 22 - "FEEDS.BASE_PREAMBLE,"+ // 23 - "FEEDS.AUDIENCE_METRICS,"+ // 24 - "FEEDS.IS_SUPERFEED,"+ // 25 - "FEED_IMAGES.ID,"+ // 26 - "FEED_IMAGES.WIDTH,"+ // 27 - "FEED_IMAGES.HEIGHT,"+ // 28 - "FEED_IMAGES.DESCRIPTION,"+ // 29 - "FEED_IMAGES.FILE_EXTENSION "+ // 30 + "FEEDS.BASE_PREAMBLE,"+ // 22 + "FEEDS.IS_SUPERFEED,"+ // 23 + "FEED_IMAGES.ID,"+ // 24 + "FEED_IMAGES.WIDTH,"+ // 25 + "FEED_IMAGES.HEIGHT,"+ // 26 + "FEED_IMAGES.DESCRIPTION,"+ // 27 + "FEED_IMAGES.FILE_EXTENSION "+ // 28 "from FEEDS "; sql+="left join FEED_IMAGES "; sql+="on FEEDS.CHANNEL_IMAGE_ID=FEED_IMAGES.ID "; @@ -1353,7 +1270,7 @@ QString RDFeed::rssXml(QString *err_msg,bool *ok) // Render Item XML // QString where; - if(chan_q->value(25).toString()=="Y") { // Is a Superfeed + if(chan_q->value(23).toString()=="Y") { // Is a Superfeed sql=QString("select ")+ "MEMBER_FEED_ID "+ // 00 "from SUPERFEED_MAPS where "+ @@ -1642,13 +1559,13 @@ QString RDFeed::ResolveChannelWildcards(const QString &tmplt,RDSqlQuery *chan_q) ret.replace("%FEED_URL%",RDXmlEscape(chan_q->value(18).toString())+"/"+ RDXmlEscape(keyName()+"."+RD_RSS_XML_FILE_EXTENSION)); ret.replace("%IMAGE_URL%",chan_q->value(18).toString()+"/"+ - RDFeed::imageFilename(id(),chan_q->value(26).toInt(), - chan_q->value(30).toString())); + RDFeed::imageFilename(id(),chan_q->value(24).toInt(), + chan_q->value(28).toString())); ret.replace("%IMAGE_WIDTH%", - QString().sprintf("%d",chan_q->value(27).toInt())); + QString().sprintf("%d",chan_q->value(25).toInt())); ret.replace("%IMAGE_HEIGHT%", - QString().sprintf("%d",chan_q->value(27).toInt())); - ret.replace("%IMAGE_DESCRIPTION%",chan_q->value(29).toString()); + QString().sprintf("%d",chan_q->value(25).toInt())); + ret.replace("%IMAGE_DESCRIPTION%",chan_q->value(27).toString()); return ret; } @@ -1671,18 +1588,10 @@ QString RDFeed::ResolveItemWildcards(const QString &tmplt,RDSqlQuery *item_q, RDXmlEscape(item_q->value(3).toString())); ret.replace("%ITEM_LINK%",RDXmlEscape(item_q->value(4).toString())); ret.replace("%ITEM_AUTHOR%",RDXmlEscape(item_q->value(5).toString())); - if(chan_q->value(1).toString()=="Y") { // Audience Metrics - ret.replace("%ITEM_SOURCE_TEXT%", - RDXmlEscape(item_q->value(6).toString())); - ret.replace("%ITEM_SOURCE_URL%", - RDXmlEscape(item_q->value(7).toString())); - } - else { - ret.replace("%ITEM_SOURCE_TEXT%", - RDXmlEscape(chan_q->value(0).toString())); - ret.replace("%ITEM_SOURCE_URL%", - RDXmlEscape(item_q->value(15).toString()+"/"+keyName())); - } + ret.replace("%ITEM_SOURCE_TEXT%", + RDXmlEscape(chan_q->value(0).toString())); + ret.replace("%ITEM_SOURCE_URL%", + RDXmlEscape(item_q->value(15).toString()+"/"+keyName())); ret.replace("%ITEM_COMMENTS%", RDXmlEscape(item_q->value(8).toString())); QString explicit_str="false"; @@ -1690,16 +1599,9 @@ QString RDFeed::ResolveItemWildcards(const QString &tmplt,RDSqlQuery *item_q, explicit_str="true"; } ret.replace("%ITEM_EXPLICIT%",explicit_str); - if(chan_q->value(24).toString()=="Y") { - ret.replace("%ITEM_AUDIO_URL%", - RDXmlEscape(audioUrl(RDFeed::LinkCounted,feed_cgi_hostname, - item_q->value(14).toUInt()))); - } - else { - ret.replace("%ITEM_AUDIO_URL%", - RDXmlEscape(audioUrl(RDFeed::LinkDirect,feed_cgi_hostname, - item_q->value(14).toUInt()))); - } + ret.replace("%ITEM_AUDIO_URL%", + RDXmlEscape(audioUrl(feed_cgi_hostname, + item_q->value(14).toUInt()))); ret.replace("%ITEM_AUDIO_LENGTH%",item_q->value(11).toString()); ret.replace("%ITEM_AUDIO_TIME%", RDGetTimeLength(item_q->value(12).toInt(),false,false)); diff --git a/lib/rdfeed.h b/lib/rdfeed.h index a38773f1..ffeae800 100644 --- a/lib/rdfeed.h +++ b/lib/rdfeed.h @@ -39,7 +39,6 @@ class RDFeed : public QObject public: enum Error {ErrorOk=0,ErrorNoFile=1,ErrorCannotOpenFile=2, ErrorUnsupportedType=3,ErrorUploadFailed=4,ErrorGeneral=5}; - enum MediaLinkMode {LinkNone=0,LinkDirect=1,LinkCounted=2}; RDFeed(const QString &keyname,RDConfig *config,QObject *parent=0); RDFeed(unsigned id,RDConfig *config,QObject *parent=0); QString keyName() const; @@ -49,8 +48,6 @@ class RDFeed : public QObject void setIsSuperfeed(bool state) const; QStringList subfeedNames() const; QStringList isSubfeedOf() const; - bool audienceMetrics() const; - void setAudienceMetrics(bool state); QString channelTitle() const; void setChannelTitle(const QString &str) const; QString channelDescription() const; @@ -111,8 +108,6 @@ class RDFeed : public QObject void setOriginDateTime(const QDateTime &datetime) const; bool enableAutopost() const; void setEnableAutopost(bool state) const; - bool keepMetadata() const; - void setKeepMetadata(bool state); RDSettings::Format uploadFormat() const; void setUploadFormat(RDSettings::Format fmt) const; int uploadChannels() const; @@ -129,15 +124,10 @@ class RDFeed : public QObject void setUploadMimetype(const QString &str); int normalizeLevel() const; void setNormalizeLevel(int lvl) const; - QString redirectPath() const; - void setRedirectPath(const QString &str); - RDFeed::MediaLinkMode mediaLinkMode() const; - void setMediaLinkMode(RDFeed::MediaLinkMode mode) const; int importImageFile(const QString &pathname,QString *err_msg, QString desc="") const; bool deleteImage(int img_id,QString *err_msg); - QString audioUrl(RDFeed::MediaLinkMode mode,const QString &cgi_hostname, - unsigned cast_id); + QString audioUrl(const QString &cgi_hostname,unsigned cast_id); QString imageUrl(int img_id) const; bool postXml(QString *err_msg); bool postXmlConditional(const QString &caption,QWidget *widget); diff --git a/lib/rdfeedlog.cpp b/lib/rdfeedlog.cpp deleted file mode 100644 index 6ff354c9..00000000 --- a/lib/rdfeedlog.cpp +++ /dev/null @@ -1,96 +0,0 @@ -// rdfeedlog.cpp -// -// Functions for manipulating RSS feed log tables. -// -// (C) Copyright 2007,2016-2018 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include - -#include -#include -#include -#include - -#include "rdfeedlog.h" - -void RDDeleteFeedLog(QString keyname) -{ - QString sql=QString("delete from CAST_DOWNLOADS where ")+ - "FEED_KEY_NAME=\""+RDEscapeString(keyname)+"\""; - RDSqlQuery::apply(sql); -} - - -void RDDeleteCastCount(QString keyname,unsigned cast_id) -{ - QString sql; - - sql=QString("delete from CAST_DOWNLOADS where ")+ - "FEED_KEY_NAME=\""+RDEscapeString(keyname)+"\" && "+ - QString().sprintf("CAST_ID=%u",cast_id); - RDSqlQuery::apply(sql); -} - - -void RDDeleteCastCount(unsigned feed_id,unsigned cast_id) -{ - QString sql; - RDSqlQuery *q; - - sql=QString().sprintf("select KEY_NAME from FEEDS where ID=%u",feed_id); - q=new RDSqlQuery(sql); - if(q->first()) { - RDDeleteCastCount(q->value(0).toString(),cast_id); - } - delete q; -} - - -void RDIncrementFeedCount(QString keyname) -{ - RDIncrementCastCount(keyname,0); -} - - -void RDIncrementCastCount(QString keyname,unsigned cast_id) -{ - QString sql; - RDSqlQuery *q; - QDate now=QDate::currentDate(); - - sql=QString("select ACCESS_COUNT from CAST_DOWNLOADS where ")+ - "FEED_KEY_NAME=\""+RDEscapeString(keyname)+"\" && "+ - QString().sprintf("(CAST_ID=%u)&&",cast_id)+ - "(ACCESS_DATE=\""+RDEscapeString(now.toString("yyyy-MM-dd"))+"\")"; - q=new RDSqlQuery(sql); - if(q->first()) { - sql=QString("update CAST_DOWNLOADS set ")+ - QString().sprintf("ACCESS_COUNT=%u where ",q->value(0).toUInt()+1)+ - "FEED_KEY_NAME=\""+RDEscapeString(keyname)+"\" && "+ - QString().sprintf("(CAST_ID=%u)&&",cast_id)+ - "(ACCESS_DATE=\""+RDEscapeString(now.toString("yyyy-MM-dd"))+"\")"; - } - else { - sql=QString("insert into CAST_DOWNLOADS set ")+ - "FEED_KEY_NAME=\""+RDEscapeString(keyname)+"\","+ - QString().sprintf("CAST_ID=%u,",cast_id)+ - "ACCESS_DATE=\""+RDEscapeString(now.toString("yyyy-MM-dd"))+"\","+ - "ACCESS_COUNT=1"; - } - RDSqlQuery::apply(sql); - delete q; -} diff --git a/lib/rdfeedlog.h b/lib/rdfeedlog.h deleted file mode 100644 index 56c0337f..00000000 --- a/lib/rdfeedlog.h +++ /dev/null @@ -1,33 +0,0 @@ -// rdfeedlog.h -// -// Functions for manipulating RSS feed log tables. -// -// (C) Copyright 2007,2016-2018 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef RDFEEDLOG_H -#define RDFEEDLOG_H - -#include - -void RDDeleteFeedLog(QString keyname); -void RDDeleteCastCount(QString keyname,unsigned cast_id); -void RDDeleteCastCount(unsigned feed_id,unsigned cast_id); -void RDIncrementFeedCount(QString keyname); -void RDIncrementCastCount(QString keyname,unsigned cast_id); - - -#endif // RDFEEDLOG_H diff --git a/rdadmin/add_feed.cpp b/rdadmin/add_feed.cpp index efd364c7..57048594 100644 --- a/rdadmin/add_feed.cpp +++ b/rdadmin/add_feed.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "add_feed.h" diff --git a/rdadmin/edit_feed.cpp b/rdadmin/edit_feed.cpp index 4784d021..e10f0f75 100644 --- a/rdadmin/edit_feed.cpp +++ b/rdadmin/edit_feed.cpp @@ -80,14 +80,6 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) connect(feed_list_images_button,SIGNAL(clicked()), this,SLOT(listImagesData())); - // - // Audience Metrics - // - feed_audience_metrics_check=new QCheckBox(this); - feed_audience_metrics_label=new QLabel(tr("Collect Audience Metrics"),this); - feed_audience_metrics_label->setFont(labelFont()); - feed_audience_metrics_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); - // // Channel Section // @@ -210,8 +202,8 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) // // Channel Image // - feed_channel_image_box=new - RDImagePickerBox("FEED_IMAGES","FEED_ID","ID",this); + feed_channel_image_box= + new RDImagePickerBox("FEED_IMAGES","FEED_ID","ID",this); feed_channel_image_box->setCategoryId(feed_feed->id()); feed_channel_image_label= new QLabel(feed_channel_image_box,tr("Image")+":",this); @@ -309,22 +301,15 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) feed_base_url_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); // - // Keep Expired Metadata Checkbox + // AutoPost // - feed_keep_metadata_box=new QCheckBox(this); - feed_keep_metadata_label= - new QLabel(feed_keep_metadata_box,tr("Keep Expired Metadata"),this); - feed_keep_metadata_label->setFont(labelFont()); - feed_keep_metadata_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); - - // - // AutoPost Checkbox - // - feed_autopost_box=new QCheckBox(this); + feed_autopost_box=new QComboBox(this); + feed_autopost_box->insertItem(feed_autopost_box->count(),tr("No")); + feed_autopost_box->insertItem(feed_autopost_box->count(),tr("Yes")); feed_autopost_label= - new QLabel(feed_autopost_box,tr("Enable AutoPost"),this); + new QLabel(feed_autopost_box,tr("Enable AutoPost")+":",this); feed_autopost_label->setFont(labelFont()); - feed_autopost_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); + feed_autopost_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); // // Enclosure Preamble @@ -351,17 +336,15 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) // feed_max_shelf_life_spin=new QSpinBox(this); feed_max_shelf_life_spin->setRange(0,365); - feed_max_shelf_life_spin->setSpecialValueText(tr("None")); + feed_max_shelf_life_spin->setSpecialValueText(tr("Unlimited")); feed_max_shelf_life_label= - new QLabel(feed_max_shelf_life_spin,tr("Maximum Shelf Life:"),this); + new QLabel(feed_max_shelf_life_spin,tr("Default Shelf Life")+":",this); feed_max_shelf_life_label->setFont(labelFont()); - feed_max_shelf_life_label-> - setAlignment(Qt::AlignRight|Qt::AlignVCenter); + feed_max_shelf_life_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); feed_max_shelf_life_unit_label= new QLabel(feed_max_shelf_life_spin,tr("days"),this); feed_max_shelf_life_unit_label->setFont(labelFont()); - feed_max_shelf_life_unit_label-> - setAlignment(Qt::AlignLeft|Qt::AlignVCenter); + feed_max_shelf_life_unit_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); // // Episode Order @@ -374,18 +357,6 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) feed_castorder_label->setFont(labelFont()); feed_castorder_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - // - // Media Link Mode - // - feed_media_link_mode_box=new QComboBox(this); - feed_media_link_mode_box->insertItem(tr("None")); - feed_media_link_mode_box->insertItem(tr("Direct")); - feed_media_link_mode_box->insertItem(tr("Counted")); - feed_media_link_mode_label= - new QLabel(feed_media_link_mode_box,tr("Media Link Mode:"),this); - feed_media_link_mode_label->setFont(labelFont()); - feed_media_link_mode_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - // // Default Item Image // @@ -439,24 +410,6 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) feed_item_xml_label->setFont(labelFont()); feed_item_xml_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - // - // Feed Redirection - // - feed_redirect_check=new QCheckBox(this); - connect(feed_audience_metrics_check,SIGNAL(toggled(bool)), - feed_redirect_check,SLOT(setEnabled(bool))); - feed_redirect_label= - new QLabel(feed_redirect_check,tr("Enable Feed Redirection"),this); - connect(feed_audience_metrics_check,SIGNAL(toggled(bool)), - feed_redirect_label,SLOT(setEnabled(bool))); - feed_redirect_label->setFont(labelFont()); - feed_redirect_label->setAlignment(Qt::AlignLeft|Qt::AlignVCenter); - - feed_redirect_url_edit=new QLineEdit(this); - feed_redirect_url_label=new QLabel(feed_redirect_url_edit,tr("URL:"),this); - feed_redirect_url_label->setFont(labelFont()); - feed_redirect_url_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - // // Ok Button // @@ -478,9 +431,6 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) // Populate Values // feed_is_superfeed_box->setCurrentIndex(feed_feed->isSuperfeed()); - feed_audience_metrics_check->setChecked(feed_feed->audienceMetrics()); - feed_redirect_check->setEnabled(feed_audience_metrics_check->isChecked()); - feed_redirect_label->setEnabled(feed_audience_metrics_check->isChecked()); feed_channel_title_edit->setText(feed_feed->channelTitle()); feed_channel_category_box->setSchema(feed_feed->rssSchema()); feed_channel_category_box-> @@ -512,8 +462,7 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) feed_channel_xml_edit->setPlainText(feed_feed->channelXml()); feed_item_xml_edit->setPlainText(feed_feed->itemXml()); feed_max_shelf_life_spin->setValue(feed_feed->maxShelfLife()); - feed_autopost_box->setChecked(feed_feed->enableAutopost()); - feed_keep_metadata_box->setChecked(feed_feed->keepMetadata()); + feed_autopost_box->setCurrentIndex(feed_feed->enableAutopost()); feed_settings.setFormat(feed_feed->uploadFormat()); feed_settings.setChannels(feed_feed->uploadChannels()); feed_settings.setSampleRate(feed_feed->uploadSampleRate()); @@ -529,13 +478,7 @@ EditFeed::EditFeed(const QString &feed,QWidget *parent) feed_normalize_spin->setValue(feed_feed->normalizeLevel()/1000); } feed_castorder_box->setCurrentItem(feed_feed->castOrder()); - feed_media_link_mode_box->setCurrentItem((int)feed_feed->mediaLinkMode()); feed_item_image_box->setCurrentImageId(feed_feed->defaultItemImageId()); - feed_redirect_url_edit->setText(feed_feed->redirectPath()); - feed_redirect_check->setChecked(!feed_redirect_url_edit->text().isEmpty()); - - connect(feed_redirect_check,SIGNAL(toggled(bool)), - this,SLOT(redirectToggledData(bool))); UpdateControlState(); } @@ -550,7 +493,7 @@ EditFeed::~EditFeed() QSize EditFeed::sizeHint() const { - return QSize(1000,740); + return QSize(1000,688); } @@ -605,23 +548,6 @@ void EditFeed::setFormatData() } -void EditFeed::redirectToggledData(bool state) -{ - if(state) { - switch(QMessageBox::warning(this,tr("Edit Feed - Redirect"), - tr("Enabling feed redirection will cause clients subscribed to\nthis feed to be PERMANENTLY redirected to the\nspecified URL.\n\nDo you still want to enable redireciton?"),QMessageBox::Yes,QMessageBox::No)) { - case QMessageBox::Yes: - break; - - default: - feed_redirect_check->setChecked(false); - return; - } - } - UpdateControlState(); -} - - void EditFeed::listImagesData() { feed_images_dialog->exec(feed_feed); @@ -650,22 +576,7 @@ void EditFeed::okData() } delete d; delete u; - if(feed_redirect_check->isChecked()) { - QUrl url(feed_redirect_url_edit->text()); - if(url.isValid()&&(!url.isRelative()&&(!url.host().isEmpty()))) { - feed_feed->setRedirectPath(url.toString()); - } - else { - QMessageBox::information(this,"RDAdmin - "+tr("Error"), - tr("The Feed Redirection URL is invalid!")); - return; - } - } - else { - feed_feed->setRedirectPath(""); - } feed_feed->setIsSuperfeed(feed_is_superfeed_box->currentItem()); - feed_feed->setAudienceMetrics(feed_audience_metrics_check->isChecked()); feed_feed->setChannelTitle(feed_channel_title_edit->text()); feed_feed->setChannelCategory(feed_channel_category_box->category()); feed_feed->setChannelSubCategory(feed_channel_category_box->subCategory()); @@ -695,8 +606,7 @@ void EditFeed::okData() feed_feed->setMaxShelfLife(feed_max_shelf_life_spin->value()); feed_feed->setLastBuildDateTime(QDateTime(QDate::currentDate(), QTime::currentTime())); - feed_feed->setEnableAutopost(feed_autopost_box->isChecked()); - feed_feed->setKeepMetadata(feed_keep_metadata_box->isChecked()); + feed_feed->setEnableAutopost(feed_autopost_box->currentIndex()); feed_feed->setUploadFormat(feed_settings.format()); feed_feed->setUploadChannels(feed_settings.channels()); feed_feed->setUploadSampleRate(feed_settings.sampleRate()); @@ -710,8 +620,6 @@ void EditFeed::okData() feed_feed->setNormalizeLevel(1); } feed_feed->setCastOrder(feed_castorder_box->currentItem()); - feed_feed->setMediaLinkMode((RDFeed::MediaLinkMode)feed_media_link_mode_box-> - currentItem()); if(!feed_feed->postXmlConditional("RDAdmin",this)) { return; @@ -740,87 +648,87 @@ void EditFeed::resizeEvent(QResizeEvent *e) feed_list_images_button->setGeometry(345,13,100,38); - feed_audience_metrics_check->setGeometry(20,54,15,15); - feed_audience_metrics_label->setGeometry(40,52,375,19); + feed_channel_section_groupbox->setGeometry(10,52,sizeHint().width()/2-10,355); - feed_channel_section_groupbox->setGeometry(10,77,sizeHint().width()/2-10,355); - feed_channel_title_edit->setGeometry(115,92,375,19); - feed_channel_title_label->setGeometry(20,92,90,19); - feed_channel_category_box->setGeometry(115,114,375,19); - feed_channel_category_label->setGeometry(20,114,90,19); - feed_channel_link_edit->setGeometry(115,136,375,19); - feed_channel_link_label->setGeometry(20,136,90,19); - feed_channel_copyright_edit->setGeometry(115,158,375,19); - feed_channel_copyright_label->setGeometry(20,158,90,19); - feed_channel_editor_edit->setGeometry(115,180,375,19); - feed_channel_editor_label->setGeometry(20,180,90,19); + feed_channel_title_edit->setGeometry(115,67,375,19); + feed_channel_title_label->setGeometry(20,67,90,19); - feed_channel_author_edit->setGeometry(115,201,375,19); - feed_channel_author_label->setGeometry(20,201,90,19); + feed_channel_category_box->setGeometry(115,89,375,19); + feed_channel_category_label->setGeometry(20,89,90,19); - feed_channel_owner_name_edit->setGeometry(115,223,375,19); - feed_channel_owner_name_label->setGeometry(20,223,90,19); + feed_channel_link_edit->setGeometry(115,111,375,19); + feed_channel_link_label->setGeometry(20,111,90,19); - feed_channel_owner_email_edit->setGeometry(115,245,375,19); - feed_channel_owner_email_label->setGeometry(20,245,90,19); + feed_channel_copyright_edit->setGeometry(115,133,375,19); + feed_channel_copyright_label->setGeometry(20,133,90,19); - feed_channel_webmaster_edit->setGeometry(115,267,375,19); - feed_channel_webmaster_label->setGeometry(20,267,90,19); - feed_channel_language_edit->setGeometry(115,289,60,19); - feed_channel_language_label->setGeometry(20,289,90,19); - feed_channel_explicit_check->setGeometry(205,291,15,15); - feed_channel_explicit_label->setGeometry(225,291,260,19); - feed_channel_description_edit->setGeometry(115,311,375,76); - feed_channel_description_label->setGeometry(20,311,90,19); + feed_channel_editor_edit->setGeometry(115,155,375,19); + feed_channel_editor_label->setGeometry(20,155,90,19); + feed_channel_author_edit->setGeometry(115,176,375,19); + feed_channel_author_label->setGeometry(20,176,90,19); - feed_channel_image_box->setGeometry(115,389,375,38); + feed_channel_owner_name_edit->setGeometry(115,198,375,19); + feed_channel_owner_name_label->setGeometry(20,198,90,19); + + feed_channel_owner_email_edit->setGeometry(115,220,375,19); + feed_channel_owner_email_label->setGeometry(20,220,90,19); + + feed_channel_webmaster_edit->setGeometry(115,242,375,19); + feed_channel_webmaster_label->setGeometry(20,242,90,19); + + feed_channel_language_edit->setGeometry(115,264,60,19); + feed_channel_language_label->setGeometry(20,264,90,19); + + feed_channel_explicit_check->setGeometry(205,266,15,15); + feed_channel_explicit_label->setGeometry(225,265,260,19); + + feed_channel_description_edit->setGeometry(115,286,375,76); + feed_channel_description_label->setGeometry(20,286,90,19); + + feed_channel_image_box->setGeometry(115,364,375,38); feed_channel_image_box->setIconSize(QSize(36,36)); - feed_channel_image_label->setGeometry(20,389,90,19); + feed_channel_image_label->setGeometry(20,364,90,19); - feed_purge_url_edit->setGeometry(155,439,335,19); - feed_purge_url_label->setGeometry(20,439,130,19); - feed_purge_username_edit->setGeometry(225,461,95,19); - feed_purge_username_label->setGeometry(40,461,180,19); - feed_purge_password_edit->setGeometry(395,461,95,19); - feed_purge_password_label->setGeometry(320,461,70,19); + feed_purge_url_edit->setGeometry(155,414,335,19); + feed_purge_url_label->setGeometry(20,414,130,19); + feed_purge_username_edit->setGeometry(225,436,95,19); + feed_purge_username_label->setGeometry(40,436,180,19); + feed_purge_password_edit->setGeometry(395,436,95,19); + feed_purge_password_label->setGeometry(320,436,70,19); - feed_format_edit->setGeometry(155,483,285,20); - feed_format_label->setGeometry(5,483,145,20); - feed_format_button->setGeometry(450,483,40,24); + feed_format_edit->setGeometry(155,460,285,20); + feed_format_label->setGeometry(5,460,145,20); + feed_format_button->setGeometry(450,458,40,24); - feed_normalize_check->setGeometry(155,507,15,15); - feed_normalize_check_label->setGeometry(175,505,83,20); - feed_normalize_spin->setGeometry(295,503,40,20); - feed_normalize_label->setGeometry(245,503,45,20); - feed_normalize_unit_label->setGeometry(340,503,40,20); + feed_normalize_check->setGeometry(155,487,15,15); + feed_normalize_check_label->setGeometry(175,484,83,20); + feed_normalize_spin->setGeometry(295,484,40,20); + feed_normalize_label->setGeometry(245,484,45,20); + feed_normalize_unit_label->setGeometry(340,484,40,20); - feed_base_url_edit->setGeometry(155,527,335,19); - feed_base_url_label->setGeometry(5,527,145,19); - feed_keep_metadata_box->setGeometry(155,549,15,15); - feed_keep_metadata_label->setGeometry(175,547,180,19); - feed_autopost_box->setGeometry(365,549,15,15); - feed_autopost_label->setGeometry(385,547,200,19); + feed_extension_edit->setGeometry(155,504,70,19); + feed_extension_label->setGeometry(20,504,130,19); - feed_base_preamble_edit->setGeometry(155,571,335,19); - feed_base_preamble_label->setGeometry(20,571,130,19); + feed_base_url_edit->setGeometry(155,526,335,19); + feed_base_url_label->setGeometry(5,526,145,19); - feed_extension_edit->setGeometry(155,593,70,19); - feed_extension_label->setGeometry(20,593,130,19); + feed_autopost_box->setGeometry(155,551,60,19); + feed_autopost_label->setGeometry(5,551,145,19); - feed_max_shelf_life_spin->setGeometry(155,615,60,19); - feed_max_shelf_life_label->setGeometry(20,615,130,19); - feed_max_shelf_life_unit_label->setGeometry(220,615,50,19); + feed_max_shelf_life_spin->setGeometry(155,573,90,19); + feed_max_shelf_life_label->setGeometry(20,573,130,19); + feed_max_shelf_life_unit_label->setGeometry(250,573,50,19); - feed_castorder_box->setGeometry(155,637,100,19); - feed_castorder_label->setGeometry(20,637,130,19); - - feed_media_link_mode_box->setGeometry(155,659,100,19); - feed_media_link_mode_label->setGeometry(20,659,130,19); - - feed_item_image_box->setGeometry(155,681,335,38); + feed_item_image_box->setGeometry(155,595,335,38); feed_item_image_box->setIconSize(QSize(36,36)); - feed_item_image_label->setGeometry(20,681,130,19); + feed_item_image_label->setGeometry(20,595,130,19); + + feed_base_preamble_edit->setGeometry(155,636,335,19); + feed_base_preamble_label->setGeometry(20,636,130,19); + + feed_castorder_box->setGeometry(155,660,100,19); + feed_castorder_label->setGeometry(20,660,130,19); // // Right-hand Side @@ -837,11 +745,6 @@ void EditFeed::resizeEvent(QResizeEvent *e) feed_item_xml_label->setGeometry(520,368,90,19); feed_item_xml_edit->setGeometry(615,368,size().width()-625,240); - feed_redirect_check->setGeometry(550,615,15,15); - feed_redirect_label->setGeometry(570,615,200,19); - feed_redirect_url_edit->setGeometry(615,637,375,20); - feed_redirect_url_label->setGeometry(570,637,40,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); } @@ -850,7 +753,6 @@ void EditFeed::resizeEvent(QResizeEvent *e) void EditFeed::UpdateControlState() { bool superfeed=feed_is_superfeed_box->currentIndex(); - bool redirected=feed_redirect_check->isChecked(); bool custom_schema= feed_rss_schema_box->itemData(feed_rss_schema_box->currentIndex()).toInt()== RDRssSchemas::CustomSchema; @@ -858,101 +760,45 @@ void EditFeed::UpdateControlState() supportsItemImages((RDRssSchemas::RssSchema)feed_rss_schema_box-> itemData(feed_rss_schema_box->currentIndex()).toInt()); - feed_is_superfeed_label->setDisabled(redirected); - feed_is_superfeed_box->setDisabled(redirected); - feed_is_superfeed_button->setDisabled(redirected||(!superfeed)); + feed_is_superfeed_button->setEnabled(superfeed); - feed_list_images_button->setDisabled(redirected); - - feed_audience_metrics_check->setDisabled(redirected); - feed_audience_metrics_label->setDisabled(redirected); - - feed_channel_title_edit->setDisabled(redirected); - feed_channel_description_edit->setDisabled(redirected); - feed_channel_category_box->setDisabled(redirected); - feed_channel_link_edit->setDisabled(redirected); - feed_channel_copyright_edit->setDisabled(redirected); - feed_channel_editor_label->setDisabled(redirected); - feed_channel_editor_edit->setDisabled(redirected); - feed_channel_author_label->setDisabled(redirected); - feed_channel_author_edit->setDisabled(redirected); - feed_channel_owner_name_label->setDisabled(redirected); - feed_channel_owner_name_edit->setDisabled(redirected); - feed_channel_owner_email_label->setDisabled(redirected); - feed_channel_owner_email_edit->setDisabled(redirected); - feed_channel_webmaster_label->setDisabled(redirected); - feed_channel_webmaster_edit->setDisabled(redirected); - feed_channel_language_edit->setDisabled(redirected); - feed_channel_explicit_check->setDisabled(redirected); - feed_channel_explicit_label->setDisabled(redirected); - feed_channel_title_label->setDisabled(redirected); - feed_channel_category_label->setDisabled(redirected); - feed_channel_link_label->setDisabled(redirected); - feed_channel_copyright_label->setDisabled(redirected); - feed_channel_language_label->setDisabled(redirected); - feed_channel_description_label->setDisabled(redirected); - feed_channel_image_label->setDisabled(redirected); - feed_channel_image_box->setDisabled(redirected); - - feed_redirect_url_label->setEnabled(redirected); - feed_redirect_url_edit->setEnabled(redirected); - - feed_base_url_edit->setDisabled(redirected); - feed_purge_url_edit->setDisabled(redirected); - feed_purge_username_label->setDisabled(redirected); - feed_purge_username_edit->setDisabled(redirected); - feed_purge_password_label->setDisabled(redirected); - feed_purge_password_edit->setDisabled(redirected); - - feed_max_shelf_life_spin->setDisabled(redirected||superfeed); - feed_autopost_box->setDisabled(redirected||superfeed); - feed_keep_metadata_box->setDisabled(redirected); - feed_keep_metadata_label->setDisabled(redirected); - feed_format_edit->setDisabled(redirected||superfeed); - feed_normalize_check->setDisabled(redirected||superfeed); - feed_extension_edit->setDisabled(redirected||superfeed); - feed_castorder_box->setDisabled(redirected); - feed_format_button->setDisabled(redirected||superfeed); - feed_base_url_label->setDisabled(redirected); - feed_base_preamble_label->setDisabled(redirected); - feed_purge_url_label->setDisabled(redirected); - feed_max_shelf_life_label->setDisabled(redirected||superfeed); - feed_max_shelf_life_unit_label->setDisabled(redirected||superfeed); - feed_autopost_label->setDisabled(redirected||superfeed); - feed_format_label->setDisabled(redirected||superfeed); - feed_normalize_check_label->setDisabled(redirected||superfeed); - feed_normalize_unit_label->setDisabled(redirected||superfeed); - feed_castorder_label->setDisabled(redirected); - feed_extension_label->setDisabled(redirected||superfeed); - feed_channel_section_groupbox->setDisabled(redirected); + feed_max_shelf_life_spin->setDisabled(superfeed); + feed_autopost_box->setDisabled(superfeed); + feed_autopost_label->setDisabled(superfeed); + feed_format_edit->setDisabled(superfeed); + feed_normalize_check->setDisabled(superfeed); + feed_extension_edit->setDisabled(superfeed); + feed_format_button->setDisabled(superfeed); + feed_max_shelf_life_label->setDisabled(superfeed); + feed_max_shelf_life_unit_label->setDisabled(superfeed); + feed_format_label->setDisabled(superfeed); + feed_normalize_check_label->setDisabled(superfeed); + feed_normalize_unit_label->setDisabled(superfeed); + feed_extension_label->setDisabled(superfeed); feed_normalize_label-> - setDisabled(redirected||superfeed||(!feed_normalize_check->isChecked())); + setDisabled(superfeed||(!feed_normalize_check->isChecked())); feed_normalize_spin-> - setDisabled(redirected||superfeed||(!feed_normalize_check->isChecked())); + setDisabled(superfeed||(!feed_normalize_check->isChecked())); feed_normalize_unit_label-> - setDisabled(redirected||superfeed||(!feed_normalize_check->isChecked())); - feed_media_link_mode_box->setDisabled(redirected||superfeed); - feed_media_link_mode_label->setDisabled(redirected||superfeed); + setDisabled(superfeed||(!feed_normalize_check->isChecked())); - feed_item_image_label->setDisabled(item_image&&(redirected||superfeed)); - feed_item_image_box->setDisabled(item_image&&(redirected||superfeed)); + feed_item_image_label->setDisabled(item_image&&(superfeed)); + feed_item_image_box->setDisabled(item_image&&(superfeed)); - feed_header_xml_label->setDisabled(redirected||(!custom_schema)); - feed_header_xml_edit->setDisabled(redirected||(!custom_schema)); + feed_header_xml_label->setEnabled(custom_schema); + feed_header_xml_edit->setEnabled(custom_schema); - feed_channel_xml_label->setDisabled(redirected||(!custom_schema)); - feed_channel_xml_edit->setDisabled(redirected||(!custom_schema)); + feed_channel_xml_label->setEnabled(custom_schema); + feed_channel_xml_edit->setEnabled(custom_schema); - feed_item_xml_label->setDisabled(redirected||superfeed||(!custom_schema)); - feed_item_xml_edit->setDisabled(redirected||superfeed||(!custom_schema)); + feed_item_xml_label->setDisabled(superfeed||(!custom_schema)); + feed_item_xml_edit->setDisabled(superfeed||(!custom_schema)); feed_purge_password_label-> setDisabled(feed_purge_username_edit->text().isEmpty()|| - feed_purge_url_edit->text().isEmpty()|| - feed_redirect_check->isChecked()); + feed_purge_url_edit->text().isEmpty()); feed_purge_password_edit-> setDisabled(feed_purge_username_edit->text().isEmpty()|| - feed_purge_url_edit->text().isEmpty()|| - feed_redirect_check->isChecked()); + feed_purge_url_edit->text().isEmpty()); } diff --git a/rdadmin/edit_feed.h b/rdadmin/edit_feed.h index 2c9b42a3..86021ef7 100644 --- a/rdadmin/edit_feed.h +++ b/rdadmin/edit_feed.h @@ -55,7 +55,6 @@ class EditFeed : public RDDialog void lineeditChangedData(const QString &str); void selectSubfeedsData(); void setFormatData(); - void redirectToggledData(bool state); void listImagesData(); void okData(); void cancelData(); @@ -70,8 +69,6 @@ class EditFeed : public RDDialog QLabel *feed_is_superfeed_label; QPushButton *feed_is_superfeed_button; QPushButton *feed_list_images_button; - QCheckBox *feed_audience_metrics_check; - QLabel *feed_audience_metrics_label; QComboBox *feed_is_superfeed_box; QLineEdit *feed_channel_title_edit; QTextEdit *feed_channel_description_edit; @@ -105,8 +102,8 @@ class EditFeed : public RDDialog QTextEdit *feed_channel_xml_edit; QTextEdit *feed_item_xml_edit; QSpinBox *feed_max_shelf_life_spin; - QCheckBox *feed_autopost_box; - QCheckBox *feed_keep_metadata_box; + QLabel *feed_autopost_label; + QComboBox *feed_autopost_box; RDSettings feed_settings; ListImages *feed_images_dialog; QLineEdit *feed_format_edit; @@ -115,11 +112,6 @@ class EditFeed : public RDDialog QSpinBox *feed_normalize_spin; QLineEdit *feed_extension_edit; QComboBox *feed_castorder_box; - QComboBox *feed_media_link_mode_box; - QLabel *feed_redirect_label; - QCheckBox *feed_redirect_check; - QLabel *feed_redirect_url_label; - QLineEdit *feed_redirect_url_edit; QPushButton *feed_format_button; QGroupBox *feed_channel_section_groupbox; QLabel *feed_channel_title_label; @@ -134,13 +126,10 @@ class EditFeed : public RDDialog QLabel *feed_purge_url_label; QLabel *feed_max_shelf_life_label; QLabel *feed_max_shelf_life_unit_label; - QLabel *feed_autopost_label; - QLabel *feed_keep_metadata_label; QLabel *feed_format_label; QLabel *feed_normalize_check_label; QLabel *feed_normalize_unit_label; QLabel *feed_castorder_label; - QLabel *feed_media_link_mode_label; QLabel *feed_extension_label; QLabel *feed_item_image_label; RDImagePickerBox *feed_item_image_box; diff --git a/rdadmin/list_feeds.cpp b/rdadmin/list_feeds.cpp index 9a217567..7ed6b11d 100644 --- a/rdadmin/list_feeds.cpp +++ b/rdadmin/list_feeds.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include @@ -98,10 +97,8 @@ ListFeeds::ListFeeds(QWidget *parent) list_feeds_view->setColumnAlignment(3,Qt::AlignCenter|Qt::AlignVCenter); list_feeds_view->addColumn(tr("AutoPost")); list_feeds_view->setColumnAlignment(4,Qt::AlignCenter|Qt::AlignVCenter); - list_feeds_view->addColumn(tr("Keep Metadata")); - list_feeds_view->setColumnAlignment(5,Qt::AlignCenter|Qt::AlignVCenter); list_feeds_view->addColumn(tr("Creation Date")); - list_feeds_view->setColumnAlignment(6,Qt::AlignCenter|Qt::AlignVCenter); + list_feeds_view->setColumnAlignment(5,Qt::AlignCenter|Qt::AlignVCenter); QLabel *list_box_label=new QLabel(list_feeds_view,tr("&Feeds:"),this); list_box_label->setFont(labelFont()); list_box_label->setGeometry(14,11,85,19); @@ -159,7 +156,6 @@ void ListFeeds::addData() "KEY_NAME=\""+RDEscapeString(feed)+"\""; RDSqlQuery::apply(sql); - RDDeleteFeedLog(feed); delete edit_feed; return; } @@ -243,12 +239,10 @@ void ListFeeds::deleteData() // // Delete Remote XML // - if(!feed->audienceMetrics()) { - if(!feed->deleteXml(&errs)) { - QMessageBox::warning(this,"RDAdmin - "+tr("Warning"), - tr("Failed to delete remote feed XML.")+ - "["+errs+"]."); - } + if(!feed->deleteXml(&errs)) { + QMessageBox::warning(this,"RDAdmin - "+tr("Warning"), + tr("Failed to delete remote feed XML.")+ + "["+errs+"]."); } // @@ -282,7 +276,6 @@ void ListFeeds::deleteData() sql=QString("delete from FEEDS where ")+ "KEY_NAME=\""+RDEscapeString(feedname)+"\""; RDSqlQuery::apply(sql); - RDDeleteFeedLog(feedname); item->setSelected(false); pd->reset(); @@ -329,9 +322,8 @@ void ListFeeds::RefreshList() "CHANNEL_TITLE,"+ // 02 "IS_SUPERFEED,"+ // 03 "ENABLE_AUTOPOST,"+ // 04 - "KEEP_METADATA,"+ // 05 - "ORIGIN_DATETIME,"+ // 06 - "BASE_URL "+ // 07 + "ORIGIN_DATETIME,"+ // 05 + "BASE_URL "+ // 06 "from FEEDS"; q=new RDSqlQuery(sql); while (q->next()) { @@ -339,12 +331,11 @@ void ListFeeds::RefreshList() item->setId(q->value(0).toInt()); item->setText(0,q->value(1).toString()); item->setText(1,q->value(2).toString()); - item->setText(2,RDFeed::publicUrl(q->value(7).toString(), + item->setText(2,RDFeed::publicUrl(q->value(6).toString(), q->value(1).toString())); item->setText(3,q->value(3).toString()); item->setText(4,q->value(4).toString()); - item->setText(5,q->value(5).toString()); - item->setText(6,q->value(6).toDateTime().toString("MM/dd/yyyy")); + item->setText(5,q->value(5).toDateTime().toString("MM/dd/yyyy")); } delete q; } @@ -360,21 +351,19 @@ void ListFeeds::RefreshItem(RDListViewItem *item) "CHANNEL_TITLE,"+ // 01 "IS_SUPERFEED,"+ // 02 "ENABLE_AUTOPOST,"+ // 03 - "KEEP_METADATA,"+ // 04 - "ORIGIN_DATETIME,"+ // 05 - "BASE_URL "+ // 06 + "ORIGIN_DATETIME,"+ // 04 + "BASE_URL "+ // 05 "from FEEDS where "+ QString().sprintf("ID=%d",item->id()); q=new RDSqlQuery(sql); if(q->next()) { item->setText(0,q->value(0).toString()); item->setText(1,q->value(1).toString()); - item->setText(2,RDFeed::publicUrl(q->value(6).toString(), + item->setText(2,RDFeed::publicUrl(q->value(5).toString(), q->value(0).toString())); item->setText(3,q->value(2).toString()); item->setText(4,q->value(3).toString()); - item->setText(5,q->value(4).toString()); - item->setText(6,q->value(5).toDateTime().toString("MM/dd/yyyy")); + item->setText(5,q->value(4).toDateTime().toString("MM/dd/yyyy")); } delete q; } diff --git a/rdadmin/rdadmin_cs.ts b/rdadmin/rdadmin_cs.ts index ac4e1765..802397d0 100644 --- a/rdadmin/rdadmin_cs.ts +++ b/rdadmin/rdadmin_cs.ts @@ -1509,7 +1509,7 @@ files, causing any whose files remain to be imported again. Keep Expired Metadata - Zachovat prošlá popisná data + Zachovat prošlá popisná data Enable AutoPost @@ -1525,11 +1525,11 @@ files, causing any whose files remain to be imported again. None - Žádná + Žádná Maximum Shelf Life: - Největší čas před vypršením: + Největší čas před vypršením: days @@ -1549,23 +1549,23 @@ files, causing any whose files remain to be imported again. Direct - Přímé + Přímé Counted - Počítané + Počítané Media Link Mode: - Režim odkazu na media: + Režim odkazu na media: Enable Feed Redirection - Povolit přesměrování přívodu + Povolit přesměrování přívodu URL: - Adresa (URL): + Adresa (URL): Header XML: @@ -1595,7 +1595,7 @@ pole popisných dat Edit Feed - Redirect - Upravit přívod - Přesměrovat + Upravit přívod - Přesměrovat Enabling feed redirection will cause clients subscribed to @@ -1603,7 +1603,7 @@ this feed to be PERMANENTLY redirected to the specified URL. Do you still want to enable redireciton? - Povolení přesměrování přívodu způsobí, že klienti přihlášení k tomuto + Povolení přesměrování přívodu způsobí, že klienti přihlášení k tomuto přívodu budou TRVALE přesměrováni na zadanou adresu. Pořád ještě chcete povolit přesměrování? @@ -1628,19 +1628,11 @@ Pořád ještě chcete povolit přesměrování? Error - - The Feed Redirection URL is invalid! - - Select Member Feeds - - Collect Audience Metrics - - Audio Upload URL has unsupported scheme! @@ -1705,6 +1697,14 @@ Feeds [none] [žádný] + + Default Shelf Life + + + + Unlimited + + EditFeedPerms @@ -5129,7 +5129,7 @@ Stále ještě jej chcete smazat? Keep Metadata - Zachovat popisná data + Zachovat popisná data Creation Date diff --git a/rdadmin/rdadmin_de.ts b/rdadmin/rdadmin_de.ts index 7d44661a..6ac595d9 100644 --- a/rdadmin/rdadmin_de.ts +++ b/rdadmin/rdadmin_de.ts @@ -1395,10 +1395,6 @@ files, causing any whose files remain to be imported again. dBFS - - Keep Expired Metadata - - Enable AutoPost @@ -1411,14 +1407,6 @@ files, causing any whose files remain to be imported again. Audio Extension: - - None - - - - Maximum Shelf Life: - - days @@ -1435,26 +1423,6 @@ files, causing any whose files remain to be imported again. Episode Sort Order: - - Direct - - - - Counted - - - - Media Link Mode: - - - - Enable Feed Redirection - - - - URL: - - Header XML: @@ -1475,18 +1443,6 @@ files, causing any whose files remain to be imported again. &Cancel Abbre&chen - - Edit Feed - Redirect - - - - Enabling feed redirection will cause clients subscribed to -this feed to be PERMANENTLY redirected to the -specified URL. - -Do you still want to enable redireciton? - - Channel Values @@ -1507,19 +1463,11 @@ Do you still want to enable redireciton? Error - - The Feed Redirection URL is invalid! - - Select Member Feeds - - Collect Audience Metrics - - Audio Upload URL has unsupported scheme! @@ -1584,6 +1532,14 @@ Feeds [none] [keine] + + Default Shelf Life + + + + Unlimited + + EditFeedPerms @@ -4953,10 +4909,6 @@ Wollen Sie ihn immernoch löschen? AutoPost - - Keep Metadata - - Creation Date diff --git a/rdadmin/rdadmin_es.ts b/rdadmin/rdadmin_es.ts index b9839230..becd4e3d 100644 --- a/rdadmin/rdadmin_es.ts +++ b/rdadmin/rdadmin_es.ts @@ -1507,7 +1507,7 @@ files, causing any whose files remain to be imported again. Keep Expired Metadata - Mantener metadatos vencidos + Mantener metadatos vencidos Enable AutoPost @@ -1523,11 +1523,11 @@ files, causing any whose files remain to be imported again. None - Ninguno + Ninguno Maximum Shelf Life: - Vida útil máxima: + Vida útil máxima: days @@ -1547,23 +1547,23 @@ files, causing any whose files remain to be imported again. Direct - Directo + Directo Counted - Contado + Contado Media Link Mode: - Modo de los Enlaces: + Modo de los Enlaces: Enable Feed Redirection - Activar redirec. de feed + Activar redirec. de feed URL: - URL: + URL: Header XML: @@ -1593,7 +1593,7 @@ metadatos auxiliares Edit Feed - Redirect - Edtar feed - Redireccionar + Edtar feed - Redireccionar Enabling feed redirection will cause clients subscribed to @@ -1601,7 +1601,7 @@ this feed to be PERMANENTLY redirected to the specified URL. Do you still want to enable redireciton? - Activar el redireccionamiento de feeds causará que los clientes + Activar el redireccionamiento de feeds causará que los clientes suscritos a este feed sean redireccionados PERMANENTEMENTE al URL especificado. @@ -1631,19 +1631,11 @@ al URL especificado. Error - - The Feed Redirection URL is invalid! - - Select Member Feeds - - Collect Audience Metrics - - Audio Upload URL has unsupported scheme! @@ -1704,6 +1696,14 @@ Feeds Superfeed must have at least one subfeed assigned! + + Default Shelf Life + + + + Unlimited + + EditFeedPerms @@ -5092,7 +5092,7 @@ Do you still want to delete it? Keep Metadata - Mantener metadatos + Mantener metadatos Creation Date diff --git a/rdadmin/rdadmin_fr.ts b/rdadmin/rdadmin_fr.ts index 9d186fbf..fdb269d1 100644 --- a/rdadmin/rdadmin_fr.ts +++ b/rdadmin/rdadmin_fr.ts @@ -1067,10 +1067,6 @@ files, causing any whose files remain to be imported again. dBFS - - Keep Expired Metadata - - Enable AutoPost @@ -1083,14 +1079,6 @@ files, causing any whose files remain to be imported again. Audio Extension: - - None - - - - Maximum Shelf Life: - - days @@ -1107,26 +1095,6 @@ files, causing any whose files remain to be imported again. Episode Sort Order: - - Direct - - - - Counted - - - - Media Link Mode: - - - - Enable Feed Redirection - - - - URL: - - Header XML: @@ -1147,18 +1115,6 @@ files, causing any whose files remain to be imported again. &Cancel - - Edit Feed - Redirect - - - - Enabling feed redirection will cause clients subscribed to -this feed to be PERMANENTLY redirected to the -specified URL. - -Do you still want to enable redireciton? - - Channel Values @@ -1179,19 +1135,11 @@ Do you still want to enable redireciton? Error - - The Feed Redirection URL is invalid! - - Select Member Feeds - - Collect Audience Metrics - - Audio Upload URL has unsupported scheme! @@ -1252,6 +1200,14 @@ Feeds Superfeed must have at least one subfeed assigned! + + Default Shelf Life + + + + Unlimited + + EditFeedPerms @@ -4099,10 +4055,6 @@ Permissions AutoPost - - Keep Metadata - - Creation Date diff --git a/rdadmin/rdadmin_nb.ts b/rdadmin/rdadmin_nb.ts index ea09d788..234b0faf 100644 --- a/rdadmin/rdadmin_nb.ts +++ b/rdadmin/rdadmin_nb.ts @@ -1357,10 +1357,6 @@ files, causing any whose files remain to be imported again. dBFS - - Keep Expired Metadata - - Enable AutoPost @@ -1375,11 +1371,7 @@ files, causing any whose files remain to be imported again. None - Ingen - - - Maximum Shelf Life: - + Ingen days @@ -1397,26 +1389,6 @@ files, causing any whose files remain to be imported again. Episode Sort Order: - - Direct - - - - Counted - - - - Media Link Mode: - - - - Enable Feed Redirection - - - - URL: - - Header XML: @@ -1437,18 +1409,6 @@ files, causing any whose files remain to be imported again. &Cancel &Avbryt - - Edit Feed - Redirect - - - - Enabling feed redirection will cause clients subscribed to -this feed to be PERMANENTLY redirected to the -specified URL. - -Do you still want to enable redireciton? - - Channel Values @@ -1469,19 +1429,11 @@ Do you still want to enable redireciton? Error - - The Feed Redirection URL is invalid! - - Select Member Feeds - - Collect Audience Metrics - - Audio Upload URL has unsupported scheme! @@ -1546,6 +1498,14 @@ Feeds [none] [ingen] + + Default Shelf Life + + + + Unlimited + + EditFeedPerms @@ -4810,10 +4770,6 @@ Klikk på "Lisens"-knappen for fleire opplysningar. AutoPost - - Keep Metadata - - Creation Date diff --git a/rdadmin/rdadmin_nn.ts b/rdadmin/rdadmin_nn.ts index ea09d788..234b0faf 100644 --- a/rdadmin/rdadmin_nn.ts +++ b/rdadmin/rdadmin_nn.ts @@ -1357,10 +1357,6 @@ files, causing any whose files remain to be imported again. dBFS - - Keep Expired Metadata - - Enable AutoPost @@ -1375,11 +1371,7 @@ files, causing any whose files remain to be imported again. None - Ingen - - - Maximum Shelf Life: - + Ingen days @@ -1397,26 +1389,6 @@ files, causing any whose files remain to be imported again. Episode Sort Order: - - Direct - - - - Counted - - - - Media Link Mode: - - - - Enable Feed Redirection - - - - URL: - - Header XML: @@ -1437,18 +1409,6 @@ files, causing any whose files remain to be imported again. &Cancel &Avbryt - - Edit Feed - Redirect - - - - Enabling feed redirection will cause clients subscribed to -this feed to be PERMANENTLY redirected to the -specified URL. - -Do you still want to enable redireciton? - - Channel Values @@ -1469,19 +1429,11 @@ Do you still want to enable redireciton? Error - - The Feed Redirection URL is invalid! - - Select Member Feeds - - Collect Audience Metrics - - Audio Upload URL has unsupported scheme! @@ -1546,6 +1498,14 @@ Feeds [none] [ingen] + + Default Shelf Life + + + + Unlimited + + EditFeedPerms @@ -4810,10 +4770,6 @@ Klikk på "Lisens"-knappen for fleire opplysningar. AutoPost - - Keep Metadata - - Creation Date diff --git a/rdadmin/rdadmin_pt_BR.ts b/rdadmin/rdadmin_pt_BR.ts index 9585bbc7..148b9170 100644 --- a/rdadmin/rdadmin_pt_BR.ts +++ b/rdadmin/rdadmin_pt_BR.ts @@ -1367,10 +1367,6 @@ files, causing any whose files remain to be imported again. dBFS - - Keep Expired Metadata - - Enable AutoPost @@ -1385,11 +1381,7 @@ files, causing any whose files remain to be imported again. None - Nenhum - - - Maximum Shelf Life: - + Nenhum days @@ -1407,26 +1399,6 @@ files, causing any whose files remain to be imported again. Episode Sort Order: - - Direct - - - - Counted - - - - Media Link Mode: - - - - Enable Feed Redirection - - - - URL: - - Header XML: @@ -1447,18 +1419,6 @@ files, causing any whose files remain to be imported again. &Cancel &Cancelar - - Edit Feed - Redirect - - - - Enabling feed redirection will cause clients subscribed to -this feed to be PERMANENTLY redirected to the -specified URL. - -Do you still want to enable redireciton? - - Channel Values @@ -1479,19 +1439,11 @@ Do you still want to enable redireciton? Error - - The Feed Redirection URL is invalid! - - Select Member Feeds - - Collect Audience Metrics - - Audio Upload URL has unsupported scheme! @@ -1556,6 +1508,14 @@ Feeds [none] [Nenhum] + + Default Shelf Life + + + + Unlimited + + EditFeedPerms @@ -4933,10 +4893,6 @@ Você ainda quer Deletar? AutoPost - - Keep Metadata - - Creation Date diff --git a/rdcastmanager/Makefile.am b/rdcastmanager/Makefile.am index ef9cda8b..6f6f9bc2 100644 --- a/rdcastmanager/Makefile.am +++ b/rdcastmanager/Makefile.am @@ -45,12 +45,10 @@ bin_PROGRAMS = rdcastmanager dist_rdcastmanager_SOURCES = edit_cast.cpp edit_cast.h\ globals.h\ list_casts.cpp list_casts.h\ - pick_report_dates.cpp pick_report_dates.h\ rdcastmanager.cpp rdcastmanager.h nodist_rdcastmanager_SOURCES = moc_edit_cast.cpp\ moc_list_casts.cpp\ - moc_pick_report_dates.cpp\ moc_rdcastmanager.cpp rdcastmanager_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ @MUSICBRAINZ_LIBS@ -lQt3Support diff --git a/rdcastmanager/edit_cast.cpp b/rdcastmanager/edit_cast.cpp index 4738f7fb..6a44f0b1 100644 --- a/rdcastmanager/edit_cast.cpp +++ b/rdcastmanager/edit_cast.cpp @@ -25,7 +25,6 @@ #include "edit_cast.h" #include "globals.h" -#include "pick_report_dates.h" EditCast::EditCast(unsigned cast_id,QWidget *parent) : RDDialog(parent) @@ -35,20 +34,6 @@ EditCast::EditCast(unsigned cast_id,QWidget *parent) cast_status=cast_cast->status(); setWindowTitle("RDCastManager - "+tr("Editing PodCast")); - // - // Item Media Link - // - cast_item_medialink_edit=new QLineEdit(this); - cast_item_medialink_edit->setReadOnly(true); - cast_item_medialink_label= - new QLabel(cast_item_medialink_edit,tr("Media Link:"),this); - cast_item_medialink_label->setFont(labelFont()); - cast_item_medialink_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - if(cast_feed->mediaLinkMode()==RDFeed::LinkNone) { - cast_item_medialink_edit->hide(); - cast_item_medialink_label->hide(); - } - // // Item Title // @@ -210,15 +195,6 @@ EditCast::EditCast(unsigned cast_id,QWidget *parent) cast_status_label->setEnabled(cast_status!=RDPodcast::StatusExpired); cast_active_rbutton->setEnabled(cast_status!=RDPodcast::StatusExpired); - // - // Report Button - // - cast_report_button=new QPushButton(this); - cast_report_button->setFont(buttonFont()); - cast_report_button->setText(tr("Episode\n&Report")); - cast_report_button->setEnabled(cast_feed->audienceMetrics()); - connect(cast_report_button,SIGNAL(clicked()),this,SLOT(reportData())); - // // Ok Button // @@ -240,9 +216,6 @@ EditCast::EditCast(unsigned cast_id,QWidget *parent) // // Populate Values // - cast_item_medialink_edit-> - setText(cast_feed->audioUrl(cast_feed->mediaLinkMode(), - "[web-hostname]",cast_cast->id())); cast_item_title_edit->setText(cast_cast->itemTitle()); cast_item_author_edit->setText(cast_cast->itemAuthor()); cast_item_origin_edit->setText(RDUtcToLocal(cast_cast->originDateTime()). @@ -349,14 +322,6 @@ void EditCast::expirationSelectData() } -void EditCast::reportData() -{ - PickReportDates *rd=new PickReportDates(cast_cast->feedId(),cast_cast->id()); - rd->exec(); - delete rd; -} - - void EditCast::okData() { QString err_msg; @@ -416,14 +381,7 @@ void EditCast::resizeEvent(QResizeEvent *e) int ypos=0; int h=size().height(); - cast_item_medialink_edit->setGeometry(135,10,size().width()-145,20); - cast_item_medialink_label->setGeometry(20,10,110,20); - if(cast_feed->mediaLinkMode()==RDFeed::LinkNone) { - ypos=10; - } - else { - ypos=42; - } + ypos=2; // // Title @@ -520,7 +478,6 @@ void EditCast::resizeEvent(QResizeEvent *e) // // Buttons // - cast_report_button->setGeometry(10,size().height()-60,80,50); cast_ok_button->setGeometry(size().width()-180,size().height()-60,80,50); cast_cancel_button->setGeometry(size().width()-90,size().height()-60,80,50); } diff --git a/rdcastmanager/edit_cast.h b/rdcastmanager/edit_cast.h index 8cc4d65d..6e3aab36 100644 --- a/rdcastmanager/edit_cast.h +++ b/rdcastmanager/edit_cast.h @@ -49,7 +49,6 @@ class EditCast : public RDDialog void expirationSelectedData(int state); void effectiveSelectData(); void expirationSelectData(); - void reportData(); void okData(); void cancelData(); @@ -59,8 +58,6 @@ class EditCast : public RDDialog private: RDFeed *cast_feed; RDPodcast *cast_cast; - QLabel *cast_item_medialink_label; - QLineEdit *cast_item_medialink_edit; QLabel *cast_item_title_label; QLineEdit *cast_item_title_edit; QLabel *cast_item_author_label; @@ -93,7 +90,6 @@ class EditCast : public RDDialog QDateTimeEdit *cast_item_effective_edit; QPushButton *cast_item_effective_button; QButtonGroup *cast_item_status_group; - QPushButton *cast_report_button; QPushButton *cast_ok_button; QPushButton *cast_cancel_button; RDPodcast::Status cast_status; diff --git a/rdcastmanager/list_casts.cpp b/rdcastmanager/list_casts.cpp index 034a90bd..de8a4dd1 100644 --- a/rdcastmanager/list_casts.cpp +++ b/rdcastmanager/list_casts.cpp @@ -26,12 +26,10 @@ #include #include #include -#include #include "edit_cast.h" #include "globals.h" #include "list_casts.h" -#include "pick_report_dates.h" // // Icons @@ -69,7 +67,8 @@ ListCasts::ListCasts(unsigned feed_id,bool is_super,QWidget *parent) // Progress Dialog // list_progress_dialog= - new QProgressDialog(tr("Uploading Audio..."),tr("Cancel"),0,list_feed->totalPostSteps(),this); + new QProgressDialog(tr("Uploading Audio..."),tr("Cancel"),0, + list_feed->totalPostSteps(),this); list_progress_dialog->setWindowTitle("RDCastManager - "+tr("Progress")); list_progress_dialog->setMinimumDuration(0); connect(list_feed,SIGNAL(postProgressChanged(int)), @@ -173,15 +172,6 @@ ListCasts::ListCasts(unsigned feed_id,bool is_super,QWidget *parent) list_delete_button->setText(tr("&Delete")); connect(list_delete_button,SIGNAL(clicked()),this,SLOT(deleteData())); - // - // Report Button - // - list_report_button=new QPushButton(this); - list_report_button->setFont(buttonFont()); - list_report_button->setText(tr("Subscription\n&Report")); - list_report_button->setEnabled(list_feed->audienceMetrics()); - connect(list_report_button,SIGNAL(clicked()),this,SLOT(reportData())); - // // Close Button // @@ -230,7 +220,8 @@ void ListCasts::addCartData() delete cd; RDFeed::Error err; unsigned cast_id=list_feed->postCut(rda->user(),rda->station(),cutname,&err, - rda->config()->logXloadDebugData(),rda->config()); + rda->config()->logXloadDebugData(), + rda->config()); if(err!=RDFeed::ErrorOk) { QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"), RDFeed::errorString(err)); @@ -256,7 +247,8 @@ void ListCasts::addFileData() } RDFeed::Error err; unsigned cast_id=list_feed->postFile(rda->user(),rda->station(),srcfile,&err, - rda->config()->logXloadDebugData(),rda->config()); + rda->config()->logXloadDebugData(), + rda->config()); if(err!=RDFeed::ErrorOk) { QMessageBox::warning(this,"RDCastManager - "+tr("Posting Error"), RDFeed::errorString(err)); @@ -313,7 +305,8 @@ void ListCasts::deleteData() sleep(1); qApp->processEvents(); RDPodcast *cast=new RDPodcast(rda->config(),item->id()); - if(!cast->removeAudio(list_feed,&err_text,rda->config()->logXloadDebugData())) { + if(!cast->removeAudio(list_feed,&err_text, + rda->config()->logXloadDebugData())) { if(QMessageBox::warning(this,"RDCastManager - "+tr("Remote Error"), tr("Unable to delete remote audio!\n")+ tr("The server said: \"")+err_text+"\".\n\n"+ @@ -334,14 +327,11 @@ void ListCasts::deleteData() q=new RDSqlQuery(sql); delete q; - if(!list_feed->audienceMetrics()) { - if(!list_feed->postXml(&err_text)) { - QMessageBox::warning(this,"RDCastManager - "+tr("Remote Error"), - tr("Unable to update remote XML data!\n")+ - tr("The server said: \"")+err_text+"\"."); - } + if(!list_feed->postXml(&err_text)) { + QMessageBox::warning(this,"RDCastManager - "+tr("Remote Error"), + tr("Unable to update remote XML data!\n")+ + tr("The server said: \"")+err_text+"\"."); } - RDDeleteCastCount(list_feed_id,item->id()); pd->reset(); @@ -351,14 +341,6 @@ void ListCasts::deleteData() } -void ListCasts::reportData() -{ - PickReportDates *rd=new PickReportDates(list_feed_id,0); - rd->exec(); - delete rd; -} - - void ListCasts::doubleClickedData(Q3ListViewItem *item,const QPoint &pt, int col) { @@ -427,7 +409,6 @@ void ListCasts::resizeEvent(QResizeEvent *e) list_file_button->setGeometry(100,size().height()-60,80,50); list_edit_button->setGeometry(190,size().height()-60,80,50); list_delete_button->setGeometry(280,size().height()-60,80,50); - list_report_button->setGeometry(400,size().height()-60,110,50); list_close_button->setGeometry(size().width()-90,size().height()-60,80,50); } diff --git a/rdcastmanager/list_casts.h b/rdcastmanager/list_casts.h index fc80c826..8f163b98 100644 --- a/rdcastmanager/list_casts.h +++ b/rdcastmanager/list_casts.h @@ -42,7 +42,6 @@ class ListCasts : public RDDialog void addFileData(); void editData(); void deleteData(); - void reportData(); void doubleClickedData(Q3ListViewItem *item,const QPoint &pt,int col); void userChangedData(); void filterChangedData(const QString &str); @@ -63,7 +62,6 @@ class ListCasts : public RDDialog QPushButton *list_file_button; QPushButton *list_edit_button; QPushButton *list_delete_button; - QPushButton *list_report_button; QPushButton *list_close_button; QPixmap *list_redball_map; QPixmap *list_greenball_map; diff --git a/rdcastmanager/pick_report_dates.cpp b/rdcastmanager/pick_report_dates.cpp deleted file mode 100644 index 3b0823f4..00000000 --- a/rdcastmanager/pick_report_dates.cpp +++ /dev/null @@ -1,290 +0,0 @@ -// pick_report_date.cpp -// -// Select a Set of Dates for a Rivendell Report -// -// (C) Copyright 2002-2019 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include -#include - -#include -#include -#include -#include -#include - -#include "globals.h" -#include "pick_report_dates.h" - -PickReportDates::PickReportDates(unsigned feed_id,unsigned cast_id, - QWidget *parent) - : RDDialog(parent) -{ - QString sql; - RDSqlQuery *q; - QDate yesterday_date=QDate::currentDate().addDays(-1); - - edit_cast_id=feed_id; - edit_cast_id=cast_id; - setWindowTitle("RDCastManager - "+tr("Select Report Dates")); - - sql=QString().sprintf("select KEY_NAME from FEEDS where ID=%d",feed_id); - q=new RDSqlQuery(sql); - if(q->first()) { - edit_keyname=q->value(0).toString(); - } - delete q; - - // - // Fix the Window Size - // - setMaximumSize(sizeHint()); - setMaximumSize(sizeHint()); - - // - // Start Date - // - edit_startdate_edit=new QDateEdit(this); - edit_startdate_edit->setGeometry(150,10,100,20); - edit_startdate_edit->setDisplayFormat("MM/dd/yyyy"); - edit_startdate_edit->setDate(yesterday_date.addMonths(-1)); - QLabel *label=new QLabel(edit_startdate_edit,tr("&Start Date:"),this); - label->setGeometry(75,10,70,20); - label->setFont(labelFont()); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - QPushButton *button=new QPushButton(this); - button->setGeometry(260,7,50,27); - button->setFont(subButtonFont()); - button->setText(tr("&Select")); - connect(button,SIGNAL(clicked()),this,SLOT(selectStartDateData())); - - // - // End Date - // - edit_enddate_edit=new QDateEdit(this); - edit_enddate_edit->setGeometry(150,40,100,20); - edit_enddate_edit->setDisplayFormat("MM/dd/yyyy"); - edit_enddate_edit->setDate(yesterday_date); - label=new QLabel(edit_enddate_edit,tr("&End Date:"),this); - label->setGeometry(75,40,70,20); - label->setFont(labelFont()); - label->setAlignment(Qt::AlignRight|Qt::AlignVCenter); - button=new QPushButton(this); - button->setGeometry(260,37,50,27); - button->setFont(subButtonFont()); - button->setText(tr("&Select")); - connect(button,SIGNAL(clicked()),this,SLOT(selectEndDateData())); - - // - // Generate Button - // - button=new QPushButton(this); - button->setGeometry(10,sizeHint().height()-60,80,50); - button->setFont(buttonFont()); - button->setText(tr("&Generate\nReport")); - connect(button,SIGNAL(clicked()),this,SLOT(generateData())); - - // - // Close Button - // - button=new QPushButton(this); - button->setGeometry(sizeHint().width()-90,sizeHint().height()-60,80,50); - button->setDefault(true); - button->setFont(buttonFont()); - button->setText(tr("C&lose")); - connect(button,SIGNAL(clicked()),this,SLOT(closeData())); -} - - -PickReportDates::~PickReportDates() -{ -} - - -QSize PickReportDates::sizeHint() const -{ - return QSize(400,134); -} - - -QSizePolicy PickReportDates::sizePolicy() const -{ - return QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Fixed); -} - - -void PickReportDates::selectStartDateData() -{ - RDDateDialog *dialog=new RDDateDialog(2002,QDate::currentDate().year(),this); - QDate date=edit_startdate_edit->date(); - if(dialog->exec(&date)<0) { - delete dialog; - return; - } - edit_startdate_edit->setDate(date); - edit_enddate_edit->setDate(date); - delete dialog; -} - - -void PickReportDates::selectEndDateData() -{ - RDDateDialog *dialog=new RDDateDialog(2002,QDate::currentDate().year(),this); - QDate date=edit_enddate_edit->date(); - if(dialog->exec(&date)<0) { - delete dialog; - return; - } - edit_enddate_edit->setDate(date); - delete dialog; -} - - -void PickReportDates::generateData() -{ - QString report; - if(edit_cast_id>0) { - GenerateEpisodeReport(edit_keyname,edit_cast_id,&report); - } - else { - GenerateSubscriptionReport(edit_keyname,&report); - } - RDTextFile(report); -} - - -void PickReportDates::closeData() -{ - done(0); -} - - -void PickReportDates::GenerateSubscriptionReport(const QString &keyname, - QString *rpt) -{ - QString sql; - RDSqlQuery *q; - - RDFeed *feed=new RDFeed(keyname,rda->config(),this); - unsigned total=0; - unsigned rss_total=0; - unsigned audio_total=0; - - // - // Header - // - *rpt=RDReport::center("Rivendell Podcast Subscription Report",76)+"\n"; - *rpt+=RDReport::center(feed->channelTitle(),75)+"\n"; - *rpt+="\n"; - *rpt+=" ----- Downloads -----\n"; - *rpt+=" Date RSS Audio\n"; - *rpt+=" ---------------------------------------------\n"; - - // - // Data Rows - // - sql=QString("select ")+ - "ACCESS_DATE,"+ // 00 - "ACCESS_COUNT,"+ // 01 - "CAST_ID "+ // 02 - "from CAST_DOWNLOADS where "+ - "FEED_KEY_NAME=\""+RDEscapeString(keyname)+"\" && "+ - "(ACCESS_DATE>=\""+RDEscapeString(edit_startdate_edit->date(). - toString("yyyy-MM-dd"))+"\")&&"+ - "(ACCESS_DATE<=\""+RDEscapeString(edit_enddate_edit->date(). - toString("yyyy-MM-dd"))+"\") "+ - "order by ACCESS_DATE,CAST_ID desc"; - q=new RDSqlQuery(sql); - while(q->next()) { - if(q->value(2).toUInt()==0) { - *rpt+=QString().sprintf(" %s %9u %9u\n", - (const char *)q->value(0).toDate(). - toString("MM/dd/yyyy"), - q->value(1).toUInt(),total); - total=0; - rss_total+=q->value(1).toUInt(); - } - else { - total+=q->value(1).toUInt(); - audio_total+=q->value(1).toUInt(); - } - } - delete q; - *rpt+=QString().sprintf(" ------------ ------------\n"); - *rpt+=QString().sprintf(" %9u %9u\n", - rss_total,audio_total); - - delete feed; -} - - -void PickReportDates::GenerateEpisodeReport(const QString &keyname, - unsigned cast_id,QString *rpt) -{ - QString sql; - RDSqlQuery *q; - - RDFeed *feed=new RDFeed(keyname,rda->config(),this); - RDPodcast *cast=new RDPodcast(rda->config(),cast_id); - - // - // Header - // - *rpt=RDReport::center("Rivendell Podcast Episode Report",76)+"\n"; - *rpt+=RDReport::center(feed->channelTitle(),76)+"\n"; - *rpt+=RDReport::center(cast->itemTitle(),76)+"\n"; - *rpt+=QString().sprintf(" Posted on %s at %s\n\n", - (const char *)cast->originDateTime(). - toString("MM/dd/yyyy"), - (const char *)cast->originDateTime(). - toString("hh:mm:ss")); - *rpt+=" Date Downloads\n"; - *rpt+=" --------------------------------\n"; - - // - // Data Rows - // - unsigned total=0; - sql=QString("select ")+ - "ACCESS_DATE,"+ // 00 - "ACCESS_COUNT "+ // 01 - "from CAST_DOWNLOADS where "+ - "FEED_KEY_NAME=\""+RDEscapeString(keyname)+"\" && "+ - "(ACCESS_DATE>=\""+RDEscapeString(edit_startdate_edit->date(). - toString("yyyy-MM-dd"))+"\")&&"+ - "(ACCESS_DATE<=\""+RDEscapeString(edit_enddate_edit->date(). - toString("yyyy-MM-dd"))+"\")&&"+ - QString().sprintf("(CAST_ID=%u) ",cast_id)+ - "order by ACCESS_DATE"; - q=new RDSqlQuery(sql); - while(q->next()) { - *rpt+=QString().sprintf(" %s %9u\n", - (const char *)q->value(0).toDate(). - toString("MM/dd/yyyy"), - q->value(1).toUInt()); - total+=q->value(1).toUInt(); - } - delete q; - - *rpt+=QString(). - sprintf(" ------------\n"); - *rpt+=QString(). - sprintf(" %9u\n",total); - - delete cast; - delete feed; -} diff --git a/rdcastmanager/pick_report_dates.h b/rdcastmanager/pick_report_dates.h deleted file mode 100644 index 55569ccc..00000000 --- a/rdcastmanager/pick_report_dates.h +++ /dev/null @@ -1,55 +0,0 @@ -// pick_report_date.h -// -// Select a Set of Dates for a Rivendell Podcast Report -// -// (C) Copyright 2002-2019 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef PICK_REPORT_DATE_H -#define PICK_REPORT_DATE_H - -#include - -#include - -class PickReportDates : public RDDialog -{ - Q_OBJECT - public: - PickReportDates(unsigned feed_id,unsigned cast_id,QWidget *parent=0); - ~PickReportDates(); - QSize sizeHint() const; - QSizePolicy sizePolicy() const; - - private slots: - void selectStartDateData(); - void selectEndDateData(); - void generateData(); - void closeData(); - - private: - void GenerateSubscriptionReport(const QString &keyname,QString *rpt); - void GenerateEpisodeReport(const QString &keyname,unsigned cast_id, - QString *rpt); - QDateEdit *edit_startdate_edit; - QDateEdit *edit_enddate_edit; - QString edit_keyname; - unsigned edit_feed_id; - unsigned edit_cast_id; -}; - - -#endif // PICK_REPORT_DATES_H diff --git a/rdcastmanager/rdcastmanager_cs.ts b/rdcastmanager/rdcastmanager_cs.ts index 53065815..b95178a9 100644 --- a/rdcastmanager/rdcastmanager_cs.ts +++ b/rdcastmanager/rdcastmanager_cs.ts @@ -78,7 +78,7 @@ Episode &Report - &Zpráva o + &Zpráva o dílu @@ -95,7 +95,7 @@ dílu Media Link: - Multimediální odkaz: + Multimediální odkaz: Expires On: @@ -139,7 +139,7 @@ vozí&ku/záběru Subscription &Report - Zpráva o + Zpráva o &odběru @@ -382,30 +382,9 @@ Clipboard PickReportDates - - Select Report Dates - - - - &Start Date: - - &Select - &Vybrat - - - &End Date: - - - - &Generate -Report - - - - C&lose - + &Vybrat diff --git a/rdcastmanager/rdcastmanager_de.ts b/rdcastmanager/rdcastmanager_de.ts index 11083f7e..a922f8c5 100644 --- a/rdcastmanager/rdcastmanager_de.ts +++ b/rdcastmanager/rdcastmanager_de.ts @@ -78,7 +78,7 @@ Episode &Report - Episoden- + Episoden- &Report @@ -95,7 +95,7 @@ Media Link: - Medienlink: + Medienlink: Expires On: @@ -139,7 +139,7 @@ Car&t/Cut Subscription &Report - Abonnement + Abonnement &Report @@ -371,30 +371,9 @@ Clipboard PickReportDates - - Select Report Dates - - - - &Start Date: - - &Select - &Auswählen - - - &End Date: - - - - &Generate -Report - - - - C&lose - + &Auswählen diff --git a/rdcastmanager/rdcastmanager_es.ts b/rdcastmanager/rdcastmanager_es.ts index e389a4a6..df6d6f66 100644 --- a/rdcastmanager/rdcastmanager_es.ts +++ b/rdcastmanager/rdcastmanager_es.ts @@ -82,7 +82,7 @@ Episode &Report - &Reporte de + &Reporte de Episodios @@ -91,7 +91,7 @@ Episodios Media Link: - Enlace al medio: + Enlace al medio: Expires On: @@ -183,7 +183,7 @@ Car&t./Audio Subscription &Report - &Reporte de + &Reporte de Suscripción @@ -323,29 +323,29 @@ Clipboard PickReportDates Select Report Dates - Elegir Fechas del Reporte + Elegir Fechas del Reporte &Start Date: - Fech. &Inicio: + Fech. &Inicio: &Select - &Elegir + &Elegir &End Date: - Fech. &Fin: + Fech. &Fin: &Generate Report - &Generar + &Generar Reporte C&lose - &Cerrar + &Cerrar diff --git a/rdcastmanager/rdcastmanager_fr.ts b/rdcastmanager/rdcastmanager_fr.ts index 87cde746..bd037289 100644 --- a/rdcastmanager/rdcastmanager_fr.ts +++ b/rdcastmanager/rdcastmanager_fr.ts @@ -63,11 +63,6 @@ Posting Status: - - Episode -&Report - - &OK @@ -80,10 +75,6 @@ Air Date/Time: - - Media Link: - - Expires On: @@ -121,11 +112,6 @@ Car&t/Cut &Delete - - Subscription -&Report - - &Close @@ -294,32 +280,4 @@ Clipboard - - PickReportDates - - Select Report Dates - - - - &Start Date: - - - - &Select - - - - &End Date: - - - - &Generate -Report - - - - C&lose - - - diff --git a/rdcastmanager/rdcastmanager_nb.ts b/rdcastmanager/rdcastmanager_nb.ts index a5e45716..21f612cf 100644 --- a/rdcastmanager/rdcastmanager_nb.ts +++ b/rdcastmanager/rdcastmanager_nb.ts @@ -78,7 +78,7 @@ Episode &Report - Episode- + Episode- &rapport @@ -89,10 +89,6 @@ &Cancel &Avbryt - - Media Link: - - Air Date/Time: @@ -139,7 +135,7 @@ Korg/Ku&tt Subscription &Report - Abonnements&rapport + Abonnements&rapport &Close @@ -370,30 +366,9 @@ Clipboard PickReportDates - - Select Report Dates - - - - &Start Date: - - &Select - &Vel - - - &End Date: - - - - &Generate -Report - - - - C&lose - + &Vel diff --git a/rdcastmanager/rdcastmanager_nn.ts b/rdcastmanager/rdcastmanager_nn.ts index a5e45716..21f612cf 100644 --- a/rdcastmanager/rdcastmanager_nn.ts +++ b/rdcastmanager/rdcastmanager_nn.ts @@ -78,7 +78,7 @@ Episode &Report - Episode- + Episode- &rapport @@ -89,10 +89,6 @@ &Cancel &Avbryt - - Media Link: - - Air Date/Time: @@ -139,7 +135,7 @@ Korg/Ku&tt Subscription &Report - Abonnements&rapport + Abonnements&rapport &Close @@ -370,30 +366,9 @@ Clipboard PickReportDates - - Select Report Dates - - - - &Start Date: - - &Select - &Vel - - - &End Date: - - - - &Generate -Report - - - - C&lose - + &Vel diff --git a/rdcastmanager/rdcastmanager_pt_BR.ts b/rdcastmanager/rdcastmanager_pt_BR.ts index 813854da..89dd01d1 100644 --- a/rdcastmanager/rdcastmanager_pt_BR.ts +++ b/rdcastmanager/rdcastmanager_pt_BR.ts @@ -9,7 +9,7 @@ Media Link: - Link de Mídia: + Link de Mídia: Title: @@ -86,7 +86,7 @@ Episode &Report - &Relatório do + &Relatório do Episódio @@ -192,7 +192,7 @@ Car&t/Cut Subscription &Report - &Relatório de + &Relatório de Assinaturas @@ -336,30 +336,9 @@ Clipboard PickReportDates - - Select Report Dates - - - - &Start Date: - - &Select - &Selecionar - - - &End Date: - - - - &Generate -Report - - - - C&lose - + &Selecionar diff --git a/rivendell.spec.in b/rivendell.spec.in index 69820d9e..571b1151 100644 --- a/rivendell.spec.in +++ b/rivendell.spec.in @@ -1,7 +1,7 @@ ## rivendell.spec.in ## ## The Rivendell Radio Automation System -## Copyright (C) 2002-2019 Fred Gleason +## Copyright (C) 2002-2020 Fred Gleason ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of version 2 of the GNU General Public License as @@ -378,9 +378,7 @@ rm -rf $RPM_BUILD_ROOT @libexecdir@/*.gif @libexecdir@/*.html @libexecdir@/*.js -@libexecdir@/*.mp3 @libexecdir@/*.png -@libexecdir@/*.xml @libexecdir@/rdcastmanager.cgi %attr(6755,root,root) @libexecdir@/rdxport.cgi %attr(6755,root,root) @libexecdir@/webget.cgi diff --git a/utils/rddbmgr/revertschema.cpp b/utils/rddbmgr/revertschema.cpp index 98a26735..45679e93 100644 --- a/utils/rddbmgr/revertschema.cpp +++ b/utils/rddbmgr/revertschema.cpp @@ -41,6 +41,55 @@ bool MainObject::RevertSchema(int cur_schema,int set_schema,QString *err_msg) + // + // Revert 328 + // + if((cur_schema==328)&&(set_schemacur_schema)) { + DropColumn("FEEDS","AUDIENCE_METRICS"); + DropColumn("FEEDS","KEEP_METADATA"); + DropColumn("FEEDS","MEDIA_LINK_MODE"); + DropColumn("FEEDS","REDIRECT_PATH"); + DropTable("CAST_DOWNLOADS"); + + WriteSchemaVersion(++cur_schema); + } + // NEW SCHEMA UPDATES GO HERE... diff --git a/utils/rdpurgecasts/rdpurgecasts.cpp b/utils/rdpurgecasts/rdpurgecasts.cpp index 9b31d082..51702e92 100644 --- a/utils/rdpurgecasts/rdpurgecasts.cpp +++ b/utils/rdpurgecasts/rdpurgecasts.cpp @@ -2,7 +2,7 @@ // // A Utility to Purge Expired Podcasts. // -// (C) Copyright 2007,2016-2018 Fred Gleason +// (C) Copyright 2007-2020 Fred Gleason // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as @@ -119,9 +119,7 @@ void MainObject::PurgeCast(unsigned id) QString errs; sql=QString("select ")+ - "FEEDS.ID,"+ // 00 - "FEEDS.KEEP_METADATA,"+ // 01 - "FEEDS.KEY_NAME "+ // 02 + "FEEDS.ID "+ // 00 "from PODCASTS left join FEEDS "+ "on(PODCASTS.FEED_ID=FEEDS.ID) where "+ QString().sprintf("PODCASTS.ID=%u",id); @@ -135,25 +133,11 @@ void MainObject::PurgeCast(unsigned id) } delete cast; delete feed; - if(RDBool(q->value(1).toString())) { - sql=QString("update PODCASTS set ")+ - QString().sprintf("STATUS=%u where ",RDPodcast::StatusExpired)+ - QString().sprintf("ID=%u",id); - q1=new RDSqlQuery(sql); - delete q1; - } - else { - sql=QString("delete from CAST_DOWNLOADS where ")+ - "FEED_KEY_NAME=\""+RDEscapeString(q->value(2).toString())+"\" && "+ - QString().sprintf("CAST_ID=%d",id); - q1=new RDSqlQuery(sql); - delete q1; - sql=QString("delete from PODCASTS where ")+ - QString().sprintf("ID=%d",id); - q1=new RDSqlQuery(sql); - delete q1; - } + sql=QString("delete from PODCASTS where ")+ + QString().sprintf("ID=%d",id); + q1=new RDSqlQuery(sql); + delete q1; sql=QString("update FEEDS set ")+ "LAST_BUILD_DATETIME=\""+ RDEscapeString(current_datetime.toString("yyyy-MM-dd hh:mm:ss"))+ diff --git a/web/Makefile.am b/web/Makefile.am index 1a6de85f..1a29eef3 100644 --- a/web/Makefile.am +++ b/web/Makefile.am @@ -2,7 +2,7 @@ ## ## Automake.am for rivendell/web ## -## (C) Copyright 2002-2007,2016 Fred Gleason +## (C) Copyright 2002-2020 Fred Gleason ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as @@ -21,7 +21,6 @@ ## Use automake to process this into a Makefile.in SUBDIRS = rdcastmanager\ - rdfeed\ rdxport\ tests\ webget diff --git a/web/rdcastmanager/rdcastmanager.cpp b/web/rdcastmanager/rdcastmanager.cpp index d57ba28f..afc1f20a 100644 --- a/web/rdcastmanager/rdcastmanager.cpp +++ b/web/rdcastmanager/rdcastmanager.cpp @@ -813,6 +813,7 @@ void MainObject::ServeEditCast(int cast_id) // // Media Link // + /* if(feed->mediaLinkMode()!=RDFeed::LinkNone) { printf("\n"); printf("Media Link:\n", @@ -828,7 +829,7 @@ void MainObject::ServeEditCast(int cast_id) printf(" \n"); printf("\n"); } - + */ // // Cast Data // diff --git a/web/rdfeed/Makefile.am b/web/rdfeed/Makefile.am deleted file mode 100644 index 6253879c..00000000 --- a/web/rdfeed/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -## Makefile.am -## -## (C) Copyright 2002-2020 Fred Gleason -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License version 2 as -## published by the Free Software Foundation. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public -## License along with this program; if not, write to the Free Software -## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -## -## Use automake to process this into a Makefile.in - -AM_CPPFLAGS = -Wall -DPREFIX=\"$(prefix)\" -I$(top_srcdir)/lib @QT4_CFLAGS@ @MUSICBRAINZ_CFLAGS@ -DQT3_SUPPORT -I/usr/include/Qt3Support -LIBS = -L$(top_srcdir)/lib -MOC = @QT_MOC@ - -install-exec-local: - if test ! -f $(DESTDIR)@libexecdir@/rdfeed.mp3 ; then ln -s @libexecdir@/rdfeed.xml $(DESTDIR)@libexecdir@/rdfeed.mp3 ; fi - -uninstall-local: - rm -f $(DESTDIR)@libexecdir@/rdfeed.mp3 - -libexec_PROGRAMS = rdfeed.xml - -dist_rdfeed_xml_SOURCES = rdfeed_script.cpp rdfeed_script.h - -rdfeed_xml_LDADD = @LIB_RDLIBS@ @LIBVORBIS@ @QT4_LIBS@ @MUSICBRAINZ_LIBS@ -lQt3Support - -EXTRA_DIST = rdfeed.pro - -CLEANFILES = *~\ - *.idb\ - *ilk\ - *.obj\ - *.pdb\ - *.qm\ - moc_* - -MAINTAINERCLEANFILES = *~\ - Makefile.in\ - moc_* diff --git a/web/rdfeed/rdfeed.pro b/web/rdfeed/rdfeed.pro deleted file mode 100644 index e69de29b..00000000 diff --git a/web/rdfeed/rdfeed_script.cpp b/web/rdfeed/rdfeed_script.cpp deleted file mode 100644 index 9de9831a..00000000 --- a/web/rdfeed/rdfeed_script.cpp +++ /dev/null @@ -1,262 +0,0 @@ -// rdfeed_script.cpp -// -// An RSS Feed Generator for Rivendell. -// -// (C) Copyright 2002-2020 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "rdfeed_script.h" - -char server_name[PATH_MAX]; - -MainObject::MainObject(QObject *parent) - :QObject(parent) -{ - QString err_msg; - char keyname[10]; - int cast_id=-1; - bool count; - - // - // Validate Feed Key Name - // - if(getenv("QUERY_STRING")==NULL) { - printf("Content-type: text/html\n"); - printf("Status: 400\n"); - printf("\n"); - printf("rdfeed: missing feed key name\n"); - exit(0); - } - int arg=0; - while((getenv("QUERY_STRING")[arg]!=0)&& - (getenv("QUERY_STRING")[arg]!='&')&&(arg<9)) { - keyname[arg]=getenv("QUERY_STRING")[arg]; - arg++; - } - if(arg==9) { - printf("Content-type: text/html\n"); - printf("Status: 400\n"); - printf("\n"); - printf("rdfeed: invalid feed key name\n"); - exit(0); - } - keyname[arg]=0; - RDGetPostInt(getenv("QUERY_STRING")+arg+1,"cast_id",&cast_id); - - // - // Get the Server Name - // - if(getenv("SERVER_NAME")==NULL) { - printf("Content-type: text/html\n"); - printf("Status: 500\n"); - printf("\n"); - printf("rdfeed: missing SERVER_NAME\n"); - exit(0); - } - strncpy(server_name,getenv("SERVER_NAME"),PATH_MAX); - - // - // Determine Range - // - if(getenv("HTTP_RANGE")!=NULL) { - count=ShouldCount(getenv("HTTP_RANGE")); - } - else { - count=true; - } - - // - // Open the Database - // - rda=new RDApplication("rdfeed.xml","rdfeed.xml",RDFEED_XML_USAGE,this); - if(!rda->open(&err_msg)) { - printf("Content-type: text/html\n"); - printf("Status: 500\n"); - printf("\n"); - printf("rdfeed.xml: %s\n",(const char *)err_msg.utf8()); - exit(0); - } - - /* - printf("Content-type: text/html\n\n"); - QString sql; - RDSqlQuery *q; - sql=QString("show variables like '%character_set%'"); - q=new RDSqlQuery(sql); - while(q->next()) { - printf("%s: %s
\n",(const char *)q->value(0).toString(), - (const char *)q->value(1).toString()); - } - delete q; - sql=QString("show variables like '%collation%'"); - q=new RDSqlQuery(sql); - while(q->next()) { - printf("%s: %s
\n",(const char *)q->value(0).toString(), - (const char *)q->value(1).toString()); - } - delete q; - exit(0); - */ - - if(cast_id<0) { - ServeRss(keyname,count); - } - ServeLink(keyname,cast_id,count); -} - - -void MainObject::ServeRss(const char *keyname,bool count) -{ - QString err_msg; - bool ok=false; - - RDFeed *feed=new RDFeed(keyname,rda->config(),this); - if(!feed->exists()) { - printf("Content-type: text/html\n\n"); - printf("no feed matches the supplied key name\n"); - exit(0); - } - - // - // Log the Access - // - if(count) { - RDIncrementFeedCount(keyname); - } - - // - // Redirect if necessary - // - if(!feed->redirectPath().isEmpty()) { - Redirect(feed->redirectPath()); - exit(0); - } - - // - // Generate CGI Header - // - printf("Content-type: application/rss+xml; charset=UTF-8\n\n"); - - // - // Generate the XML - // - QString xml=feed->rssXml(&err_msg,&ok); - if(!ok) { - printf("Content-type: text/html\n\n"); - printf("%s\n",(const char *)err_msg.toUtf8()); - exit(0); - } - printf("%s\r\n",(const char *)xml.toUtf8()); - - exit(0); -} - - -void MainObject::ServeLink(const char *keyname,int cast_id,bool count) -{ - QString sql; - RDSqlQuery *q; - - sql=QString("select ")+ - "FEEDS.BASE_URL,"+ // 00 - "PODCASTS.AUDIO_FILENAME "+ // 01 - "from FEEDS left join PODCASTS "+ - "on FEEDS.ID=PODCASTS.FEED_ID where "+ - "(FEEDS.KEY_NAME=\""+RDEscapeString(keyname)+"\")&&"+ - QString().sprintf("(PODCASTS.ID=%d)",cast_id); - q=new RDSqlQuery(sql); - if(!q->first()) { - delete q; - RDCgiError("Unable to retrieve cast record!"); - } - if(count) { - RDIncrementCastCount(keyname,cast_id); - } - printf("Content-type: audio/x-mpeg\n"); - printf("Location: %s/%s\n\n",(const char *)q->value(0).toString(), - (const char *)q->value(1).toString().utf8()); - delete q; - - exit(0); -} - - -bool MainObject::ShouldCount(const QString &hdr) -{ - bool ret=false; - QStringList lines=hdr.split("\n"); - int n; - QString str; - - for(int i=0;i0) { - if(lines[i].left(n).lower()=="bytes") { - str=lines[i].right(lines[i].length()-n-1).stripWhiteSpace(); - n=str.find("-"); - if(n==0) { - ret=true; - } - if(n>0) { - if(str.left(n)=="0") { - ret=true; - } - } - } - } - } - - return ret; -} - - -void MainObject::Redirect(const QString &url) -{ - printf("Status: 301 Moved Permanently\n"); - printf("Location: %s\n",(const char *)url.utf8()); - printf("Content-type: text/html\n"); - printf("\n"); - printf("The feed has been relocated to %s.\n",(const char *)url.utf8()); -} - - -int main(int argc,char *argv[]) -{ - QApplication a(argc,argv,false); - new MainObject(); - return a.exec(); -} diff --git a/web/rdfeed/rdfeed_script.h b/web/rdfeed/rdfeed_script.h deleted file mode 100644 index c0b4f6c9..00000000 --- a/web/rdfeed/rdfeed_script.h +++ /dev/null @@ -1,43 +0,0 @@ -// rdfeed_script.h -// -// An RSS Feed Generator for Rivendell. -// -// (C) Copyright 2002-2020 Fred Gleason -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License version 2 as -// published by the Free Software Foundation. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public -// License along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -// - -#ifndef RDFEED_SCRIPT_H -#define RDFEED_SCRIPT_H - -#include - -#include - -#define RDFEED_XML_USAGE "\n" - -class MainObject : public QObject -{ - public: - MainObject(QObject *parent=0); - - private: - void ServeRss(const char *keyname,bool count); - void ServeLink(const char *keyname,int cast_id,bool count); - bool ShouldCount(const QString &hdr); - void Redirect(const QString &url); -}; - - -#endif // RDFEED_SCRIPT_H