mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-08 16:37:46 +02:00
2022-12-06 Fred Gleason <fredg@paravelsystems.com>
* Fixed a regression in rdcastmanager(1) that caused newly added feed items to be listed twice in the 'Podcast Item List' dialog. * Fixed a bug in 'RDPodcastListModel' that broke item delete notifications. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
9bae0c81ab
commit
76c8ca80c7
@ -23745,3 +23745,8 @@
|
||||
2022-12-05 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a bug in the log rendering code that caused voicetracks to
|
||||
be faded during the trailing transition.
|
||||
2022-12-06 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a regression in rdcastmanager(1) that caused newly added
|
||||
feed items to be listed twice in the 'Podcast Item List' dialog.
|
||||
* Fixed a bug in 'RDPodcastListModel' that broke item delete
|
||||
notifications.
|
||||
|
@ -48,19 +48,22 @@ int __RDPodcast_Debug_Callback(CURL *handle,curl_infotype type,char *data,
|
||||
RDPodcast::RDPodcast(RDConfig *config,unsigned id)
|
||||
{
|
||||
podcast_config=config;
|
||||
podcast_feed_id=0;
|
||||
|
||||
RDSqlQuery *q;
|
||||
QString sql;
|
||||
|
||||
podcast_id=id;
|
||||
sql=QString("select ")+
|
||||
"`FEEDS`.KEY_NAME "+
|
||||
"`FEEDS`.`ID`,"+ // 00
|
||||
"`FEEDS`.KEY_NAME "+ // 01
|
||||
"from `PODCASTS` left join `FEEDS` "+
|
||||
"on (`PODCASTS`.`FEED_ID`=`FEEDS`.`ID`) "+
|
||||
QString::asprintf("where `PODCASTS`.`ID`=%u",id);
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
podcast_keyname=q->value(0).toString();
|
||||
podcast_feed_id=q->value(0).toUInt();
|
||||
podcast_keyname=q->value(1).toString();
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
@ -86,8 +89,7 @@ bool RDPodcast::exists() const
|
||||
|
||||
unsigned RDPodcast::feedId() const
|
||||
{
|
||||
return RDGetSqlValue("PODCASTS","ID",podcast_id,"FEED_ID").
|
||||
toUInt();
|
||||
return podcast_feed_id;
|
||||
}
|
||||
|
||||
|
||||
|
@ -92,6 +92,7 @@ class RDPodcast
|
||||
void SetRow(const QString ¶m,const QDateTime &datetime,
|
||||
const QString &value) const;
|
||||
QString podcast_keyname;
|
||||
unsigned podcast_feed_id;
|
||||
unsigned podcast_id;
|
||||
RDConfig *podcast_config;
|
||||
};
|
||||
|
@ -185,6 +185,9 @@ unsigned RDPodcastListModel::castId(const QModelIndex &row) const
|
||||
|
||||
QModelIndex RDPodcastListModel::addCast(unsigned cast_id)
|
||||
{
|
||||
QModelIndex ret;
|
||||
|
||||
if(!d_cast_ids.contains(cast_id)) {
|
||||
beginInsertRows(QModelIndex(),0,0);
|
||||
QList<QVariant> list;
|
||||
for(int i=0;i<columnCount();i++) {
|
||||
@ -195,8 +198,10 @@ QModelIndex RDPodcastListModel::addCast(unsigned cast_id)
|
||||
d_icons.insert(0,list);
|
||||
updateRowLine(0);
|
||||
endInsertRows();
|
||||
ret=createIndex(0,0);
|
||||
}
|
||||
|
||||
return createIndex(0,0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -268,7 +273,6 @@ void RDPodcastListModel::processNotification(RDNotification *notify)
|
||||
if(notify->type()==RDNotification::FeedItemType) {
|
||||
cast_id=notify->id().toUInt();
|
||||
cast=new RDPodcast(rda->config(),cast_id);
|
||||
if(cast->feedId()==d_feed_id) {
|
||||
switch(notify->action()) {
|
||||
case RDNotification::AddAction:
|
||||
addCast(cast_id);
|
||||
@ -285,8 +289,6 @@ void RDPodcastListModel::processNotification(RDNotification *notify)
|
||||
case RDNotification::LastAction:
|
||||
case RDNotification::NoAction:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
delete cast;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user