mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-05-19 06:32:34 +02:00
2023-01-24 Fred Gleason <fredg@paravelsystems.com>
* Added more detail to data transfer errors generated by the podcasting subsystem. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
f70e871508
commit
100e5dc025
@ -23945,3 +23945,6 @@
|
||||
of similarly-named windows when enforcing single instances.
|
||||
2023-01-20 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added a splash screen to rdairplay(1).
|
||||
2023-01-24 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added more detail to data transfer errors generated by the
|
||||
podcasting subsystem.
|
||||
|
@ -955,11 +955,12 @@ QString RDFeed::imageUrl(int img_id) const
|
||||
}
|
||||
|
||||
|
||||
bool RDFeed::postXml()
|
||||
bool RDFeed::postXml(QString *err_msg)
|
||||
{
|
||||
long response_code;
|
||||
CURL *curl=NULL;
|
||||
CURLcode curl_err;
|
||||
char curl_errorbuffer[CURL_ERROR_SIZE];
|
||||
struct curl_httppost *first=NULL;
|
||||
struct curl_httppost *last=NULL;
|
||||
|
||||
@ -992,6 +993,7 @@ bool RDFeed::postXml()
|
||||
QStringList *err_msgs=SetupCurlLogging(curl);
|
||||
curl_easy_setopt(curl,CURLOPT_WRITEDATA,stdout);
|
||||
curl_easy_setopt(curl,CURLOPT_HTTPPOST,first);
|
||||
curl_easy_setopt(curl,CURLOPT_ERRORBUFFER,curl_errorbuffer);
|
||||
curl_easy_setopt(curl,CURLOPT_USERAGENT,
|
||||
rda->config()->userAgent().toUtf8().constData());
|
||||
curl_easy_setopt(curl,CURLOPT_TIMEOUT,RD_CURL_TIMEOUT);
|
||||
@ -1005,6 +1007,7 @@ bool RDFeed::postXml()
|
||||
// Send it
|
||||
//
|
||||
if((curl_err=curl_easy_perform(curl))!=CURLE_OK) {
|
||||
*err_msg=QString::fromUtf8(curl_errorbuffer);
|
||||
curl_easy_cleanup(curl);
|
||||
curl_formfree(first);
|
||||
ProcessCurlLogging("RDFeed::postPodcast()",err_msgs);
|
||||
@ -1022,6 +1025,8 @@ bool RDFeed::postXml()
|
||||
// Process the results
|
||||
//
|
||||
if((response_code<200)||(response_code>299)) {
|
||||
*err_msg=tr("remote server returned unexpected response code")+
|
||||
QString::asprintf(" %ld",response_code);
|
||||
ProcessCurlLogging("RDFeed::postPodcast()",err_msgs);
|
||||
return false;
|
||||
}
|
||||
@ -1033,9 +1038,11 @@ bool RDFeed::postXml()
|
||||
|
||||
bool RDFeed::postXmlConditional(const QString &caption,QWidget *widget)
|
||||
{
|
||||
if(!postXml()) {
|
||||
QString err_msg;
|
||||
|
||||
if(!postXml(&err_msg)) {
|
||||
QMessageBox::warning(widget,caption+" - "+tr("Error"),
|
||||
tr("XML data upload failed!"));
|
||||
tr("XML data upload failed!")+"\n["+err_msg+"]");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -1393,7 +1400,7 @@ unsigned RDFeed::postCut(const QString &cutname,QString *err_msg)
|
||||
//
|
||||
// Update posted XML
|
||||
//
|
||||
postXml();
|
||||
postXml(err_msg);
|
||||
emit postProgressChanged(5);
|
||||
*err_msg=tr("OK");
|
||||
|
||||
@ -1509,9 +1516,8 @@ unsigned RDFeed::postFile(const QString &srcfile,QString *err_msg)
|
||||
//
|
||||
// Update posted XML
|
||||
//
|
||||
postXml();
|
||||
postXml(err_msg);
|
||||
emit postProgressChanged(6);
|
||||
// *err=RDFeed::ErrorOk;
|
||||
|
||||
return cast_id;
|
||||
}
|
||||
@ -1611,7 +1617,7 @@ unsigned RDFeed::postLog(const QString &logname,const QTime &start_time,
|
||||
cast->setAudioTime(log_model->length(start_line,1+end_line));
|
||||
delete log;
|
||||
|
||||
postXml();
|
||||
postXml(err_msg);
|
||||
emit postProgressChanged(4+(end_line-start_line));
|
||||
|
||||
delete cast;
|
||||
|
@ -135,7 +135,7 @@ class RDFeed : public QObject
|
||||
bool postPodcast(unsigned cast_id,QString *err_msg);
|
||||
QString audioUrl(unsigned cast_id);
|
||||
QString imageUrl(int img_id) const;
|
||||
bool postXml();
|
||||
bool postXml(QString *err_msg);
|
||||
bool postXmlConditional(const QString &caption,QWidget *widget);
|
||||
bool removeRss();
|
||||
bool postImage(int img_id) const;
|
||||
|
@ -343,7 +343,7 @@ void ListFeeds::repostData()
|
||||
while(q->next()) {
|
||||
if(!feed->postPodcast(q->value(0).toUInt(),&err_msg)) {
|
||||
QMessageBox::warning(this,"RDAdmin - "+tr("Error"),
|
||||
tr("Error posting to feed")+" \""+
|
||||
tr("Error posting audio to feed")+" \""+
|
||||
q->value(1).toString()+"\"\n"+
|
||||
"["+err_msg+"].");
|
||||
}
|
||||
@ -357,7 +357,12 @@ void ListFeeds::repostData()
|
||||
pd->setLabelText(tr("Posting RSS XML data..."));
|
||||
pd->setRange(0,1);
|
||||
pd->setValue(0);
|
||||
feed->postXml();
|
||||
if(!feed->postXml(&err_msg)) {
|
||||
QMessageBox::warning(this,"RDAdmin - "+tr("Error"),
|
||||
tr("Error posting updated XML to feed")+" \""+
|
||||
q->value(1).toString()+"\"\n"+
|
||||
"["+err_msg+"].");
|
||||
}
|
||||
pd->setValue(1);
|
||||
|
||||
delete pd;
|
||||
|
@ -314,6 +314,7 @@ void ListCasts::deleteData()
|
||||
{
|
||||
QString sql;
|
||||
QString err_text;
|
||||
QString err_msg;
|
||||
QModelIndexList rows=list_casts_view->selectionModel()->selectedRows();
|
||||
|
||||
if(rows.size()!=1) {
|
||||
@ -361,9 +362,10 @@ void ListCasts::deleteData()
|
||||
QString::asprintf("`ID`=%u",list_feed_id);
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
if(!list_feed->postXml()) {
|
||||
if(!list_feed->postXml(&err_msg)) {
|
||||
QMessageBox::warning(this,"RDCastManager - "+tr("Remote Error"),
|
||||
tr("Unable to update remote XML data!"));
|
||||
tr("Unable to update remote XML data!")+"\n"+
|
||||
"["+err_msg+"]");
|
||||
}
|
||||
|
||||
pd->reset();
|
||||
|
@ -172,7 +172,7 @@ void MainObject::ProcessFeed(const QString &key_name)
|
||||
q->value(0).toUInt());
|
||||
deleted=true;
|
||||
}
|
||||
if(feed->postXml()) {
|
||||
if(feed->postXml(&err_msg)) {
|
||||
rda->syslog(LOG_DEBUG,
|
||||
"repost of XML for feed \"%s\" triggered by cast id %u",
|
||||
key_name.toUtf8().constData(),q->value(0).toUInt());
|
||||
@ -186,9 +186,11 @@ void MainObject::ProcessFeed(const QString &key_name)
|
||||
}
|
||||
}
|
||||
else {
|
||||
rda->syslog(LOG_WARNING,
|
||||
"repost of XML for feed \"%s\" triggered by cast id %u failed",
|
||||
key_name.toUtf8().constData(),q->value(0).toUInt());
|
||||
rda->
|
||||
syslog(LOG_WARNING,
|
||||
"repost of XML for feed \"%s\" triggered by cast id %u failed [%s]",
|
||||
key_name.toUtf8().constData(),q->value(0).toUInt(),
|
||||
err_msg.toUtf8().constData());
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
|
Loading…
x
Reference in New Issue
Block a user