From cccf4d39c80284f0377a443ed8d55eab01131860 Mon Sep 17 00:00:00 2001 From: Fred Gleason Date: Mon, 15 May 2023 14:17:32 -0400 Subject: [PATCH] 2023-05-15 Fred Gleason * Fixed a regression in rdcastmanager(1) which broke display of superfeed items in the 'Podcast Item List' dialog. Signed-off-by: Fred Gleason --- ChangeLog | 3 +++ lib/rdpodcastlistmodel.cpp | 39 +++++++++++++++++++++++++++++++++----- lib/rdpodcastlistmodel.h | 3 ++- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 524d65d5..e0391c21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24085,3 +24085,6 @@ a static value of "/usr/lib/rivendell/pypad". * Added a 'CDN Purge Plug-In' control to the 'Feed' dialog in rdadmin(1). +2023-05-15 Fred Gleason + * Fixed a regression in rdcastmanager(1) which broke display + of superfeed items in the 'Podcast Item List' dialog. diff --git a/lib/rdpodcastlistmodel.cpp b/lib/rdpodcastlistmodel.cpp index afdb11ac..5a6dc2fc 100644 --- a/lib/rdpodcastlistmodel.cpp +++ b/lib/rdpodcastlistmodel.cpp @@ -27,7 +27,31 @@ RDPodcastListModel::RDPodcastListModel(unsigned feed_id,QObject *parent) : QAbstractTableModel(parent) { - d_feed_id=feed_id; + QString sql=QString("select ")+ + "`IS_SUPERFEED` "+ // 00 + "from `FEEDS` where "+ + QString::asprintf("`ID`=%u",feed_id); + RDSqlQuery *q=new RDSqlQuery(sql); + if(q->first()) { + if(q->value(0).toString()=="Y") { + sql=QString("select ")+ + "`MEMBER_FEED_ID` "+ // 00 + "from `SUPERFEED_MAPS` where "+ + QString::asprintf("`FEED_ID`=%u ",feed_id); + RDSqlQuery *q1=new RDSqlQuery(sql); + while(q1->next()) { + d_feed_ids.push_back(q1->value(0).toUInt()); + } + delete q1; + } + else { + d_feed_ids.push_back(feed_id); + } + } + else { + d_feed_ids.push_back(feed_id); + } + d_font_metrics=NULL; d_bold_font_metrics=NULL; d_sort_column=0; @@ -304,7 +328,8 @@ void RDPodcastListModel::processNotification(RDNotification *notify) case RDNotification::AddAction: cast_id=notify->id().toUInt(); cast=new RDPodcast(rda->config(),cast_id); - if(cast->feedId()==d_feed_id) { + // if(cast->feedId()==d_feed_id) { + if(d_feed_ids.contains(cast->feedId())) { addCast(cast_id); } delete cast; @@ -333,9 +358,13 @@ void RDPodcastListModel::updateModel() RDSqlQuery *q=NULL; QString sql=sqlFields()+ - "where "+ - QString::asprintf("`PODCASTS`.`FEED_ID`=%u ",d_feed_id)+ - d_filter_sql+ + "where "; + // sql+=QString::asprintf("`PODCASTS`.`FEED_ID`=%u ",d_feed_ids.at(0)); + for(int i=0;i > d_texts; QList d_item_image_ids; QList d_status_pixmaps; - unsigned d_feed_id; + // unsigned d_feed_id; + QList d_feed_ids; QString d_filter_sql; QStringList d_column_fields; int d_sort_column;