mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-12-01 14:20:11 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user