2025-07-05 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in rdadmin(1) that thew a SQL error when creating
	a new Host record.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2025-07-05 17:42:51 -04:00
parent 4a4dc6bbd1
commit abfb782a91
2 changed files with 10 additions and 11 deletions

View File

@@ -25025,3 +25025,6 @@
* Fixed a bug in the 'Edit Audio' dialog in rdlibrary(1) that caused
a marker to be removed from the view if it was dragged beyond the
left hand edge of the view.
2025-07-05 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in rdadmin(1) that thew a SQL error when creating
a new Host record.

View File

@@ -37,18 +37,14 @@ RDAirPlayConf::RDAirPlayConf(const QString &station,const QString &tablename)
sql=QString("select `ID` from `")+air_tablename+"` where "+
"`STATION`='"+RDEscapeString(air_station)+"'";
q=new RDSqlQuery(sql);
if(!q->first()) {
delete q;
sql=QString("insert into `")+air_tablename+"` set "+
"`STATION`='"+RDEscapeString(air_station)+"'";
q=new RDSqlQuery(sql);
delete q;
sql=QString("select `ID` from `")+air_tablename+"` where "+
"`STATION`='"+RDEscapeString(air_station)+"'";
q=new RDSqlQuery(sql);
q->first();
if(q->first()) {
air_id=q->value(0).toUInt();
}
else {
air_id=-1;
fprintf(stderr,"RDAirplayConf - no STATION record found for host \"%s\"\n",
air_station.toUtf8().constData());
}
air_id=q->value(0).toUInt();
delete q;
}